linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sankeerth Billakanti <quic_sbillaka@quicinc.com>
To: <dri-devel@lists.freedesktop.org>,
	<linux-arm-msm@vger.kernel.org>,
	<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Cc: Sankeerth Billakanti <quic_sbillaka@quicinc.com>,
	<robdclark@gmail.com>, <seanpaul@chromium.org>,
	<swboyd@chromium.org>, <kalyan_t@codeaurora.org>,
	<abhinavk@codeaurora.org>, <dianders@chromium.org>,
	<khsieh@codeaurora.org>, <mkrishn@codeaurora.org>,
	<sbillaka@codeaurora.org>
Subject: [PATCH v3 5/6] drm/msm/dp: Enable ASSR for supported DP sinks
Date: Thu, 28 Oct 2021 07:24:47 +0530	[thread overview]
Message-ID: <1635386088-18089-6-git-send-email-quic_sbillaka@quicinc.com> (raw)
In-Reply-To: <1635386088-18089-1-git-send-email-quic_sbillaka@quicinc.com>

The eDP sink on sc7280 supports ASSR and dp driver will
enable ASSR in the source hardware. The driver needs to
enable the ASSR field in the DPCD configuration register
to avoid screen corruption. This change will enable ASSR
if supported in the sink device.

Signed-off-by: Sankeerth Billakanti <quic_sbillaka@quicinc.com>
---
 drivers/gpu/drm/msm/dp/dp_ctrl.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
index a40e798..c724cb0 100644
--- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
+++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
@@ -119,13 +119,13 @@ void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl)
 static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl)
 {
 	u32 config = 0, tbd;
-	u8 *dpcd = ctrl->panel->dpcd;
+	const u8 *dpcd = ctrl->panel->dpcd;
 
 	/* Default-> LSCLK DIV: 1/4 LCLK  */
 	config |= (2 << DP_CONFIGURATION_CTRL_LSCLK_DIV_SHIFT);
 
 	/* Scrambler reset enable */
-	if (dpcd[DP_EDP_CONFIGURATION_CAP] & DP_ALTERNATE_SCRAMBLER_RESET_CAP)
+	if (drm_dp_alternate_scrambler_reset_cap(dpcd))
 		config |= DP_CONFIGURATION_CTRL_ASSR;
 
 	tbd = dp_link_get_test_bits_depth(ctrl->link,
@@ -1231,6 +1231,7 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl,
 	const u8 *dpcd = ctrl->panel->dpcd;
 	u8 encoding = DP_SET_ANSI_8B10B;
 	u8 ssc;
+	u8 assr;
 	struct dp_link_info link_info = {0};
 
 	dp_ctrl_config_ctrl(ctrl);
@@ -1249,6 +1250,12 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl,
 	drm_dp_dpcd_write(ctrl->aux, DP_MAIN_LINK_CHANNEL_CODING_SET,
 				&encoding, 1);
 
+	if (drm_dp_alternate_scrambler_reset_cap(dpcd)) {
+		assr = DP_ALTERNATE_SCRAMBLER_RESET_ENABLE;
+		drm_dp_dpcd_write(ctrl->aux, DP_EDP_CONFIGURATION_SET,
+				&assr, 1);
+	}
+
 	ret = dp_ctrl_link_train_1(ctrl, training_step);
 	if (ret) {
 		DRM_ERROR("link training #1 failed. ret=%d\n", ret);
-- 
2.7.4


  parent reply	other threads:[~2021-10-28  1:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28  1:54 [PATCH v3 0/6] Add support for eDP controller on SC7280 Sankeerth Billakanti
2021-10-28  1:54 ` [PATCH v3 1/6] dt-bindings: msm/dp: Add DP compatible strings for sc7280 Sankeerth Billakanti
2021-10-28  6:20   ` Stephen Boyd
2021-10-28  1:54 ` [PATCH v3 2/6] drm/msm/dp: Add DP controllers " Sankeerth Billakanti
2021-10-28  6:21   ` Stephen Boyd
2021-10-28  1:54 ` [PATCH v3 3/6] drm/dp: Add macro to check max_downspread capability Sankeerth Billakanti
2021-10-28  6:31   ` Stephen Boyd
2021-10-28  1:54 ` [PATCH v3 4/6] drm/msm/dp: Enable downspread for supported DP sinks Sankeerth Billakanti
2021-10-28  6:33   ` Stephen Boyd
2021-10-28  1:54 ` Sankeerth Billakanti [this message]
2021-10-28  6:34   ` [PATCH v3 5/6] drm/msm/dp: Enable ASSR " Stephen Boyd
2021-10-28  1:54 ` [PATCH v3 6/6] drm/msm/dp: Remove the hpd init delay for eDP Sankeerth Billakanti
2021-10-28  6:38   ` Stephen Boyd
2021-10-29 17:20     ` khsieh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1635386088-18089-6-git-send-email-quic_sbillaka@quicinc.com \
    --to=quic_sbillaka@quicinc.com \
    --cc=abhinavk@codeaurora.org \
    --cc=dianders@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=kalyan_t@codeaurora.org \
    --cc=khsieh@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkrishn@codeaurora.org \
    --cc=robdclark@gmail.com \
    --cc=sbillaka@codeaurora.org \
    --cc=seanpaul@chromium.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).