sm8250-common: fod: Improve dimming formula

Change-Id: Ie043d49e8954d061f355ed51f4c02a2cacdb04ba
This commit is contained in:
MB 2021-03-10 21:32:40 +01:00 committed by Sebastiano Barezzi
parent 2a28b637c2
commit c21283896c
No known key found for this signature in database
GPG Key ID: 47760583F393BC44

View File

@ -105,10 +105,14 @@ Return<int32_t> FingerprintInscreen::getDimAmount(int32_t) {
float alpha;
int realBrightness = get(BRIGHTNESS_PATH, 0);
if (realBrightness > 500) {
alpha = 1.0 - pow(realBrightness / 2047.0 * 430.0 / 600.0, 0.455);
if (realBrightness >= 500) {
alpha = 1.0 - pow(realBrightness / 2047.0 * 430.0 / 600.0, 0.485);
} else if (realBrightness >= 250) {
alpha = 1.0 - pow(realBrightness / 2047.0 * 430.0 / 600.0, 0.530);
} else if (realBrightness > 60) {
alpha = 1.0 - pow(realBrightness / 1680.0, 0.525);
} else {
alpha = 1.0 - pow(realBrightness / 1680.0, 0.455);
alpha = 1.0 - pow(realBrightness / 1680.0, 0.475);
}
return 255 * alpha;