From patchwork Thu Oct 29 17:20:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 7520031 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 30E4E9F327 for ; Thu, 29 Oct 2015 17:21:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F02F1205C2 for ; Thu, 29 Oct 2015 17:20:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 28D1620592 for ; Thu, 29 Oct 2015 17:20:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ECFBE6E5A8; Thu, 29 Oct 2015 10:20:51 -0700 (PDT) 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 D9FE96E5A8 for ; Thu, 29 Oct 2015 10:20:48 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 29 Oct 2015 10:20:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,215,1444719600"; d="scan'208";a="838167621" Received: from unknown (HELO otcvmt2.jf.intel.com) ([10.54.31.155]) by orsmga002.jf.intel.com with ESMTP; 29 Oct 2015 10:20:33 -0700 From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Thu, 29 Oct 2015 10:20:26 -0700 Message-Id: <1446139226-2128-1-git-send-email-rodrigo.vivi@intel.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1445966099-1640-7-git-send-email-rodrigo.vivi@intel.com> References: <1445966099-1640-7-git-send-email-rodrigo.vivi@intel.com> Cc: Rodrigo Vivi Subject: [Intel-gfx] [PATCH] drm/i915/kbl: Fix DMC load on Kabylake. 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-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 Kabylake A0 is based on Skylake H0. v2: Don't assume revid+7 and only load the one we are sure about. v3: Add missing IS_KABYLAKE. Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/intel_csr.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index 9e530a7..d4bb90a 100644 --- a/drivers/gpu/drm/i915/intel_csr.c +++ b/drivers/gpu/drm/i915/intel_csr.c @@ -190,9 +190,21 @@ static struct stepping_info bxt_stepping_info[] = { static char intel_get_stepping(struct drm_device *dev) { - if (IS_SKYLAKE(dev) && (dev->pdev->revision < - ARRAY_SIZE(skl_stepping_info))) - return skl_stepping_info[dev->pdev->revision].stepping; + int revid = INTEL_REVID(dev); + + /* + * FIXME: Kabylake derivated from Skylake H0, so SKL H0 + * is the right firmware for KBL A0 (revid 0). + * We have no visibility yet how next KBL steppings will + * be handled by firmware, so let's just add support for + * the only current available KBL. + */ + if (IS_KABYLAKE(dev) && revid == 0) + return skl_stepping_info[7].stepping; + + if (IS_SKYLAKE(dev) && + revid < ARRAY_SIZE(skl_stepping_info)) + return skl_stepping_info[revid].stepping; else if (IS_BROXTON(dev) && (dev->pdev->revision < ARRAY_SIZE(bxt_stepping_info))) return bxt_stepping_info[dev->pdev->revision].stepping; @@ -202,9 +214,21 @@ static char intel_get_stepping(struct drm_device *dev) static char intel_get_substepping(struct drm_device *dev) { - if (IS_SKYLAKE(dev) && (dev->pdev->revision < - ARRAY_SIZE(skl_stepping_info))) - return skl_stepping_info[dev->pdev->revision].substepping; + int revid = INTEL_REVID(dev); + + /* + * FIXME: Kabylake derivated from Skylake H0, so SKL H0 + * is the right firmware for KBL A0 (revid 0). + * We have no visibility yet how next KBL steppings will + * be handled by firmware, so let's just add support for + * the only current available KBL. + */ + if (IS_KABYLAKE(dev) && revid == 0) + return skl_stepping_info[7].substepping; + + if (IS_SKYLAKE(dev) && + revid < ARRAY_SIZE(skl_stepping_info)) + return skl_stepping_info[revid].substepping; else if (IS_BROXTON(dev) && (dev->pdev->revision < ARRAY_SIZE(bxt_stepping_info))) return bxt_stepping_info[dev->pdev->revision].substepping; @@ -428,7 +452,7 @@ void intel_csr_ucode_init(struct drm_device *dev) if (!HAS_CSR(dev)) return; - if (IS_SKYLAKE(dev)) + if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) csr->fw_path = I915_CSR_SKL; else if (IS_BROXTON(dev_priv)) csr->fw_path = I915_CSR_BXT;