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

Skip to content
Commit 268d654d authored by Peter Cai's avatar Peter Cai
Browse files

drm: msm: default to FOD dimming when calculating alpha

* Since commit ac878e6b, DC dimming has been introduced, which shares
some logic with FOD. The original function to calculate alpha to dim the
screen to the same brightness before enabling HBM has been modified to
also work with DC dimming. It distinguishes the two cases (FOD and DC)
with the flag `dim_status`.

* However, in our user-space implementation of FOD, the `dim_status`
flag is only set AFTER the FOD icon has been pressed by the user, unlike
in official ROM where they enable dimming whenever the FOD icon shows
up which breaks the image quality terribly. Our different order caused
the userspace code to read the alpha value before the flag is actually
set, and thus being incorrect, causing severe blinking when using FOD.

* Fix this by defaulting to using the flag `op_dimlayer_bl_enable` for
distinguishing between FOD and DC, so as long as DC dimming is not
enabled (which is always the case because we haven't even implemented DC
dimming in our userspace), the value read by userspace is always the one
for FOD. If we were ever to implement DC dimming, we should probably
separate these two interfaces to two sysfs nodes instead of sharing a
common one to avoid confusion.

Change-Id: I1aa2bdad330a6b555f7025e6fff3fa1684052726
parent 794b511a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment