public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lyude <cpaul@redhat.com>
To: intel-gfx@lists.freedesktop.org, Chris Wilson <chris@chris-wilson.co.uk>
Subject: [PATCH v2] Revert "sna: Refresh last detection timestamp on hotplug notifies"
Date: Fri, 17 Jun 2016 15:44:34 -0400	[thread overview]
Message-ID: <1466192674-9334-1-git-send-email-cpaul@redhat.com> (raw)

From: Lyude Paul <cpaul@redhat.com>

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.

Changes since v1:
 - Fix removal of break statements from switch case

Signed-off-by: Lyude <cpaul@redhat.com>
---
 src/sna/sna_display.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 0cf2bdb..79c72cc 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5114,7 +5114,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;
@@ -5146,7 +5146,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++) {
@@ -5172,13 +5171,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;
 			}
-- 
2.5.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2016-06-17 19:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 19:44 Lyude [this message]
2016-06-17 19:57 ` [PATCH v2] Revert "sna: Refresh last detection timestamp on hotplug notifies" Chris Wilson
2016-06-17 20:30   ` Lyude
2016-06-27 20:07   ` Dave Airlie
2016-06-22 12:33 ` ✗ Ro.CI.BAT: failure for Revert "sna: Refresh last detection timestamp on hotplug notifies" (rev2) Patchwork

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=1466192674-9334-1-git-send-email-cpaul@redhat.com \
    --to=cpaul@redhat.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox