dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request
@ 2021-02-24 10:15 Wayne Lin
  2021-02-24 10:15 ` [PATCH v2 1/2] drm/dp_mst: Revise broadcast msg lct & lcr Wayne Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wayne Lin @ 2021-02-24 10:15 UTC (permalink / raw)
  To: dri-devel
  Cc: eryk.brol, qingqing.zhuo, stable, jerry.zuo, Wayne Lin,
	Nicholas.Kazlauskas

While testing MST hotplug events on daisy chain monitors, find out
that CLEAR_PAYLOAD_ID_TABLE is not broadcasted and payload id table
is not reset. Dig in deeper and find out two parts needed to be fixed.

1. Link_Count_Total & Link_Count_Remaining of Broadcast message are
incorrect. Should set lct=1 & lcr=6
2. CLEAR_PAYLOAD_ID_TABLE request message is not set as path broadcast
request message. Should fix this.

Changes since v1:
*Refer to the suggestion from Ville Syrjala. While preparing hdr-rad,
take broadcast case into consideration.

Wayne Lin (2):
  drm/dp_mst: Revise broadcast msg lct & lcr
  drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

 drivers/gpu/drm/drm_dp_mst_topology.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

--
2.17.1

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] drm/dp_mst: Revise broadcast msg lct & lcr
  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 ` [PATCH v2 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast Wayne Lin
  2021-02-24 18:08 ` [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Lyude Paul
  2 siblings, 0 replies; 5+ messages in thread
From: Wayne Lin @ 2021-02-24 10:15 UTC (permalink / raw)
  To: dri-devel
  Cc: eryk.brol, qingqing.zhuo, stable, jerry.zuo, Wayne Lin,
	Nicholas.Kazlauskas

[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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast
  2021-02-24 10:15 [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Wayne Lin
  2021-02-24 10:15 ` [PATCH v2 1/2] drm/dp_mst: Revise broadcast msg lct & lcr 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
  2 siblings, 0 replies; 5+ messages in thread
From: Wayne Lin @ 2021-02-24 10:15 UTC (permalink / raw)
  To: dri-devel
  Cc: eryk.brol, qingqing.zhuo, stable, jerry.zuo, Wayne Lin,
	Nicholas.Kazlauskas

[Why & How]
According to DP spec, CLEAR_PAYLOAD_ID_TABLE is a path broadcast request
message and current implementation is incorrect. Fix it.

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

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index f11b3f718031..c32b98389349 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1072,6 +1072,7 @@ static void build_clear_payload_id_table(struct drm_dp_sideband_msg_tx *msg)
 
 	req.req_type = DP_CLEAR_PAYLOAD_ID_TABLE;
 	drm_dp_encode_sideband_req(&req, msg);
+	msg->path_msg = true;
 }
 
 static int build_enum_path_resources(struct drm_dp_sideband_msg_tx *msg,
@@ -2722,7 +2723,8 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
 
 	req_type = txmsg->msg[0] & 0x7f;
 	if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
-		req_type == DP_RESOURCE_STATUS_NOTIFY)
+		req_type == DP_RESOURCE_STATUS_NOTIFY ||
+		req_type == DP_CLEAR_PAYLOAD_ID_TABLE)
 		hdr->broadcast = 1;
 	else
 		hdr->broadcast = 0;
-- 
2.17.1

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request
  2021-02-24 10:15 [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Wayne Lin
  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 18:08 ` Lyude Paul
  2021-02-25  2:32   ` Lin, Wayne
  2 siblings, 1 reply; 5+ messages in thread
From: Lyude Paul @ 2021-02-24 18:08 UTC (permalink / raw)
  To: Wayne Lin, dri-devel
  Cc: eryk.brol, qingqing.zhuo, stable, jerry.zuo, Nicholas.Kazlauskas

also - I meant to reply to v2, not v1 :). Just so you don't worry that I pushed
the wrong patch series version

On Wed, 2021-02-24 at 18:15 +0800, Wayne Lin wrote:
> While testing MST hotplug events on daisy chain monitors, find out
> that CLEAR_PAYLOAD_ID_TABLE is not broadcasted and payload id table
> is not reset. Dig in deeper and find out two parts needed to be fixed.
> 
> 1. Link_Count_Total & Link_Count_Remaining of Broadcast message are
> incorrect. Should set lct=1 & lcr=6
> 2. CLEAR_PAYLOAD_ID_TABLE request message is not set as path broadcast
> request message. Should fix this.
> 
> Changes since v1:
> *Refer to the suggestion from Ville Syrjala. While preparing hdr-rad,
> take broadcast case into consideration.
> 
> Wayne Lin (2):
>   drm/dp_mst: Revise broadcast msg lct & lcr
>   drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast
> 
>  drivers/gpu/drm/drm_dp_mst_topology.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> --
> 2.17.1
> 

-- 
Sincerely,
   Lyude Paul (she/her)
   Software Engineer at Red Hat
   
Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request
  2021-02-24 18:08 ` [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Lyude Paul
@ 2021-02-25  2:32   ` Lin, Wayne
  0 siblings, 0 replies; 5+ messages in thread
From: Lin, Wayne @ 2021-02-25  2:32 UTC (permalink / raw)
  To: lyude, dri-devel
  Cc: Brol, Eryk, Zhuo, Qingqing, stable, Zuo, Jerry, Kazlauskas, Nicholas

[AMD Public Use]

Thanks Lyude!

Regards,
Wayne

> -----Original Message-----
> From: Lyude Paul <lyude@redhat.com>
> Sent: Thursday, February 25, 2021 2:09 AM
> To: Lin, Wayne <Wayne.Lin@amd.com>; dri-devel@lists.freedesktop.org
> Cc: ville.syrjala@linux.intel.com; stable@vger.kernel.org; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Zuo, Jerry <Jerry.Zuo@amd.com>; Brol, Eryk <Eryk.Brol@amd.com>; Zhuo, Qingqing
> <Qingqing.Zhuo@amd.com>
> Subject: Re: [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request
>
> also - I meant to reply to v2, not v1 :). Just so you don't worry that I pushed the wrong patch series version
>
> On Wed, 2021-02-24 at 18:15 +0800, Wayne Lin wrote:
> > While testing MST hotplug events on daisy chain monitors, find out
> > that CLEAR_PAYLOAD_ID_TABLE is not broadcasted and payload id table is
> > not reset. Dig in deeper and find out two parts needed to be fixed.
> >
> > 1. Link_Count_Total & Link_Count_Remaining of Broadcast message are
> > incorrect. Should set lct=1 & lcr=6 2. CLEAR_PAYLOAD_ID_TABLE request
> > message is not set as path broadcast request message. Should fix this.
> >
> > Changes since v1:
> > *Refer to the suggestion from Ville Syrjala. While preparing hdr-rad,
> > take broadcast case into consideration.
> >
> > Wayne Lin (2):
> >   drm/dp_mst: Revise broadcast msg lct & lcr
> >   drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast
> >
> >  drivers/gpu/drm/drm_dp_mst_topology.c | 17 ++++++++++++-----
> >  1 file changed, 12 insertions(+), 5 deletions(-)
> >
> > --
> > 2.17.1
> >
>
> --
> Sincerely,
>    Lyude Paul (she/her)
>    Software Engineer at Red Hat
>
> Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've asked me a question, are waiting for a review/merge on a
> patch, etc. and I haven't responded in a while, please feel free to send me another email to check on my status. I don't bite!

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-25  2:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 10:15 [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Wayne Lin
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 18:08 ` [PATCH v2 0/2] Set CLEAR_PAYLOAD_ID_TABLE as broadcast request Lyude Paul
2021-02-25  2:32   ` Lin, Wayne

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).