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

Commit 28db567b authored by Sankeerth Billakanti's avatar Sankeerth Billakanti Committed by Gerrit - the friendly Code Review server
Browse files

disp: msm: dp: avoid register access when lclk is off



Sometimes the link clock is not getting locked when dp
display is resumed from PM suspend. This is causing NOC
error when registers in link clock domain are accessed
without proper checks.

The set_colorspace, config_hdr and update_pps connector
ops are accessing the registers in link clock domain
without checking if the necessary clocks are enabled.
These changes will ensure the DP stream clocks are not
enabled when link clock enable fails and prevents the
connector ops from accessing the registers whose clocks
are not enabled.

Change-Id: If89d2552ee0ce96493ee8c1666d7677221705d9a
Signed-off-by: default avatarSankeerth Billakanti <sbillaka@codeaurora.org>
parent 452d137b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1170,6 +1170,11 @@ static int dp_ctrl_stream_on(struct dp_ctrl *dp_ctrl, struct dp_panel *panel)

	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);

	if (!ctrl->power_on) {
		DP_ERR("ctrl off\n");
		return -EINVAL;
	}

	rc = dp_ctrl_enable_stream_clocks(ctrl, panel);
	if (rc) {
		DP_ERR("failure on stream clock enable\n");
+19 −1
Original line number Diff line number Diff line
@@ -1893,7 +1893,7 @@ static int dp_display_prepare(struct dp_display *dp_display, void *panel)
	mutex_unlock(&dp->session_lock);

	SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, dp->state);
	return 0;
	return rc;
}

static int dp_display_set_stream_info(struct dp_display *dp_display,
@@ -2539,6 +2539,11 @@ static int dp_display_config_hdr(struct dp_display *dp_display, void *panel,
		return -EINVAL;
	}

	if (!dp_display_state_is(DP_STATE_ENABLED)) {
		dp_display_state_show("[not enabled]");
		return 0;
	}

	/*
	 * In rare cases where HDR metadata is updated independently
	 * flush the HDR metadata immediately instead of relying on
@@ -2560,12 +2565,20 @@ static int dp_display_setup_colospace(struct dp_display *dp_display,
		u32 colorspace)
{
	struct dp_panel *dp_panel;
	struct dp_display_private *dp;

	if (!dp_display || !panel) {
		pr_err("invalid input\n");
		return -EINVAL;
	}

	dp = container_of(dp_display, struct dp_display_private, dp_display);

	if (!dp_display_state_is(DP_STATE_ENABLED)) {
		dp_display_state_show("[not enabled]");
		return 0;
	}

	dp_panel = panel;

	return dp_panel->set_colorspace(dp_panel, colorspace);
@@ -2898,6 +2911,11 @@ static int dp_display_update_pps(struct dp_display *dp_display,
		return -EINVAL;
	}

	if (!dp_display_state_is(DP_STATE_ENABLED)) {
		dp_display_state_show("[not enabled]");
		return 0;
	}

	dp_panel = sde_conn->drv_panel;
	dp_panel->update_pps(dp_panel, pps_cmd);
	return 0;