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

Commit 2638bebf authored by Aravind Venkateswaran's avatar Aravind Venkateswaran
Browse files

msm: mdss: dsi: fix handling of ulps_suspend feature flag



In the current implementation, when ulps_suspend feature is enabled, it
results in ULPS mode being configured even when turning off clocks
during idle screen use cases. Fix this by correcting the conditional
logic when turning off the link clocks.

CRs-Fixed: 912434
Change-Id: I44e8556afcc5110afb9e2193e8558306847e90a0
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
parent 50e0173f
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -1089,7 +1089,7 @@ static int mdss_dsi_ulps_config(struct mdss_dsi_ctrl_pdata *ctrl,
	pinfo = &pdata->panel_info;
	mipi = &pinfo->mipi;

	if (!mdss_dsi_ulps_feature_enabled(pdata) ||
	if (!mdss_dsi_ulps_feature_enabled(pdata) &&
			!pinfo->ulps_suspend_enabled) {
		pr_debug("%s: ULPS feature is not enabled\n", __func__);
		return 0;
@@ -1446,8 +1446,18 @@ int mdss_dsi_pre_clkoff_cb(void *priv,
	pdata = &ctrl->panel_data;

	if ((clk & MDSS_DSI_LINK_CLK) && (new_state == MDSS_DSI_CLK_OFF)) {

		/*
		 * If ULPS feature is enabled, enter ULPS first.
		 * However, when blanking the panel, we should enter ULPS
		 * only if ULPS during suspend feature is enabled.
		 */
		if (pdata->panel_info.blank_state ==
			MDSS_PANEL_BLANK_BLANK) {
			if (pdata->panel_info.ulps_suspend_enabled)
				mdss_dsi_ulps_config(ctrl, 1);
		} else if (mdss_dsi_ulps_feature_enabled(pdata)) {
			rc = mdss_dsi_ulps_config(ctrl, 1);
		}
		if (rc) {
			pr_err("%s: failed enable ulps, rc = %d\n",
			       __func__, rc);
@@ -1537,6 +1547,7 @@ int mdss_dsi_post_clkon_cb(void *priv,
		}
	}
	if (clk & MDSS_DSI_LINK_CLK) {
		if (ctrl->ulps) {
			rc = mdss_dsi_ulps_config(ctrl, 0);
			if (rc) {
				pr_err("%s: failed to disable ulps, rc= %d\n",
@@ -1544,6 +1555,7 @@ int mdss_dsi_post_clkon_cb(void *priv,
				goto error;
			}
		}
	}
error:
	return rc;
}