Skip to contentSkip to conversation

Revert "sna: Refresh last detection timestamp on hotplug notifies"

PATCH Superseded Lyude 2 participants 3 messages May 18, 2016 – Jun 3, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lyude

author
#0 lore raw

PATCH 1/1 Revert "sna: Refresh last detection timestamp on hotplug notifies"

From: Lyude Paul <[email protected]>

DRM does not always update the status of each connector during a hotplug event, and it's generally expected that userspace is supposed to handle that by reprobing. This happens in a couple situations:
suspend/resume, MST hotplugs, and probably a few others. As a result, making this assumption actually breaks MST hotplugging.

---
 src/sna/sna_display.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
src/sna/sna_display.c +5 -12
index 16d0321..6299d1e 100644
@@ -5038,14 +5038,11 @@ output_check_status(struct sna *sna, struct sna_output *output)
 	switch (compat_conn.conn.connection) {
 	case DRM_MODE_CONNECTED:
 		status = XF86OutputStatusConnected;
-		break;
 	case DRM_MODE_DISCONNECTED:
 		status = XF86OutputStatusDisconnected;
-		break;
 	default:
 	case DRM_MODE_UNKNOWNCONNECTION:
 		status = XF86OutputStatusUnknown;
-		break;
 	}
 	return output->status == status;
 }
@@ -5055,7 +5052,7 @@ void sna_mode_discover(struct sna *sna, bool tell)
 	ScreenPtr screen = xf86ScrnToScreen(sna->scrn);
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
 	struct drm_mode_card_res res;
-	uint32_t connectors[32], now;
+	uint32_t connectors[32];
 	unsigned changed = 0;
 	unsigned serial;
 	int i, j;
@@ -5087,7 +5084,6 @@ void sna_mode_discover(struct sna *sna, bool tell)
 	if (serial == 0)
 		serial = ++sna->mode.serial;
 
-	now = GetTimeInMillis();
 	for (i = 0; i < res.count_connectors; i++) {
 		DBG(("%s: connector[%d] = %d\n", __FUNCTION__, i, connectors[i]));
 		for (j = 0; j < sna->mode.num_real_output; j++) {
@@ -5113,13 +5109,10 @@ void sna_mode_discover(struct sna *sna, bool tell)
 			continue;
 
 		if (sna_output->serial == serial) {
-			if (output_check_status(sna, sna_output)) {
-				DBG(("%s: output %s (id=%d), retained state\n",
-				     __FUNCTION__, output->name, sna_output->id));
-				sna_output->last_detect = now;
-			} else {
-				DBG(("%s: output %s (id=%d), changed state, reprobing\n",
-				     __FUNCTION__, output->name, sna_output->id));
+			if (!output_check_status(sna, sna_output)) {
+				DBG(("%s: output %s (id=%d), changed state, reprobing]\n",
+				     __FUNCTION__, output->name, sna_output->id,
+				     sna_output->serial, serial));
 				sna_output->last_detect = 0;
 				changed |= 4;
 			}
Signature · 6 lines
2.5.5

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#1 lore raw

Ping, any update on this?

Quoted 79 lines · Lyude

From: Lyude Paul <[email protected]>

DRM does not always update the status of each connector during a hotplug event, and it's generally expected that userspace is supposed to
handle that by reprobing. This happens in a couple situations:
suspend/resume, MST hotplugs, and probably a few others. As a result, making this assumption actually breaks MST hotplugging.

---
 src/sna/sna_display.c | 17 +++++------------

 1 file changed, 5 insertions(+), 12 deletions(-)
src/sna/sna_display.c +0 -0
index 16d0321..6299d1e 100644
@@ -5038,14 +5038,11 @@ output_check_status(struct sna *sna, struct
 sna_output *output)
  	switch (compat_conn.conn.connection) {

  case DRM_MODE_CONNECTED:
  status = XF86OutputStatusConnected;

src/sna/sna_display.c +0 -1
-		break;

  case DRM_MODE_DISCONNECTED:
  status = XF86OutputStatusDisconnected;

src/sna/sna_display.c +0 -1
-		break;

  default:
  case DRM_MODE_UNKNOWNCONNECTION:
  status = XF86OutputStatusUnknown;

src/sna/sna_display.c +0 -1
-		break;

  }
  return output->status == status;
 }

src/sna/sna_display.c +1 -1
@@ -5055,7 +5052,7 @@ void sna_mode_discover(struct sna *sna, bool
 tell)
  	ScreenPtr screen = xf86ScrnToScreen(sna->scrn);
  	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
  	struct drm_mode_card_res res;
-	uint32_t connectors[32], now;
+	uint32_t connectors[32];
  	unsigned changed = 0;
  	unsigned serial;

  int i, j;

src/sna/sna_display.c +0 -0
@@ -5087,7 +5084,6 @@ void sna_mode_discover(struct sna *sna, bool
 tell)
  	if (serial == 0)
  		serial = ++sna->mode.serial;

src/sna/sna_display.c +0 -1
-	now = GetTimeInMillis();

  for (i = 0; i < res.count_connectors; i++) { DBG(("%s: connector[%d] = %d\n", __FUNCTION__, i, connectors[i]));
  for (j = 0; j < sna->mode.num_real_output; j++) {

src/sna/sna_display.c +0 -0
@@ -5113,13 +5109,10 @@ void sna_mode_discover(struct sna *sna, bool
 tell)
  			continue;


  if (sna_output->serial == serial) {

src/sna/sna_display.c +0 -2
-			if (output_check_status(sna, sna_output)) {
-				DBG(("%s: output %s (id=%d),

retained state\n",

src/sna/sna_display.c +0 -1
-				     __FUNCTION__, output->name,

sna_output->id));

src/sna/sna_display.c +0 -3
-				sna_output->last_detect = now;
-			} else {
-				DBG(("%s: output %s (id=%d), changed

state, reprobing\n",

src/sna/sna_display.c +0 -1
-				     __FUNCTION__, output->name,

sna_output->id));

src/sna/sna_display.c +2 -0
+			if (!output_check_status(sna, sna_output)) {
+				DBG(("%s: output %s (id=%d), changed

state, reprobing]\n",

src/sna/sna_display.c +1 -0
+				     __FUNCTION__, output->name,

sna_output->id,

src/sna/sna_display.c +1 -0
+				     sna_output->serial, serial));

  sna_output->last_detect = 0; changed |= 4;
  }

Signature · 7 lines
Cheers,
	Lyude

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

✗ Ro.CI.BAT: failure for Revert "sna: Refresh last detection timestamp on hotplug notifies"

In reply to Lyude
== Series Details ==

== Series Details ==

Series: Revert "sna: Refresh last detection timestamp on hotplug notifies"
URL : https://patchwork.freedesktop.org/series/7369/
State : failure

== Summary ==

Applying: Revert "sna: Refresh last detection timestamp on hotplug notifies"
fatal: sha1 information is lacking or useless (src/sna/sna_display.c).
error: could not build fake ancestor
Patch failed at 0001 Revert "sna: Refresh last detection timestamp on hotplug notifies" The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx