From patchwork Wed Jul 25 20:10:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1239671 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 280403FDFB for ; Wed, 25 Jul 2012 21:17:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D83A9ED5B for ; Wed, 25 Jul 2012 14:17:14 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 3878C9F591 for ; Wed, 25 Jul 2012 14:16:35 -0700 (PDT) Received: by weyr3 with SMTP id r3so935801wey.36 for ; Wed, 25 Jul 2012 14:16:34 -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; bh=vvrjiF7TDUE/wKxzl0my3EQltunNYS61FpGVCaZPBuw=; b=LNn9dVAz7cL499uu1ik/q8tC8sKbfxYfXsGpME/qq+DOrkWzjXRwrMIIJQPuejp3l5 2C6M3vzl/vlU55EHn5+zs7rGXEQ6RC+kqlmRhs5SaxIsde3CZPsgJa9jJjpOvX2Cj7Hd fbwFmxNkb4kAAKegXk1XvLLOAE2DPXzGSYI6o= 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:x-gm-message-state; bh=vvrjiF7TDUE/wKxzl0my3EQltunNYS61FpGVCaZPBuw=; b=V9KfkMRfjEQifr6jrpNc63nNXcuTRniMdpQgxIsDlLmtQ+V/qmcGFfyvQcPKUk/3/I 1aQyEEBcfhTLaKaOitsJ2f0VZpCxqSfa++4SMSsbQk4o5EI2KfNf69UJTCZ04OpDCzaa Cjq2usGdXQFf/MsHRAgt8Ygi42jh4AML1uAujA0Xlxl+7b1lFEzCzNnowTar0d+YYEHJ roI6u9MAvpnqgIcpmHKkf8aMKhHqD8UoMCKF4uwCh5CDBNCoQIm/AZ9W6pEQElxDXAFp LU+UPB8QihC8F1cupLA5M3RJVG1p5iayDjOYVGw1IsVnL2z7bju8REAiKNkj0twhDUdy e6gw== Received: by 10.216.68.2 with SMTP id k2mr7074865wed.69.1343250994155; Wed, 25 Jul 2012 14:16:34 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id fb20sm6963194wid.1.2012.07.25.14.16.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2012 14:16:33 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development , DRI Development Subject: [PATCH] drm/fb-helper: don't clobber output routing in setup_crtcs Date: Wed, 25 Jul 2012 22:10:11 +0200 Message-Id: <1343247011-7523-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQnKDIEo7/XGgHQ8LKuN7CK2qxRdlBUgHUzSrkvjZu9wFLRW9jZHKx4YMTrgCuIehmXmuyEE 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 Yet again the too close relationship between the fb helper and the crtc helper code strikes. This time around the fb helper resets all encoder->crtc pointers to NULL before starting to set up it's own mode. Which is total bullocks, because this will clobber the existing output routing, which the new drm/i915 code depends upon to be absolutely correct. The crtc helper itself doesn't really care about that, since it disables unused encoders in a rather roundabout way. Two places call drm_setup_crts: - For the initial fb config. I've auditted all current drivers, and they all allocate their encoders with kzalloc. So there's no need to clear encoder->crtc once more. - When processing hotplug events while showing the fb console. This one is a bit more tricky, but both the crtc helper code and the new drm/i915 modeset code disable encoders if their crtc is changed and that encoder isn't part of the new config. Also, both disable any disconnected outputs, too. Which only leaves encoders that are on, connected, but for some odd reason the fb helper code doesn't want to use. That would be a bug in the fb configuration selector, since it tries to light up as many outputs as possible. v2: Kill the now unused encoders variable. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_helper.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index f546d1e..4ecc869 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1230,7 +1230,6 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) struct drm_device *dev = fb_helper->dev; struct drm_fb_helper_crtc **crtcs; struct drm_display_mode **modes; - struct drm_encoder *encoder; struct drm_mode_set *modeset; bool *enabled; int width, height; @@ -1241,11 +1240,6 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper) width = dev->mode_config.max_width; height = dev->mode_config.max_height; - /* clean out all the encoder/crtc combos */ - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { - encoder->crtc = NULL; - } - crtcs = kcalloc(dev->mode_config.num_connector, sizeof(struct drm_fb_helper_crtc *), GFP_KERNEL); modes = kcalloc(dev->mode_config.num_connector,