Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 2ebbf7b5 authored by Krishna Chaitanya Parimi's avatar Krishna Chaitanya Parimi Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarKrishna Chaitanya Parimi <cparimi@codeaurora.org>
parent 0f4cf33d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment