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>
Цей коміт міститься в:
Ping Li
2021-07-27 20:44:04 -07:00
джерело b04d8af8da
коміт b7506f0222
2 змінених файлів з 5 додано та 4 видалено

Переглянути файл

@@ -245,8 +245,6 @@ int dsi_display_set_backlight(struct drm_connector *connector,
bl_scale_sv = panel->bl_config.bl_scale_sv;
bl_temp = (u32)bl_temp * bl_scale_sv / MAX_SV_BL_SCALE_LEVEL;
if (bl_temp > panel->bl_config.bl_max_level)
bl_temp = panel->bl_config.bl_max_level;
/* use bl_temp as index of dimming bl lut to find the dimming panel backlight */
if (bl_temp != 0 && panel->bl_config.dimming_bl_lut &&
@@ -256,6 +254,9 @@ int dsi_display_set_backlight(struct drm_connector *connector,
bl_temp = panel->bl_config.dimming_bl_lut->mapped_bl[bl_temp];
}
if (bl_temp > panel->bl_config.bl_max_level)
bl_temp = panel->bl_config.bl_max_level;
pr_debug("bl_scale = %u, bl_scale_sv = %u, bl_lvl = %u\n",
bl_scale, bl_scale_sv, (u32)bl_temp);

Переглянути файл

@@ -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;