From bcbb73401015c40ddc74bbcd1dd8bc61e38abcd1 Mon Sep 17 00:00:00 2001 From: Steve Cohen Date: Thu, 9 May 2019 17:18:17 -0400 Subject: [PATCH] disp: msm: sde: delay backlight update until the first commit In the current implementation panel set backlight can be called even before receiving a frame from the driver during the first commit. Hence there is chance for some garbage content to be shown onto the panel. So this change imposes a condition to delay backlight update of the panel until the first frame is received from the HW. This change includes only a missing portion of the original that was somehow left out of the snapshot ported to 4.19. Original change ID is preserved. Change-Id: I735a97088efef91159e724bba615549dba49e4e3 Signed-off-by: Tharun Raj Soma Signed-off-by: Steve Cohen --- msm/sde/sde_connector.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c index d0a7bb1eaa08..3f3b9c7a1047 100644 --- a/msm/sde/sde_connector.c +++ b/msm/sde/sde_connector.c @@ -535,21 +535,27 @@ static int _sde_connector_update_bl_scale(struct sde_connector *c_conn) bl_config = &dsi_display->panel->bl_config; - if (c_conn->bl_scale > MAX_BL_SCALE_LEVEL) - bl_config->bl_scale = MAX_BL_SCALE_LEVEL; - else - bl_config->bl_scale = c_conn->bl_scale; + if (dsi_display->panel->bl_config.bl_update == + BL_UPDATE_DELAY_UNTIL_FIRST_FRAME && + !c_conn->allow_bl_update) { + c_conn->unset_bl_level = bl_config->bl_level; + return 0; + } - if (c_conn->bl_scale_sv > MAX_SV_BL_SCALE_LEVEL) - bl_config->bl_scale_sv = MAX_SV_BL_SCALE_LEVEL; - else - bl_config->bl_scale_sv = c_conn->bl_scale_sv; + if (c_conn->unset_bl_level) + bl_config->bl_level = c_conn->unset_bl_level; + + 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 > MAX_SV_BL_SCALE_LEVEL ? + MAX_SV_BL_SCALE_LEVEL : 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, bl_config->bl_level); rc = c_conn->ops.set_backlight(&c_conn->base, dsi_display, bl_config->bl_level); + c_conn->unset_bl_level = 0; return rc; }