From patchwork Tue Apr 1 20:15:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3925461 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C07729F2F7 for ; Tue, 1 Apr 2014 20:15:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCCF2202B4 for ; Tue, 1 Apr 2014 20:15:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DCC982024D for ; Tue, 1 Apr 2014 20:15:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 508966E841; Tue, 1 Apr 2014 13:15:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by gabe.freedesktop.org (Postfix) with ESMTP id F2A446E83F for ; Tue, 1 Apr 2014 13:15:12 -0700 (PDT) Received: by mail-wi0-f171.google.com with SMTP id q5so5900128wiv.10 for ; Tue, 01 Apr 2014 13:15: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:in-reply-to:references; bh=OoK3eQ2g2QUP/q+BuDFzR/MdW9L+OpwIDx7T9ajsy3U=; b=B9NGFUw1C6RoNdEplk90fb7LkhEt4G3dsl008IEkoHUa8Trh2hygP/mSMVZ7wdBfaC 6DFTc4/KB8IKN7R9Fv9nvrYSo2HFDR2cmZNZi72wm1d+9r3cJ51LIe0XlWd/jsC7rZeo PiWx5IniX34ZJ2wMSlPKTILUtuj8mE8UYWs5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OoK3eQ2g2QUP/q+BuDFzR/MdW9L+OpwIDx7T9ajsy3U=; b=fhS6L3pkL47GFJ8bY9MEdleeC7J+hHhfO4NM38sexuAPgeHNwHjcue0evqeKROTZAP TA9KU88tYYKxsqInWet/8YRY0iqQ28uMvRbAem4gGKe1ljRqzX9lPlTvP8p1UamGwKGL 0Lmd3WY6onFqIT86d1JIG4g72FB5ZmbH610BlTzPQuD02sM3yA4ZkwTo4rgVnSeyZGaM 2gLIxnLL42fFdHpnKQ2oumJliUx/LiwvqjMz39KjveKQ26RYayKJpmjIC3rPEncVXK8E ajXZegLhBhZzmnU/65hOga/KViGuPvniFK39DgqbYxyUHL263aYlWP1uMU2WHmM1pdkZ 2oGw== X-Gm-Message-State: ALoCoQl+elaEcvoR9BiwkVQ9DNki1W/SI0IEeeckjZ2bKDBB51rBGGMK1K5rt/I9SWKFwAS4KK1j X-Received: by 10.180.7.133 with SMTP id j5mr9959785wia.55.1396383309796; Tue, 01 Apr 2014 13:15:09 -0700 (PDT) Received: from phenom.ffwll.local (84-73-67-144.dclient.hispeed.ch. [84.73.67.144]) by mx.google.com with ESMTPSA id q49sm42863435eem.34.2014.04.01.13.15.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Apr 2014 13:15:08 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 2/2] drm/crtc-helper: don't disable disconnected outputs Date: Tue, 1 Apr 2014 22:15:00 +0200 Message-Id: <1396383300-7151-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1396383300-7151-1-git-send-email-daniel.vetter@ffwll.ch> References: <1396383300-7151-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Dave Airlie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.7 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 is the equivalent change in the crtc helpers as done to the i915 modeset infrastructure in commit b0a2658acb5bf9ca86b4aab011b7106de3af0add Author: Daniel Vetter Date: Tue Dec 18 09:37:54 2012 +0100 drm/i915: don't disable disconnected outputs This was originally introduced to make encoder sharing on radone easier for userspace, but: - It is policy and as such belongs into userspace. E.g. personally I'm fairly annoyed that a flaky cable results in permanent changes of the desktop layout, so I'll kick out DEs which do this. Worse if the kernel also tries to be clever. - It's inconsistent: We only kill disconnected outputs on setCrtc (which userspace might also call when just changing the framebuffer), but not when e.g. we receive a hpd event or in the output poll worker. - It's unexpected behaviour for the userspace driver, at least in the intel ddx we've had tons of bugs where the driver fell over and killed the X session becuase pageflips/vblanks suddenly stopped working. We've had to fix this by wrapping every single setCrtc int a big "recover kms state from the kernel again" operation. - It's suprising for the kernel, too: It took a few mails between Rob, Matt and me for them to notice that little dragon wreaking havoc with the universal plane framebuffer refcounting. - Userspace can cope with it and e.g. Gnome already kills disconnected outputs and reconfigures the desktop automatically. And since there have been no regression reports for the i915 change from over 1 year ago I think all other DEs are also ready. Note that the lines removed in this patch go back to commit a3a0544b2c84e1d7a2022b558ecf66d8c6a8dd93 Author: Dave Airlie Date: Mon Aug 31 15:16:30 2009 +1000 drm/kms: add explicit encoder disable function and detach harder. Unfortunately the patch itself doesn't explain a hole lot about why it was added ... Cc: Matt Roper Cc: Rob Clark Cc: Dave Airlie Cc: Alex Deucher Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_crtc_helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 8108db95e12b..003924025aa7 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -289,8 +289,6 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev) 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) {