From patchwork Wed May 8 08:36:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2537881 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 78442DF2E5 for ; Wed, 8 May 2013 08:37:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 82CF0E5F03 for ; Wed, 8 May 2013 01:37:19 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 642C3E5C20 for ; Wed, 8 May 2013 01:36:42 -0700 (PDT) Received: by mail-ee0-f44.google.com with SMTP id t10so813004eei.31 for ; Wed, 08 May 2013 01:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=rBbPV8nsVFrlU08HR4Ry7ajxEABxtWm4ZLuxxFcXcx0=; b=XKa0JSXry5BiJ/98PPq/57xLUggjZmDOnXq8Hv86O2Hfqq6SBy1rWrmr0m7quUtN7e DV6oJ7uCQpMRULLc8VpAocyiD2/e7unx67VfLM2bfCpjoPOL5EZ/K4E4pjLjcpFjcdP7 A4zYLpMt7fxKAn8arbn0pJ5j7ipj8ZARRwR0c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=rBbPV8nsVFrlU08HR4Ry7ajxEABxtWm4ZLuxxFcXcx0=; b=WThoV7N9UnzjL9esUnzYHifzUW5VOogqHHuhAg2fFPXSV+HFigWYaRfozlCFjuZQYN +fi5nH/KGnjnXwsvqKjZ87DBcz0EE2GSNjowVctWa0f1OLMSn9RFdSS6x6ei2kcTokt7 n67CaJFmBQUPf8U5XcvUPVO9TjCXOOTY8y0gyD1ejQ4ZX5S2zloNMcb6DOfp9ro5K0kQ WUbfjZ7aeFOBRjNfoyA1QStFX1ZI++QfW7nNI8XwTRy2h9vq4ezgYuq1OwEQEXO0X82J Yr+S33E/m5YpQG7RIiOzCNiup2+4Ea6N7OCTrqAEIupIQIMCSZMmx5GExsfCwx3cdvtC MkIw== X-Received: by 10.14.100.1 with SMTP id y1mr14767830eef.9.1368002201452; Wed, 08 May 2013 01:36:41 -0700 (PDT) Received: from bremse.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id n7sm43838300eeo.0.2013.05.08.01.36.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 08 May 2013 01:36:40 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 8 May 2013 10:36:31 +0200 Message-Id: <1368002191-6850-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1368002191-6850-1-git-send-email-daniel.vetter@ffwll.ch> References: <1367962457-28951-1-git-send-email-daniel.vetter@ffwll.ch> <1368002191-6850-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQmknerltwucCPzyf+D2tvqarBMIRnOa7vChbrsKkOkEc+6zQcwtPUTIU8p3GtumyckJ/bLe Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Use pipe config state to control gmch pfit enable/disable 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 Allows us to rip out a few fragile checks (which are duplicated in the hw state readout now, too). Also prepares us a bit for more than one panel/pfit. Signed-off-by: Daniel Vetter Reviewed-by: Mika Kuoppala --- drivers/gpu/drm/i915/intel_display.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index d7f2eaa..bc3cbe7 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3612,8 +3612,7 @@ static void i9xx_pfit_enable(struct intel_crtc *crtc) struct drm_i915_private *dev_priv = dev->dev_private; struct intel_crtc_config *pipe_config = &crtc->config; - if (!(intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_EDP) || - intel_pipe_has_type(&crtc->base, INTEL_OUTPUT_LVDS))) + if (!crtc->config.gmch_pfit.control) return; WARN_ON(I915_READ(PFIT_CONTROL) & PFIT_ENABLE); @@ -3732,20 +3731,15 @@ static void i9xx_pfit_disable(struct intel_crtc *crtc) { struct drm_device *dev = crtc->base.dev; struct drm_i915_private *dev_priv = dev->dev_private; - enum pipe pipe; - uint32_t pctl = I915_READ(PFIT_CONTROL); - assert_pipe_disabled(dev_priv, crtc->pipe); + if (!crtc->config.gmch_pfit.control) + return; - if (INTEL_INFO(dev)->gen >= 4) - pipe = (pctl & PFIT_PIPE_MASK) >> PFIT_PIPE_SHIFT; - else - pipe = PIPE_B; + assert_pipe_disabled(dev_priv, crtc->pipe); - if (pipe == crtc->pipe) { - DRM_DEBUG_DRIVER("disabling pfit, current: 0x%08x\n", pctl); - I915_WRITE(PFIT_CONTROL, 0); - } + DRM_DEBUG_DRIVER("disabling pfit, current: 0x%08x\n", + I915_READ(PFIT_CONTROL)); + I915_WRITE(PFIT_CONTROL, 0); } static void i9xx_crtc_disable(struct drm_crtc *crtc)