From patchwork Tue Dec 15 18:07:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cpaul@redhat.com X-Patchwork-Id: 7856471 Return-Path: X-Original-To: patchwork-dri-devel@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 766969F350 for ; Tue, 15 Dec 2015 18:08:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 941EB203DA for ; Tue, 15 Dec 2015 18:08:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A6357203B7 for ; Tue, 15 Dec 2015 18:08:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC30B89079; Tue, 15 Dec 2015 10:08:29 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29F7889079 for ; Tue, 15 Dec 2015 10:08:29 -0800 (PST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 2F16C14CAA5; Tue, 15 Dec 2015 18:08:28 +0000 (UTC) Received: from ecstaticemu.bos.redhat.com. (dhcp-25-74.bos.redhat.com [10.18.25.74]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tBFI8QZi003412; Tue, 15 Dec 2015 13:08:26 -0500 From: Lyude To: David Airlie , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), linux-kernel@vger.kernel.org (open list), Daniel Vetter Subject: [PATCH] Revert "drm: Stop resetting connector state to unknown" Date: Tue, 15 Dec 2015 13:07:51 -0500 Message-Id: <1450202871-15062-1-git-send-email-cpaul@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Cc: kuddel.mail@gmx.de, Julien Wajsberg , Benjamin Tissoires , Lennart Poettering , Lyude X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 This reverts commit 5677d67ae394 ("drm: Stop resetting connector state to unknown") Unfortunately, not resetting the connector status to unknown actually breaks reprobing on suspend/resume in i915, which is important to have working since it means a user docking their laptop in suspend won't have their monitors work after resume. This commit was originally pushed to fix a bug with systemd[1], however said bug has already been fixed in userspace. Since "unknown" is technically a valid option to return to userspace for a connector's status, I would think that this sort of behavior should probably be expected from userspace. Some good examples of this are the radeon driver reporting "unknown" for connectors that have done something wonky during a hotplug event (e.g. part of the initialization of the connector failed), and the omapdrm driver returns "unknown" for certain connector types by default. [1]: https://bugzilla.kernel.org/show_bug.cgi?id=100641 Signed-off-by: Lyude --- drivers/gpu/drm/drm_crtc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 24c5434..474e636 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -5312,11 +5312,12 @@ void drm_mode_config_reset(struct drm_device *dev) if (encoder->funcs->reset) encoder->funcs->reset(encoder); - mutex_lock(&dev->mode_config.mutex); - drm_for_each_connector(connector, dev) + list_for_each_entry(connector, &dev->mode_config.connector_list, head) { + connector->status = connector_status_unknown; + if (connector->funcs->reset) connector->funcs->reset(connector); - mutex_unlock(&dev->mode_config.mutex); + } } EXPORT_SYMBOL(drm_mode_config_reset);