msm: mdss: alter linear_map to incorporate rounding for AD
The helper function linear_map would take the integral part
of the calculated map, thereby causing issues with getting
the same value after consecutive map and inverse map calls.
For ex: linear_map(21, out, 255, 4095) would translate to
*out = 21 * 4095 / 255 = 337, whereas inverse case
linear_map(337, out, 4095, 255) would translate to
*out = 337 * 255 / 4095 = 20
Changing linear_map from ((in * out_max) / in_max) to a more
precise ((2 * (in * out_max) + in_max) / (2 * in_max)) for
incorporating rounding in the integral mapping.
Change-Id: I15cd8aa1326813ce3cb3a426cbb4e78374623c72
Signed-off-by:
Krishna Chaitanya Parimi <cparimi@codeaurora.org>
Loading
Please register or sign in to comment