From patchwork Thu Dec 5 14:11:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 3288601 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4CFB7C0D4A for ; Thu, 5 Dec 2013 14:12:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF0FA20503 for ; Thu, 5 Dec 2013 14:12:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id ADF5C204EA for ; Thu, 5 Dec 2013 14:12:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 86BADFB990 for ; Thu, 5 Dec 2013 06:12:18 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FCCBFB89D for ; Thu, 5 Dec 2013 06:12:06 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 05 Dec 2013 06:08:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,833,1378882800"; d="scan'208";a="419898680" Received: from unknown (HELO strange.amr.corp.intel.com) ([10.255.15.198]) by orsmga001.jf.intel.com with ESMTP; 05 Dec 2013 06:11:59 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Thu, 5 Dec 2013 14:11:58 +0000 Message-Id: <1386252718-27657-1-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1386251782-21176-5-git-send-email-damien.lespiau@intel.com> References: <1386251782-21176-5-git-send-email-damien.lespiau@intel.com> Subject: [Intel-gfx] [PATCH 4/7 v2] drm/i915: Disable display when fused off 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. v2: actually tweak num_pipes, not num_planes 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..3e9828c 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_pipes = 0; + } + } } /**