From: Damien Lespiau Subject: [PATCH 4/7] drm/i915: Disable display when fused off Date: Thu, 5 Dec 2013 13:56:19 +0000 Message-ID: <1386251782-21176-5-git-send-email-damien.lespiau@intel.com> References: <1386251782-21176-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 054C1FB5B3 for ; Thu, 5 Dec 2013 05:56:38 -0800 (PST) In-Reply-To: <1386251782-21176-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: benjamin.widawsky@intel.com List-Id: intel-gfx@lists.freedesktop.org FUSE_STRAP has a bit to inform us that the display has been fused off. Use it to setup the definitive number of pipes at run-time. Signed-off-by: Damien Lespiau --- drivers/gpu/drm/i915/i915_dma.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index cd22ec6..88bc0c2 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1456,14 +1456,31 @@ static void i915_dump_device_info(struct drm_i915_private *dev_priv) * - it's judged too laborious to fill n static structures with the limit * when a simple if statement does the job, * - run-time checks (eg read fuse/strap registers) are needed. + * + * This function needs to be called after the MMIO has been setup as we are + * reading registers, and before the first usage of the fields it can tweak. */ static void intel_device_info_runtime_init(struct drm_device *dev) { - struct intel_device_info *info = INTEL_INFO(dev); + struct drm_i915_private *dev_priv = dev->dev_private; + struct intel_device_info *info = &dev_priv->info; + u32 fuse_strap; info->num_planes = 1; if (IS_VALLEYVIEW(dev)) info->num_planes = 2; + + /* + * FUSE_STRAP exists since ILK, but we haven't seen a fused out display + * before IVB. + */ + if (INTEL_INFO(dev)->gen >= 7 && !IS_VALLEYVIEW(dev)) { + fuse_strap = I915_READ(FUSE_STRAP); + if (fuse_strap & ILK_INTERNAL_DISPLAY_DISABLE) { + DRM_DEBUG_DRIVER("Display fused off, disabling\n"); + info->num_planes = 0; + } + } } /** -- 1.8.3.1