diff --git a/include/uapi/display/drm/msm_drm_pp.h b/include/uapi/display/drm/msm_drm_pp.h index e8802114d2..b0ea33ced5 100644 --- a/include/uapi/display/drm/msm_drm_pp.h +++ b/include/uapi/display/drm/msm_drm_pp.h @@ -732,6 +732,8 @@ struct drm_msm_backlight_info { __u32 bl_scale_sv; __u32 status; __u32 min_bl; + __u32 bl_scale_max; + __u32 bl_scale_sv_max; }; #define DIMMING_BL_LUT_LEN 8192 diff --git a/msm/dsi/dsi_panel.h b/msm/dsi/dsi_panel.h index a5a55922c8..e3000cb972 100644 --- a/msm/dsi/dsi_panel.h +++ b/msm/dsi/dsi_panel.h @@ -25,6 +25,7 @@ #define MAX_BL_LEVEL 4096 #define MAX_BL_SCALE_LEVEL 1024 #define MAX_SV_BL_SCALE_LEVEL 65535 +#define SV_BL_SCALE_CAP (MAX_SV_BL_SCALE_LEVEL * 4) #define DSI_CMD_PPS_SIZE 135 #define DSI_CMD_PPS_HDR_SIZE 7 diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c index c27cfdce42..765b9281e3 100644 --- a/msm/sde/sde_connector.c +++ b/msm/sde/sde_connector.c @@ -120,6 +120,8 @@ static void sde_dimming_bl_notify(struct sde_connector *conn, struct dsi_backlig bl_info.bl_scale_sv = config->bl_scale_sv; bl_info.status = config->dimming_status; bl_info.min_bl = config->dimming_min_bl; + bl_info.bl_scale_max = MAX_BL_SCALE_LEVEL; + bl_info.bl_scale_sv_max = SV_BL_SCALE_CAP; event.type = DRM_EVENT_DIMMING_BL; event.length = sizeof(bl_info); SDE_DEBUG("dimming BL event bl_level %d bl_scale %d, bl_scale_sv = %d " @@ -833,7 +835,8 @@ static int _sde_connector_update_bl_scale(struct sde_connector *c_conn) bl_config->bl_scale = c_conn->bl_scale > MAX_BL_SCALE_LEVEL ? MAX_BL_SCALE_LEVEL : c_conn->bl_scale; - bl_config->bl_scale_sv = c_conn->bl_scale_sv; + bl_config->bl_scale_sv = c_conn->bl_scale_sv > SV_BL_SCALE_CAP ? + SV_BL_SCALE_CAP : c_conn->bl_scale_sv; SDE_DEBUG("bl_scale = %u, bl_scale_sv = %u, bl_level = %u\n", bl_config->bl_scale, bl_config->bl_scale_sv,