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

Commit 17899bc1 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

drm/msm/dp: fix link training during system resume



Power on the link clocks and complete the link training
when coming out of deep sleep. This is required as all
the DisplayPort clocks are shutdown during suspend. On
wake-up, enable the required clocks and complete the
link training as DisplayPort status may have changed
during sleep.

CRs-Fixed: 2294347
Change-Id: Ibeaf21448507415343aac307b4fab8f6e3609b74
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent fd273d2c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1096,6 +1096,9 @@ static int dp_ctrl_on(struct dp_ctrl *dp_ctrl, bool mst_mode)

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

	if (ctrl->power_on)
		goto end;

	ctrl->mst_mode = mst_mode;
	rate = ctrl->panel->link_info.rate;

@@ -1130,6 +1133,9 @@ static void dp_ctrl_off(struct dp_ctrl *dp_ctrl)

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

	if (!ctrl->power_on)
		return;

	dp_ctrl_configure_source_link_params(ctrl, false);
	ctrl->catalog->reset(ctrl->catalog);

+18 −10
Original line number Diff line number Diff line
@@ -707,6 +707,11 @@ static int dp_display_process_hpd_low(struct dp_display_private *dp)

	rc = dp_display_send_hpd_notification(dp);

	mutex_lock(&dp->session_lock);
	if (!dp->active_stream_cnt)
		dp->ctrl->off(dp->ctrl);
	mutex_unlock(&dp->session_lock);

	dp->panel->video_test = false;

	return rc;
@@ -1250,6 +1255,7 @@ static int dp_display_prepare(struct dp_display *dp_display, void *panel)
{
	struct dp_display_private *dp;
	struct dp_panel *dp_panel;
	int rc = 0;

	if (!dp_display || !panel) {
		pr_err("invalid input\n");
@@ -1272,9 +1278,13 @@ static int dp_display_prepare(struct dp_display *dp_display, void *panel)
	if (dp->power_on)
		goto end;

	if (dp_display_is_ready(dp))
	if (!dp_display_is_ready(dp))
		goto end;

	dp_display_host_init(dp);
	else

	rc = dp->ctrl->on(dp->ctrl, dp->mst.mst_active);
	if (rc)
		goto end;

	if (dp->debug->psm_enabled) {
@@ -1376,10 +1386,8 @@ static int dp_display_enable(struct dp_display *dp_display, void *panel)
	}

	rc = dp_display_stream_enable(dp, panel);
	if (rc && (dp->active_stream_cnt == 0)) {
		dp->ctrl->off(dp->ctrl);
	if (rc)
		goto end;
	}

	dp->power_on = true;
end:
@@ -1413,7 +1421,7 @@ static int dp_display_post_enable(struct dp_display *dp_display, void *panel)
	mutex_lock(&dp->session_lock);

	if (!dp->power_on) {
		pr_debug("Link not setup, return\n");
		pr_debug("stream not setup, return\n");
		goto end;
	}

@@ -1482,7 +1490,7 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel)
	mutex_lock(&dp->session_lock);

	if (!dp->power_on) {
		pr_debug("Link already powered off, return\n");
		pr_debug("stream already powered off, return\n");
		goto end;
	}

@@ -1552,8 +1560,6 @@ static int dp_display_disable(struct dp_display *dp_display, void *panel)
		goto end;
	}

	dp->ctrl->off(dp->ctrl);

	/*
	 * In case of framework reboot, the DP off sequence is executed without
	 * any notification from driver. Initialize post_open callback to notify
@@ -1562,6 +1568,8 @@ static int dp_display_disable(struct dp_display *dp_display, void *panel)
	if (dp_display_is_ready(dp) && !dp->mst.mst_active) {
		dp_display->post_open = dp_display_post_open;
		dp->dp_display.is_sst_connected = false;

		dp->ctrl->off(dp->ctrl);
		dp_display_host_deinit(dp);
	}