From patchwork Wed Apr 13 15:52:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 8824021 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3646D9F39A for ; Wed, 13 Apr 2016 15:52:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DCC7200FE for ; Wed, 13 Apr 2016 15:52:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 50646200E3 for ; Wed, 13 Apr 2016 15:52:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0EE66E3EE; Wed, 13 Apr 2016 15:52:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.bwidawsk.net (zangief.bwidawsk.net [107.170.211.233]) by gabe.freedesktop.org (Postfix) with ESMTPS id B28066E3EE for ; Wed, 13 Apr 2016 15:52:40 +0000 (UTC) Received: by mail.bwidawsk.net (Postfix, from userid 5001) id 780EB122A0E; Wed, 13 Apr 2016 08:52:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from snipes.localdomain (jfdmzpr06-ext.jf.intel.com [134.134.137.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.bwidawsk.net (Postfix) with ESMTPSA id EE522122875; Wed, 13 Apr 2016 08:52:34 -0700 (PDT) From: Ben Widawsky To: Intel GFX Date: Wed, 13 Apr 2016 08:52:24 -0700 Message-Id: <1460562744-26811-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 2.8.0 Cc: Ben Widawsky , Eero Tamminen Subject: [Intel-gfx] [PATCH] drm/i915/skl: Update eDRAM calculation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP The two behavioral changes here are the correct detection of the eDRAM size on gen9 (SKL + KBL), and unconditional printing of the eLLC size. Cc: Eero Tamminen Signed-off-by: Ben Widawsky Acked-by: Ben Widawsky --- drivers/gpu/drm/i915/intel_uncore.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index fbc1d21..efef724 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -314,8 +314,17 @@ static void intel_uncore_ellc_detect(struct drm_device *dev) { struct drm_i915_private *dev_priv = dev->dev_private; - if ((IS_HASWELL(dev) || IS_BROADWELL(dev) || - INTEL_INFO(dev)->gen >= 9) && + if (INTEL_INFO(dev)->gen >= 9 && HAS_LLC(dev)) { + u32 edramcap = __raw_i915_read32(dev_priv, HSW_EDRAM_PRESENT); + if (edramcap & EDRAM_ENABLED) { + int sets = (edramcap >> 8) & 0x3; + int ways = (edramcap >> 5) & 0x7; + int banks = (edramcap >> 1) & 0xf; + + ways = (ways + 1) * 4; + dev_priv->ellc_size = sets * ways * banks; + } + } else if ((IS_HASWELL(dev) || IS_BROADWELL(dev)) && (__raw_i915_read32(dev_priv, HSW_EDRAM_PRESENT) & EDRAM_ENABLED)) { /* The docs do not explain exactly how the calculation can be * made. It is somewhat guessable, but for now, it's always @@ -323,8 +332,9 @@ static void intel_uncore_ellc_detect(struct drm_device *dev) * NB: We can't write IDICR yet because we do not have gt funcs * set up */ dev_priv->ellc_size = 128; - DRM_INFO("Found %zuMB of eLLC\n", dev_priv->ellc_size); } + + DRM_INFO("Found %zuMB of eLLC\n", dev_priv->ellc_size); } static bool