From patchwork Fri Jun 17 19:44:34 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: 9184795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 398EF608A2 for ; Fri, 17 Jun 2016 19:45:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E58425819 for ; Fri, 17 Jun 2016 19:45:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 015FB26992; Fri, 17 Jun 2016 19:45:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2462225819 for ; Fri, 17 Jun 2016 19:45:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD1906E390; Fri, 17 Jun 2016 19:45:15 +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 5653A6E390 for ; Fri, 17 Jun 2016 19:45:14 +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 C077E46201; Fri, 17 Jun 2016 19:45:13 +0000 (UTC) Received: from whitewolf.lyude.com (vpn-238-248.phx2.redhat.com [10.3.238.248]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5HJjCcx020131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 17 Jun 2016 15:45:13 -0400 From: Lyude To: intel-gfx@lists.freedesktop.org, Chris Wilson Date: Fri, 17 Jun 2016 15:44:34 -0400 Message-Id: <1466192674-9334-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.29]); Fri, 17 Jun 2016 19:45:13 +0000 (UTC) Subject: [Intel-gfx] [PATCH v2] 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-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. Changes since v1: - Fix removal of break statements from switch case Signed-off-by: Lyude --- 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; }