Skip to contentSkip to conversation

usb: typec: altmodes/displayport: Signal hpd low when exiting mode

PATCH In review RD Babiera 2 participants 2 messages Oct 9, 2023 – Oct 10, 2023

Subsystems (4)
lore
Share & tools
lore

RD Babiera

author
#0 lore raw

PATCH 1/1 usb: typec: altmodes/displayport: Signal hpd low when exiting mode

Upon receiving an ACK for a sent EXIT_MODE message, the DisplayPort driver currently resets the status and configuration of the port partner. The hpd signal is not updated despite being part of the status, so the Display stack can still transmit video despite typec_altmode_exit placing the lanes in a Safe State.

Set hpd to low when a sent EXIT_MODE message is ACK'ed.

Fixes 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode")
---
 drivers/usb/typec/altmodes/displayport.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/typec/altmodes/displayport.c +5 -0
index f503cb4cd721..718da02036d8 100644
@@ -307,6 +307,11 @@ static int dp_altmode_vdm(struct typec_altmode *alt,
 			typec_altmode_update_active(alt, false);
 			dp->data.status = 0;
 			dp->data.conf = 0;
+			if (dp->hpd) {
+				drm_connector_oob_hotplug_event(dp->connector_fwnode);
+				dp->hpd = false;
+				sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd");
+			}
 			break;
 		case DP_CMD_STATUS_UPDATE:
 			dp->data.status = *vdo;

base-commit: 1053c4a4b8fcbd28386e80347e7c82d4d617e352

Signature · 1 line
2.42.0.609.gbb76f46606-goog
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · RD Babiera

Upon receiving an ACK for a sent EXIT_MODE message, the DisplayPort driver currently resets the status and configuration of the port partner. The hpd signal is not updated despite being part of the status, so the Display stack can still transmit video despite typec_altmode_exit placing the lanes in a Safe State.

Set hpd to low when a sent EXIT_MODE message is ACK'ed.

Fixes 0e3bb7d6894d ("usb: typec: Add driver for DisplayPort alternate mode")
Quoted 24 lines
---
 drivers/usb/typec/altmodes/displayport.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/typec/altmodes/displayport.c +5 -0
index f503cb4cd721..718da02036d8 100644
@@ -307,6 +307,11 @@ static int dp_altmode_vdm(struct typec_altmode *alt,
 			typec_altmode_update_active(alt, false);
 			dp->data.status = 0;
 			dp->data.conf = 0;
+			if (dp->hpd) {
+				drm_connector_oob_hotplug_event(dp->connector_fwnode);
+				dp->hpd = false;
+				sysfs_notify(&dp->alt->dev.kobj, "displayport", "hpd");
+			}
 			break;
 		case DP_CMD_STATUS_UPDATE:
 			dp->data.status = *vdo;

base-commit: 1053c4a4b8fcbd28386e80347e7c82d4d617e352

Signature · 1 line
2.42.0.609.gbb76f46606-goog
Signature · 1 line
heikki