From patchwork Sat Jun 15 20:41:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2727631 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 988A7C0AB1 for ; Sat, 15 Jun 2013 20:42:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BDA0620192 for ; Sat, 15 Jun 2013 20:42:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E16B02018F for ; Sat, 15 Jun 2013 20:42:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8972E5DDE for ; Sat, 15 Jun 2013 13:42:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f45.google.com (mail-ee0-f45.google.com [74.125.83.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 196B4E5C14 for ; Sat, 15 Jun 2013 13:42:11 -0700 (PDT) Received: by mail-ee0-f45.google.com with SMTP id c1so1001289eek.18 for ; Sat, 15 Jun 2013 13:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=IdRIRH87/qwmBcwvV/nMXgdl0UytDRTVGFms4F2zNxA=; b=gNdeshK1IgsrNuyEbJnZYhU/OoEgXayQKIKOalTC9iGs3dQ3CPEMgxg/PDkrniLoI6 VFBgWPjg7sHnbbNOIvuMESMulERN7QNRGGJ39ibAPIlsnvvhj9aXrBwuXCK++0Rp4Bos N4Q3fdjQR4vM5VN2dxTrNaSKvw5lGhsJMinq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=IdRIRH87/qwmBcwvV/nMXgdl0UytDRTVGFms4F2zNxA=; b=OkJp9aTBudgVgL/DN/G1+CCJ/PcBneGgpMeAY6i1S3MLQfBFqtFufVYmxsw4FcIKeu kP/5Y/uwk+z/lHSECMYxHqvqx/IrYxvUM48djEYA8jEKmLhYJFa+D2eDZEhyxB0mssjf 2rchNEv8ta5pMBBKkKLzvj/MIalDFXjrRYtLwl21NKI7IVfjSno8mXxzx/6+A3fk+7EO Hdn/NViQSQqq1buS4SoeVBeeJDPHFAAFO52Rlirl+XSrr31fdUu/PlyHFyHJ6R0c4vEK 0IaX2+NQgFym8vgNnalsIT8cFVeD7/7ov14RrYiO5iIaqLKwU0fo14lox7ze0Dw8duin NdOg== X-Received: by 10.14.251.202 with SMTP id b50mr9399487ees.85.1371328931390; Sat, 15 Jun 2013 13:42:11 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id x4sm12246494eej.9.2013.06.15.13.42.09 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Jun 2013 13:42:10 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm/crtc-helper: don't disable disconnected outputs Date: Sat, 15 Jun 2013 22:41:59 +0200 Message-Id: <1371328919-16967-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1371247996-6052-5-git-send-email-daniel.vetter@ffwll.ch> References: <1371247996-6052-5-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQmUzAfn7V/Uo0ZBNwCGI3L6uPesaMECYJkFcCXg7cFQMWUWaHNIWPv4MT43dAHw0bmE2wuG Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 has originally been added in commit a3a0544b2c84e1d7a2022b558ecf66d8c6a8dd93 Author: Dave Airlie Date: Mon Aug 31 15:16:30 2009 +1000 drm/kms: add explicit encoder disable function and detach harder. I think it's the wrong thing to do for a few reasons: - It's policy in the kernel. Userspace gets hotplug events when an output disconnects, and it can inquire about all the routing that is already set up. If userspace wants to disable a disconnected output it can simply do so itself. - The reason for adding it given in the commit message was to improve use of shared encoders. But the disable_unused_functions call only happens after the modeset has been completed, so it won't help too much in making the modest succeed. - We (at least in drm/i915, but iirc all other drivers work the same) ensure that if the user accidentally yanks the cable and then replugs, the same configuration will keep on working without any userspace actions required. For most outputs that's the case by default, and DP can have the same semantics with a simple re-train handler fired off from the hpd replug event. This breaks it since if the user is unlucky and hits the mouse, resulting in a panning of e.g. the integrated panel that modeset might kill the accidentally yanked output. Which isn't too great. i915 has applied this behaviour change as part of the bit modeset review, thus far without resulting in an angry crowd with pitchforks: commit b0a2658acb5bf9ca86b4aab011b7106de3af0add Author: Daniel Vetter Date: Tue Dec 18 09:37:54 2012 +0100 drm/i915: don't disable disconnected outputs v2: Remove unused variable that I've missed. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc_helper.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 1ace9c1..72282af 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -276,16 +276,8 @@ drm_encoder_disable(struct drm_encoder *encoder) void drm_helper_disable_unused_functions(struct drm_device *dev) { struct drm_encoder *encoder; - struct drm_connector *connector; struct drm_crtc *crtc; - list_for_each_entry(connector, &dev->mode_config.connector_list, head) { - if (!connector->encoder) - continue; - if (connector->status == connector_status_disconnected) - connector->encoder = NULL; - } - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { if (!drm_helper_encoder_in_use(encoder)) { drm_encoder_disable(encoder);