sde: limit the backlight minimum brightness as bl_min_level

PROPAGATED_from (CR)

High-precision brightness will set the brightness level from bl_min_level to
bl_max_level. If we enable 12bit brightness, in fact, the hardware will not
tolerate very low brightness, these levels cause the backlight unstable.

So we have to define the minimum brightness by 'qcom,mdss-dsi-bl-min-level'
that the driver does not set the backlight level below that.

Change-Id: Ifa20a92388c6dab20cf5550868f3f3685815936f
Reviewed-on: https://gerrit.mot.com/1782945
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
houdz1 2020-05-26 10:20:31 +08:00 • committed by tongkun1
commit 4a042b2f3f

View file

@ -120,6 +120,9 @@ static int sde_backlight_device_update_status(struct backlight_device *bd)
if (brightness > c_conn->thermal_max_brightness)
brightness = c_conn->thermal_max_brightness;
if(brightness && brightness < display->panel->bl_config.bl_min_level)
brightness = display->panel->bl_config.bl_min_level;
/* map UI brightness into driver backlight level with rounding */
bl_lvl = mult_frac(brightness, display->panel->bl_config.bl_max_level,
display->panel->bl_config.brightness_max_level);