The last nit should be treated specially and should be selected
iff max brightness is set.
Change-Id: Ifa58b0f6ced9859485ee727eb296415fa50e4cd0
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
int bri = ctx->bl_dev->props.brightness;
const int *nits = ctx->hmt_mode ? hmt_nits : s6e3ha2_nits[ctx->model];
const int count = ctx->hmt_mode ? HMT_NITS_COUNT : S6E3HA2_NITS_COUNT;
- int nit, b = 0, e = count, m;
+ int nit, b = 0, e = count - 1, m;
+
+ if (bri == MAX_BRIGHTNESS) {
+ ctx->nit_index = e;
+ return;
+ }
nit = bri * nits[count - 1] / MAX_BRIGHTNESS;