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

Commit 15e83efb authored by Aravind Venkateswaran's avatar Aravind Venkateswaran
Browse files

drm/msm/dsi-staging: handoff backlight level for cont splash



When continuous splash screen feature is enabled, the display panel
is left on from the bootloader. As part of the transition to kernel,
the backlight level also needs to be handed off. Otherwise, it is
possible that the kernel can inadvertently set the backlight level
to zero and result in what appears like a black screen during
the transition from splash screen to boot animation. Add this support to
read the current backlight level for WLED backlight type and set it
during handoff. For other backlight types, set it to a default
value.

CRs-Fixed: 2248169
Change-Id: Ic003a1432eefbf8b9a34457440f995bbe29f5c9b
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
parent 9327317f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3980,6 +3980,9 @@ int dsi_display_cont_splash_config(void *dsi_display)
	dsi_config_host_engine_state_for_cont_splash(display);
	mutex_unlock(&display->display_lock);

	/* Set the current brightness level */
	dsi_panel_bl_handoff(display->panel);

	return rc;

clks_disabled:
+34 −0
Original line number Diff line number Diff line
@@ -644,6 +644,40 @@ int dsi_panel_set_backlight(struct dsi_panel *panel, u32 bl_lvl)
	return rc;
}

static u32 dsi_panel_get_brightness(struct dsi_backlight_config *bl)
{
	u32 cur_bl_level;
	struct backlight_device *bd = bl->raw_bd;

	/* default the brightness level to 50% */
	cur_bl_level = bl->bl_max_level >> 1;

	switch (bl->type) {
	case DSI_BACKLIGHT_WLED:
		/* Try to query the backlight level from the backlight device */
		if (bd->ops && bd->ops->get_brightness)
			cur_bl_level = bd->ops->get_brightness(bd);
		break;
	case DSI_BACKLIGHT_DCS:
	default:
		/*
		 * Ideally, we should read the backlight level from the
		 * panel. For now, just set it default value.
		 */
		break;
	}

	pr_debug("cur_bl_level=%d\n", cur_bl_level);
	return cur_bl_level;
}

void dsi_panel_bl_handoff(struct dsi_panel *panel)
{
	struct dsi_backlight_config *bl = &panel->bl_config;

	bl->bl_level = dsi_panel_get_brightness(bl);
}

static int dsi_panel_bl_register(struct dsi_panel *panel)
{
	int rc = 0;
+2 −0
Original line number Diff line number Diff line
@@ -285,6 +285,8 @@ int dsi_panel_post_switch(struct dsi_panel *panel);

void dsi_dsc_pclk_param_calc(struct msm_display_dsc_info *dsc, int intf_width);

void dsi_panel_bl_handoff(struct dsi_panel *panel);

struct dsi_panel *dsi_panel_ext_bridge_get(struct device *parent,
				struct device_node *of_node,
				int topology_override);