drm/msm/sde: limit the backlight min brightness as bl_min_level

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 such as level '1 - 9' in liberty, 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: I0c1c76b959e33c2eaa551cd30875e05e983e5ecb
Signed-off-by: tanhua1 <tanhua1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1583985
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Hua Tan <tanhua1@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
tanhua1 authored and Gilberto Gambugge committed 2023-06-01 00:43:20 -03:00
1 parent 75a2ceffd5
commit 8a85c98dcf
1 file changed
+3
+3
View File
@@ -88,6 +88,9 @@ static int sde_backlight_device_update_status(struct backlight_device *bd)
if (brightness > display->panel->bl_config.bl_max_level)
brightness = display->panel->bl_config.bl_max_level;
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);