From patchwork Tue Jul 3 09:27:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1150121 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 9982FDFF72 for ; Tue, 3 Jul 2012 10:37:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 852DE9F0F2 for ; Tue, 3 Jul 2012 03:37:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id CE2AC9F752 for ; Tue, 3 Jul 2012 03:34:27 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id hm11so2984141wib.12 for ; Tue, 03 Jul 2012 03:34:27 -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=SJR6Lbq0I0DORLEDtGPOSDxXKZJUj1sNWz3Fs5W5I04=; b=AgUNbHKbjttfBDtNPxpg+5kvZJUUxfT/1gebMb5XRtsRMzWygAx7pA4VG2gU0AiURR CPVMq+K89aiABFeoXTdmBC9LbqBWWZQwzqCcW+1t3U/9H/oRa19eMcmrBX/gmQTzLnh+ k2rOUpIb50C8F/CESmS0PY9nMDCDwsCl7ZIoQ= 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=SJR6Lbq0I0DORLEDtGPOSDxXKZJUj1sNWz3Fs5W5I04=; b=b/CMbAM8uhFQyv2SQbY5wqQoRWCLEnCP4F5UL6TuUoyvc9AB6OhlymDVLmxrhv+R8P hXxCJ6/cXZlQiq+XnRZJPCroWmxgGUyPG9AEwkcevCaZhlWRemGI0bQ/BXtvVy+nMA5W Ca2zkx/h80ceZY2r4ruAA7ddGopWrnHdru+IMECU8k6xAzSsVcLjmLme9QsFIgaPgo6j Ls1Lxmd7t3KjCd+ocbejv+DVwzrAkOO1n8FQ4Wses9+K5DoE4YbLcfwD5O1A4DHqzsGL kfjbm63e0fLNZlcfPEOdXSDLFF6YVPcN1/qXsZuVql7OatX9xLEICv1lmbEI4MruVIm9 HFiA== Received: by 10.180.83.234 with SMTP id t10mr16265530wiy.0.1341311667527; Tue, 03 Jul 2012 03:34:27 -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 e9sm14845138wiw.10.2012.07.03.03.34.26 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 03:34:26 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Tue, 3 Jul 2012 11:27:55 +0200 Message-Id: <1341307715-3886-4-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1341307715-3886-1-git-send-email-daniel.vetter@ffwll.ch> References: <1341307715-3886-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQlDf86k2sQ4qPMjioqBYbIrcsSG4hCVsMQmsKl4LgtTRK1HQeuCHkDxAj+vKZcIxcxbSZMg Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 03/43] drm/i915: rip out crtc prepare/commit indirection 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 Just impendance matching with the the crtc helper stuff. ... and somehow the design of this all ended up in this commit here, too ;-) The big plan is that a new set of display_funcs that take crtc take full responsibility of a modeset (and call down into object-specific callbacks and functions). The platform-specific callbacks simply know best what the proper order is. This has the drawback that we can't do minimal change-overs any more if a modeset just disables one encoder in a cloned configuration (because we will only expose a disabl/enable action that takes down/sets up the entire crtc including all encoders). Imo that's the only sane way to do it though: - The use-case for this is pretty minimal, even when presenting (at least sane people) should use a dual-screen output so that you can see your notes on your panel. Clone mode is imo BS. - With all the clone mode constrains, shared resources, and special ordering requirements (which differ even on the same platform sometimes for different outputs) there's no way we'd get this right for all cases. Especially since this is a under-used feature. - And to top it off: On haswell even dp link re-training requires us to take down the entire display pipe - otherwise the chip dies. So the only sane way is to do a full modeset on every crtc where the output config changes in any way. To support atomic modeset we'd then add one more function to allocate global and shared objects in the best ways (e.g. fdi links, pch plls, ...). The crtc functions would then simply use the pre-allocated stuff (and shouldn't be able to fail, ever). We could even do all the object pinning in there (and maybe try to defragment the global gtt if we fail)! Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 37 +-------------------------------- 1 files changed, 2 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 072f94d..608046f 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3457,34 +3457,6 @@ static void intel_crtc_disable(struct drm_crtc *crtc) } } -/* Prepare for a mode set. - * - * Note we could be a lot smarter here. We need to figure out which outputs - * will be enabled, which disabled (in short, how the config will changes) - * and perform the minimum necessary steps to accomplish that, e.g. updating - * watermarks, FBC configuration, making sure PLLs are programmed correctly, - * panel fitting is in the proper state, etc. - */ -static void i9xx_crtc_prepare(struct drm_crtc *crtc) -{ - i9xx_crtc_disable(crtc); -} - -static void i9xx_crtc_commit(struct drm_crtc *crtc) -{ - i9xx_crtc_enable(crtc); -} - -static void ironlake_crtc_prepare(struct drm_crtc *crtc) -{ - ironlake_crtc_disable(crtc); -} - -static void ironlake_crtc_commit(struct drm_crtc *crtc) -{ - ironlake_crtc_enable(crtc); -} - void intel_encoder_prepare(struct drm_encoder *encoder) { struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; @@ -6598,13 +6570,8 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) intel_crtc->active = true; /* force the pipe off on setup_init_config */ intel_crtc->bpp = 24; /* default for pre-Ironlake */ - if (HAS_PCH_SPLIT(dev)) { - intel_helper_funcs.prepare = ironlake_crtc_prepare; - intel_helper_funcs.commit = ironlake_crtc_commit; - } else { - intel_helper_funcs.prepare = i9xx_crtc_prepare; - intel_helper_funcs.commit = i9xx_crtc_commit; - } + intel_helper_funcs.prepare = dev_priv->display.crtc_disable; + intel_helper_funcs.commit = dev_priv->display.crtc_enable; drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);