Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcbb7340 authored by Steve Cohen's avatar Steve Cohen
Browse files

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: default avatarTharun Raj Soma <tsoma@codeaurora.org>
Signed-off-by: default avatarSteve Cohen <cohens@codeaurora.org>
parent 51e46a53
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -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;
}