From patchwork Sun Aug 12 16:15:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1309951 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id D34BBDF280 for ; Sun, 12 Aug 2012 17:23:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 974ED9ECD1 for ; Sun, 12 Aug 2012 10:23:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@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 D64829EC83 for ; Sun, 12 Aug 2012 10:22:32 -0700 (PDT) Received: by weyr3 with SMTP id r3so2202513wey.36 for ; Sun, 12 Aug 2012 10:22:31 -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=Pc7WuU+R/NmNN33nezNiYHkM7VxQ0FNv1RmAF6VvZO8=; b=VyH/K2YRQn1OpRpqoFqIAeSl3/e2w/Y3PBYKrkJPUZDhb5g3Ki7eY3CS9LLmiQ6W+l QMUR5cuXlslZM7Rl/aSh9UBeR7QQh0MN+ORDgr+lPYPFdsvSJnOM2NWzYd+Tr2GpO98+ G5MJtn6eZwG1VDaaGSL0mw2wzcIFkkP6fvgLg= 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=Pc7WuU+R/NmNN33nezNiYHkM7VxQ0FNv1RmAF6VvZO8=; b=o4+UYsIsjCbV5CURc3DH75u0oeHP0+0jWqcjv+l7tKxVv0wV4gri69cS+Om2+O6rsM VlHlm1JPDjiFvIRIjiCJRlzW+EZMjFuH0kMnl0kj3Ydqv5scjzW+qSeE61c8Sd9FUmNE Bg2DB41Fa1HOofv0iDFGcERX6P9WxXOjVUDvS1sO/lmZAFPqPI3Mqzk+s8GiUIVQjlG8 ZV1mn2jxlq15LTfcq/RjEeNFMfhHW+f0QEtEnOYU9Qc9I0I0XTpp8QNEObRP0RPtD0NO paPfi8KjD5Qz7yxStpDG4whfSyJpDOl1qBQmobpzBCUt42CQ3hnAyb0pfqJ7jkwyYdkR fdug== Received: by 10.180.95.193 with SMTP id dm1mr11864048wib.10.1344792151565; Sun, 12 Aug 2012 10:22:31 -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 w7sm11606235wiz.0.2012.08.12.10.22.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Aug 2012 10:22:30 -0700 (PDT) From: Daniel Vetter To: Dave Airlie Date: Sun, 12 Aug 2012 18:15:48 +0200 Message-Id: <1344788148-1174-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.2 X-Gm-Message-State: ALoCoQks8ZyRuEoLZaucTW6ioeLBhp5Kzpo13FiS01iPDFBBUwu0wGQtElL0ZrJV+szJSnhOaTO3 Cc: Daniel Vetter , Intel Graphics Development , DRI Development Subject: [Intel-gfx] [PATCH] drm/fb-helper: don't clobber output routing in setup_crtcs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=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 anyway. 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 --- Hi Dave, This patch here is blocking the modeset-rework series, and I'd like to merge that as soon as possible. You've merged the other two prep patches already for 3.6, but this one here popped up later on in testing. Can you please merge this into drm-next for 3.7 so that I can backmerge it, or smash your maintainer-ack onto it for merging through the intel tree? Thanks, Daniel --- 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,