From patchwork Thu Jul 26 18:48:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1244541 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 2E7B1DFFCE for ; Thu, 26 Jul 2012 19:59:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A2419E790 for ; Thu, 26 Jul 2012 12:59:32 -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 59BDA9EC4F for ; Thu, 26 Jul 2012 12:56:07 -0700 (PDT) Received: by weyr3 with SMTP id r3so1738770wey.36 for ; Thu, 26 Jul 2012 12:56:06 -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=vvrjiF7TDUE/wKxzl0my3EQltunNYS61FpGVCaZPBuw=; b=ho1cnq07e7QSHcOIkl9IthzF0KG5YbScnKyZWmoQ7TSNW9uxCnZ+ZGCPKheeIuRrXw R7MSVNiipgnkTRUP5bIA7xdu2uaUlyQov4o2bLkOmi1igXk8Mo12GOPH/f0w9TRQoQK/ nr0gdvDHxreW2xFj4O4LbOD78YKQBcZuqkUSI= 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=vvrjiF7TDUE/wKxzl0my3EQltunNYS61FpGVCaZPBuw=; b=BCyqqIuN6xvQL9dKjo/urvP4jYK0HFXFNbG17JsfNuFwnOtfkZp3KQ2b8z20z+286q kBXzu/bB4DOzEmtkG8ImNIJPtVlKFwh+r6R0dRT/N+kLM7w6gJAm7buQy07BvlPItsdk d3bMAlyzzqPcMZCYkfzCfq3/1JBtq6ZAluldnPpra5lq3MQBdZm2meW+sG5P+FgW6FOH H4M9Zvu+fsFT6ngCUnlDmLEFdDl8X3WO5GRL4TU4iD+S7FaEXGKqdnU6kKomKFSWU66F u+4QJdgWLHysgXRK98aymyccgZJOzEug8EMg4RdIl6H4ZRM1FJdaM6t8H7YKbexsAVOs Hh7g== Received: by 10.217.2.146 with SMTP id p18mr7681022wes.198.1343332566579; Thu, 26 Jul 2012 12:56:06 -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 fr4sm391403wib.8.2012.07.26.12.56.05 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jul 2012 12:56:05 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 26 Jul 2012 20:48:26 +0200 Message-Id: <1343328581-2324-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> References: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQkYDJ2vY1WPdwpQ7Mg+H13PnDG2uFtY2uG9djQ/8ejNpQ3UMgy67hrnkn3HdSoLqUfO9miO Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 01/76] 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. 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 Reviewed-by: Jesse Barnes fwiw. --- 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,