All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wayne Lin <Wayne.Lin@amd.com>
To: <dri-devel@lists.freedesktop.org>
Cc: <ville.syrjala@linux.intel.com>, <lyude@redhat.com>,
	<stable@vger.kernel.org>, <Nicholas.Kazlauskas@amd.com>,
	<harry.wentland@amd.com>, <jerry.zuo@amd.com>,
	<eryk.brol@amd.com>, <qingqing.zhuo@amd.com>,
	Wayne Lin <Wayne.Lin@amd.com>
Subject: [PATCH v2 1/2] drm/dp_mst: Revise broadcast msg lct & lcr
Date: Wed, 24 Feb 2021 18:15:20 +0800	[thread overview]
Message-ID: <20210224101521.6713-2-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20210224101521.6713-1-Wayne.Lin@amd.com>

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals
to 6. Current implementation is incorrect. Fix it.
In addition, revise a bit the hdr->rad handling to include broadcast
case.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 17dbed0a9800..f11b3f718031 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2727,10 +2727,15 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
 	else
 		hdr->broadcast = 0;
 	hdr->path_msg = txmsg->path_msg;
-	hdr->lct = mstb->lct;
-	hdr->lcr = mstb->lct - 1;
-	if (mstb->lct > 1)
-		memcpy(hdr->rad, mstb->rad, mstb->lct / 2);
+	if (hdr->broadcast) {
+		hdr->lct = 1;
+		hdr->lcr = 6;
+	} else {
+		hdr->lct = mstb->lct;
+		hdr->lcr = mstb->lct - 1;
+	}
+
+	memcpy(hdr->rad, mstb->rad, hdr->lct / 2);
 
 	return 0;
 }
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: Wayne Lin <Wayne.Lin@amd.com>
To: <dri-devel@lists.freedesktop.org>
Cc: eryk.brol@amd.com, qingqing.zhuo@amd.com, stable@vger.kernel.org,
	jerry.zuo@amd.com, Wayne Lin <Wayne.Lin@amd.com>,
	Nicholas.Kazlauskas@amd.com
Subject: [PATCH v2 1/2] drm/dp_mst: Revise broadcast msg lct & lcr
Date: Wed, 24 Feb 2021 18:15:20 +0800	[thread overview]
Message-ID: <20210224101521.6713-2-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20210224101521.6713-1-Wayne.Lin@amd.com>

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals
to 6. Current implementation is incorrect. Fix it.
In addition, revise a bit the hdr->rad handling to include broadcast
case.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 17dbed0a9800..f11b3f718031 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -2727,10 +2727,15 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
 	else
 		hdr->broadcast = 0;
 	hdr->path_msg = txmsg->path_msg;
-	hdr->lct = mstb->lct;
-	hdr->lcr = mstb->lct - 1;
-	if (mstb->lct > 1)
-		memcpy(hdr->rad, mstb->rad, mstb->lct / 2);
+	if (hdr->broadcast) {
+		hdr->lct = 1;
+		hdr->lcr = 6;
+	} else {
+		hdr->lct = mstb->lct;
+		hdr->lcr = mstb->lct - 1;
+	}
+
+	memcpy(hdr->rad, mstb->rad, hdr->lct / 2);
 
 	return 0;
 }
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-02-24 10:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 10:15 [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Wayne Lin
2021-02-24 10:15 ` Wayne Lin
2021-02-24 10:15 ` Wayne Lin [this message]
2021-02-24 10:15   ` [PATCH v2 1/2] drm/dp_mst: Revise broadcast msg lct & lcr Wayne Lin
2021-02-24 10:15 ` [PATCH v2 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast Wayne Lin
2021-02-24 10:15   ` Wayne Lin
2021-02-24 18:08 ` [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Lyude Paul
2021-02-24 18:08   ` Lyude Paul
2021-02-25  2:32   ` Lin, Wayne
2021-02-25  2:32     ` Lin, Wayne

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=20210224101521.6713-2-Wayne.Lin@amd.com \
    --to=wayne.lin@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eryk.brol@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=lyude@redhat.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=stable@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.