[PATCH] drm/i915/kbl: Fix DMC load on Kabylake.

Rodrigo Vivi
2015-10-29T17:20:48Z

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 <rodrigo.vivi@intel.com>
---
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;
--
2.4.3