disp:msm:sde: correct the brightness bound check

The brightness value from backlight device is OS brightness, not panel
backlight value. This change corrects the brightness bound check to
check against the OS brightness max value instead of panel backlight max
value. This change also move the bound check in dsi display to make sure
the max backlight value send to panel is within the expected range.

Change-Id: Ic9e3ba69700ae4c0e950cb665837a1f0a1317b26
Signed-off-by: Ping Li <pingli@codeaurora.org>
Tento commit je obsažen v:
Ping Li
2021-07-27 20:44:04 -07:00
rodič b04d8af8da
revize b7506f0222
2 změnil soubory, kde provedl 5 přidání a 4 odebrání

Zobrazit soubor

@@ -147,8 +147,8 @@ static int sde_backlight_device_update_status(struct backlight_device *bd)
brightness = 0;
display = (struct dsi_display *) c_conn->display;
if (brightness > display->panel->bl_config.bl_max_level)
brightness = display->panel->bl_config.bl_max_level;
if (brightness > display->panel->bl_config.brightness_max_level)
brightness = display->panel->bl_config.brightness_max_level;
if (brightness > c_conn->thermal_max_brightness)
brightness = c_conn->thermal_max_brightness;