Skip to contentSkip to conversation

Set CLEAR_PAYLOAD_ID_TABLE as broadcast request

PATCH Superseded Wayne Lin 3 participants 12 messages Feb 22, 2021 – Feb 24, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wayne Lin

author
#0 lore raw

cover Set CLEAR_PAYLOAD_ID_TABLE as broadcast request

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.

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 | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#1 lore raw

PATCH 1/2 drm/dp_mst: Revise broadcast msg lct & lcr

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals to 6. Current implementation is incorrect. Fix it.

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +8 -2
index 17dbed0a9800..713ef3b42054 100644
@@ -2727,8 +2727,14 @@ 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 (hdr->broadcast) {
+		hdr->lct = 1;
+		hdr->lcr = 6;
+	} else {
+		hdr->lct = mstb->lct;
+		hdr->lcr = mstb->lct - 1;
+	}
+
 	if (mstb->lct > 1)
 		memcpy(hdr->rad, mstb->rad, mstb->lct / 2);
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Re: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

Quoted 20 lines · Wayne Lin

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals to 6. Current implementation is incorrect. Fix it.

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +0 -2
index 17dbed0a9800..713ef3b42054 100644
@@ -2727,8 +2727,14 @@ 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;

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2739

Quoted 10 lines
drivers/gpu/drm/drm_dp_mst_topology.c +8 -0
+	if (hdr->broadcast) {
+		hdr->lct = 1;
+		hdr->lcr = 6;
+	} else {
+		hdr->lct = mstb->lct;
+		hdr->lcr = mstb->lct - 1;
+	}
+
 	if (mstb->lct > 1)
 		memcpy(hdr->rad, mstb->rad, mstb->lct / 2);

We should also do something about RAD no?

Quoted 8 lines
Signature · 7 lines
-- 
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

Re: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Wayne Lin

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals to 6. Current implementation is incorrect. Fix it.

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +4 -2
index 17dbed0a9800..713ef3b42054 100644
@@ -2727,8 +2727,14 @@ 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 (hdr->broadcast) {
+		hdr->lct = 1;
+		hdr->lcr = 6;
+	} else {
Quoted 8 lines

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2739

Quoted 6 lines
drivers/gpu/drm/drm_dp_mst_topology.c +4 -0
+		hdr->lct = mstb->lct;
+		hdr->lcr = mstb->lct - 1;
+	}
+
 	if (mstb->lct > 1)
 		memcpy(hdr->rad, mstb->rad, mstb->lct / 2);

We should also do something about RAD no?

Just skip the RAD stuff by s/mstb->lct/hdr->lct/ here I guess?

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#4 lore raw

RE: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

[AMD Public Use]

Quoted 44 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Tuesday, February 23, 2021 1:09 AM
To: Lin, Wayne <[email protected]>
Cc: Brol, Eryk <[email protected]>; Zhuo, Qingqing <[email protected]>; [email protected]; Zuo, Jerry <[email protected]>; [email protected]; Kazlauskas, Nicholas <[email protected]>
Subject: Re: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

Quoted 26 lines · Ville Syrjälä
Quoted 25 lines · Wayne Lin

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals to 6. Current implementation is incorrect. Fix it.

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +4 -2
index 17dbed0a9800..713ef3b42054 100644
@@ -2727,8 +2727,14 @@ 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 (hdr->broadcast) {
+hdr->lct = 1;
+hdr->lcr = 6;
+} else {
Quoted 8 lines

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2739

Quoted 6 lines
drivers/gpu/drm/drm_dp_mst_topology.c +4 -0
+hdr->lct = mstb->lct;
+hdr->lcr = mstb->lct - 1;
+}
+
 if (mstb->lct > 1)
 memcpy(hdr->rad, mstb->rad, mstb->lct / 2);

We should also do something about RAD no?

Quoted 1 line

Just skip the RAD stuff by s/mstb->lct/hdr->lct/ here I guess?

Thanks Ville!
Since LCT=1, broadcast message doesn't have a RAD and this is taken care while we're constructing the header in drm_dp_encode_sideband_msg_hdr(). In drm_dp_encode_sideband_msg_hdr(), we skip stuffing RAD if LCT=1.

Quoted 4 lines

--
Ville Syrjälä
Intel

Regards,
Wayne Lin
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

Re: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

Quoted 46 lines · Wayne

[AMD Public Use]

Quoted 44 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Tuesday, February 23, 2021 1:09 AM
To: Lin, Wayne <[email protected]>
Cc: Brol, Eryk <[email protected]>; Zhuo, Qingqing <[email protected]>; [email protected]; Zuo, Jerry <[email protected]>; [email protected]; Kazlauskas, Nicholas <[email protected]>
Subject: Re: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

Quoted 34 lines · Ville Syrjälä
Quoted 21 lines · Wayne Lin

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals to 6. Current implementation is incorrect. Fix it.

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +0 -2
index 17dbed0a9800..713ef3b42054 100644
@@ -2727,8 +2727,14 @@ 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;

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2739

Quoted 10 lines
drivers/gpu/drm/drm_dp_mst_topology.c +8 -0
+if (hdr->broadcast) {
+hdr->lct = 1;
+hdr->lcr = 6;
+} else {
+hdr->lct = mstb->lct;
+hdr->lcr = mstb->lct - 1;
+}
+
 if (mstb->lct > 1)
 memcpy(hdr->rad, mstb->rad, mstb->lct / 2);

We should also do something about RAD no?

Quoted 5 lines
Quoted 1 line

Just skip the RAD stuff by s/mstb->lct/hdr->lct/ here I guess?

Thanks Ville!
Since LCT=1, broadcast message doesn't have a RAD and this is taken care while we're constructing the header in drm_dp_encode_sideband_msg_hdr(). In drm_dp_encode_sideband_msg_hdr(), we skip stuffing RAD if LCT=1.

Ugh. How many levels of these do we really need... Either way I'd prefer the code be consistent so you don't have to sacrifice so many brain cells to understand what should be trivial details.

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#6 lore raw

RE: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

[AMD Public Use]

Quoted 57 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Tuesday, February 23, 2021 9:26 PM
To: Lin, Wayne <[email protected]>
Cc: Brol, Eryk <[email protected]>; Zhuo, Qingqing <[email protected]>; [email protected]; Zuo, Jerry <[email protected]>; [email protected]; Kazlauskas, Nicholas <[email protected]>
Subject: Re: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

Quoted 48 lines · Wayne

[AMD Public Use]

Quoted 46 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Tuesday, February 23, 2021 1:09 AM
To: Lin, Wayne <[email protected]>
Cc: Brol, Eryk <[email protected]>; Zhuo, Qingqing <[email protected]>; [email protected]; Zuo, Jerry <[email protected]>; [email protected]; Kazlauskas, Nicholas <[email protected]>
Subject: Re: [PATCH 1/2] drm/dp_mst: Revise broadcast msg lct & lcr

Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · Wayne Lin

[Why & How]
According to DP spec, broadcast message LCT equals to 1 and LCR equals to 6. Current implementation is incorrect. Fix it.

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +4 -2
index 17dbed0a9800..713ef3b42054 100644
@@ -2727,8 +2727,14 @@ 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 (hdr->broadcast) {
+hdr->lct = 1;
+hdr->lcr = 6;
+} else {
Quoted 8 lines

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2739

Quoted 6 lines
drivers/gpu/drm/drm_dp_mst_topology.c +4 -0
+hdr->lct = mstb->lct;
+hdr->lcr = mstb->lct - 1;
+}
+
 if (mstb->lct > 1)
 memcpy(hdr->rad, mstb->rad, mstb->lct / 2);

We should also do something about RAD no?

Just skip the RAD stuff by s/mstb->lct/hdr->lct/ here I guess?

Quoted 8 lines
Quoted 4 lines

Thanks Ville!
Since LCT=1, broadcast message doesn't have a RAD and this is taken care while we're constructing the header in drm_dp_encode_sideband_msg_hdr(). In drm_dp_encode_sideband_msg_hdr(), we skip stuffing RAD if LCT=1.

Ugh. How many levels of these do we really need...
Either way I'd prefer the code be consistent so you don't have to sacrifice so many brain cells to understand what should be trivial details.

Hi Ville,
Ya I know.. Currently it goes few levels to encapsulate the final mst packet.
From my understanding, this function is trying to prepare needed data and the actual mst packet header is constructed in drm_dp_encode_sideband_msg_hdr(). However, I will push another version by your suggestion.
Thanks for your time!

Quoted 4 lines

--
Ville Syrjälä
Intel

Regards,
Wayne Lin
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#7 lore raw

PATCH 2/2 drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

In reply to Wayne Lin

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

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_dp_mst_topology.c +3 -1
index 713ef3b42054..6d73559046e5 100644
@@ -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;
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/2
#8 lore raw

Re: [PATCH 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

Quoted 23 lines · Wayne Lin

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

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_dp_mst_topology.c +1 -0
index 713ef3b42054..6d73559046e5 100644
@@ -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,

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2728

Quoted 7 lines
drivers/gpu/drm/drm_dp_mst_topology.c +2 -1
@@ -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;

Looks correct.

Hmm. Looks like we're missing DP_POWER_DOWN_PHY and DP_POWER_UP_PHY here as well. We do try to send them as path requests, but apparently forget to mark them as broadcast messages.

Quoted 9 lines
drivers/gpu/drm/drm_dp_mst_topology.c +0 -0
 	else
 		hdr->broadcast = 0;
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#9 lore raw

RE: [PATCH 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

[AMD Public Use]

Quoted 45 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Tuesday, February 23, 2021 1:00 AM
To: Lin, Wayne <[email protected]>
Cc: [email protected]; Brol, Eryk <[email protected]>; Zhuo, Qingqing <[email protected]>; [email protected]; Zuo, Jerry <[email protected]>; Kazlauskas, Nicholas <[email protected]>; Dhinakaran Pandiyan <[email protected]>
Subject: Re: [PATCH 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

Quoted 29 lines · Wayne Lin

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

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_dp_mst_topology.c +1 -0
index 713ef3b42054..6d73559046e5 100644
@@ -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 ||

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2728

Quoted 4 lines
drivers/gpu/drm/drm_dp_mst_topology.c +2 -1
-req_type == DP_RESOURCE_STATUS_NOTIFY)
+req_type == DP_RESOURCE_STATUS_NOTIFY ||
+req_type == DP_CLEAR_PAYLOAD_ID_TABLE)
 hdr->broadcast = 1;

Looks correct.

Quoted 4 lines

Hmm. Looks like we're missing DP_POWER_DOWN_PHY and DP_POWER_UP_PHY here as well. We do try to send them as path requests, but apparently forget to mark them as broadcast messages.

Hi Ville,
I also look up the spec but DP_POWER_DOWN_PHY & DP_POWER_UP_PHY seems to be defined as path or node request only. Not broadcast message. Please correct me if I'm wrong here. Appreciate for your time!

Quoted 17 lines
Quoted 6 lines

else
hdr->broadcast = 0;
--
2.17.1

Quoted 10 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=04%7C01%7C Wayne.Lin%40amd.com%7C372bbed7b5354ca05f5608d8d753533a%7C3dd8961fe4884 e608e11a82d994e183d%7C0%7C0%7C637496100180287539%7CUnknown%7CTWFpbGZsb 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% 7C1000&amp;sdata=2uhm9Nf31hfhf%2FbmwfqYW7b6ay9swWb8oS10Uc%2FVFRQ%3D&am p;reserved=0

Quoted 3 lines

--
Ville Syrjälä
Intel

Regards,
Wayne Lin
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

Re: [PATCH 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

Quoted 49 lines · Wayne

[AMD Public Use]

Quoted 47 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Tuesday, February 23, 2021 1:00 AM
To: Lin, Wayne <[email protected]>
Cc: [email protected]; Brol, Eryk <[email protected]>; Zhuo, Qingqing <[email protected]>; [email protected]; Zuo, Jerry <[email protected]>; Kazlauskas, Nicholas <[email protected]>; Dhinakaran Pandiyan <[email protected]>
Subject: Re: [PATCH 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

Quoted 29 lines · Wayne Lin

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

---
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_dp_mst_topology.c +1 -0
index 713ef3b42054..6d73559046e5 100644
@@ -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 ||

drivers/gpu/drm/drm_dp_mst_topology.c static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr, · line 2728

Quoted 4 lines
drivers/gpu/drm/drm_dp_mst_topology.c +2 -1
-req_type == DP_RESOURCE_STATUS_NOTIFY)
+req_type == DP_RESOURCE_STATUS_NOTIFY ||
+req_type == DP_CLEAR_PAYLOAD_ID_TABLE)
 hdr->broadcast = 1;

Looks correct.

Quoted 4 lines
Quoted 2 lines

Hmm. Looks like we're missing DP_POWER_DOWN_PHY and DP_POWER_UP_PHY here as well. We do try to send them as path requests, but apparently forget to mark them as broadcast messages.

Hi Ville,
I also look up the spec but DP_POWER_DOWN_PHY & DP_POWER_UP_PHY seems to be defined as path or node request only. Not broadcast message. Please correct me if I'm wrong here.

Doh. Yeah, you're correct. Not sure what section I was reading earlier when I came to that conclusion.

Quoted 23 lines

Appreciate for your time!

Quoted 17 lines
Quoted 6 lines

else
hdr->broadcast = 0;
--
2.17.1

Quoted 10 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=04%7C01%7C Wayne.Lin%40amd.com%7C372bbed7b5354ca05f5608d8d753533a%7C3dd8961fe4884 e608e11a82d994e183d%7C0%7C0%7C637496100180287539%7CUnknown%7CTWFpbGZsb 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D% 7C1000&amp;sdata=2uhm9Nf31hfhf%2FbmwfqYW7b6ay9swWb8oS10Uc%2FVFRQ%3D&am p;reserved=0

Quoted 3 lines

--
Ville Syrjälä
Intel

Regards,
Wayne Lin

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on the v1 series
#11 lore raw
In reply to Wayne Lin

ooh, nice catches! For the whole series this is:

I will go ahead and push these to drm-misc-next

Quoted 19 lines · Wayne Lin

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.

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 | 14 +++++++++++---

 1 file changed, 11 insertions(+), 3 deletions(-)

--
2.17.1

Signature · 13 lines
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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel