From patchwork Wed May 18 21:35:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cpaul@redhat.com X-Patchwork-Id: 9122671 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DA0DD9F1C1 for ; Wed, 18 May 2016 21:36:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09DB82034B for ; Wed, 18 May 2016 21:36:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1AD1720131 for ; Wed, 18 May 2016 21:36:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8E1E6E8F6; Wed, 18 May 2016 21:36:08 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4ABB76E8F6 for ; Wed, 18 May 2016 21:36:07 +0000 (UTC) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C6DD0C04B321; Wed, 18 May 2016 21:36:06 +0000 (UTC) Received: from ecstaticemu.bos.redhat.com (dhcp-25-142.bos.redhat.com [10.18.25.142]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4ILa5UY024576; Wed, 18 May 2016 17:36:06 -0400 From: Lyude To: Chris Wilson , intel-gfx@lists.freedesktop.org Date: Wed, 18 May 2016 17:35:58 -0400 Message-Id: <1463607358-22734-1-git-send-email-cpaul@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 18 May 2016 21:36:06 +0000 (UTC) Cc: Dave Airlie Subject: [Intel-gfx] [PATCH] Revert "sna: Refresh last detection timestamp on hotplug notifies" X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lyude Paul 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. Signed-off-by: Lyude --- src/sna/sna_display.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 16d0321..6299d1e 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -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; }