Skip to contentSkip to conversation

drm/i915/kbl: Fix DMC load on Kabylake.

PATCH In review Rodrigo Vivi 3 participants 4 messages Dec 9, 2015

Subsystems (2)
lore
Share & tools
lore

Rodrigo Vivi

author maintainer
#0 lore raw

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

Kabylake A0 is based on Skylake H0.

v2: Don't assume revid+7 and only load the one we are sure about.

v3: Rebase on top of latest changes.

---
 drivers/gpu/drm/i915/intel_csr.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_csr.c +15 -3
index 6c6a669..7e5ce66 100644
@@ -181,8 +181,20 @@ static const struct stepping_info *intel_get_stepping_info(struct drm_device *de
 {
 	const struct stepping_info *si;
 	unsigned int size;
+	int revid = INTEL_REVID(dev);
 
-	if (IS_SKYLAKE(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 load one we know
+	 * it works on the KBLs we have so far add support for
+	 * the only current available KBL.
+	 */
+	if (IS_KABYLAKE(dev))
+		revid = 7;
+
+	if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) {
 		size = ARRAY_SIZE(skl_stepping_info);
 		si = skl_stepping_info;
 	} else if (IS_BROXTON(dev)) {
@@ -192,8 +204,8 @@ static const struct stepping_info *intel_get_stepping_info(struct drm_device *de
 		return NULL;
 	}
 
-	if (INTEL_REVID(dev) < size)
-		return si + INTEL_REVID(dev);
+	if (revid < size)
+		return si + revid;
 
 	return NULL;
 }
Signature · 6 lines
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#1 lore raw
Quoted 21 lines · Rodrigo Vivi

Kabylake A0 is based on Skylake H0.

v2: Don't assume revid+7 and only load the one we are sure about.

v3: Rebase on top of latest changes.

---
 drivers/gpu/drm/i915/intel_csr.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_csr.c +1 -0
index 6c6a669..7e5ce66 100644
@@ -181,8 +181,20 @@ static const struct stepping_info *intel_get_stepping_info(struct drm_device *de
 {
 	const struct stepping_info *si;
 	unsigned int size;
+	int revid = INTEL_REVID(dev);

drivers/gpu/drm/i915/intel_csr.c static const struct stepping_info *intel_get_stepping_info(struct drm_device *de · line 193

Quoted 10 lines
drivers/gpu/drm/i915/intel_csr.c +8 -1
 
-	if (IS_SKYLAKE(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 load one we know
+	 * it works on the KBLs we have so far add support for
+	 * the only current available KBL.
+	 */

Really I'd just add

static const struct stepping_info kbl_stepping_info[] = {
	{'H', '0'}, {'I', '0'}
};

with your comment above and an if (IS_KABYLAKE()) branch picking the right array, and keep this function nice and void of special casing and magic 7.

BR,
Jani.

Quoted 18 lines
drivers/gpu/drm/i915/intel_csr.c +6 -2
+	if (IS_KABYLAKE(dev))
+		revid = 7;
+
+	if (IS_SKYLAKE(dev) || IS_KABYLAKE(dev)) {
 		size = ARRAY_SIZE(skl_stepping_info);
 		si = skl_stepping_info;
 	} else if (IS_BROXTON(dev)) {
@@ -192,8 +204,8 @@ static const struct stepping_info *intel_get_stepping_info(struct drm_device *de
 		return NULL;
 	}
 
-	if (INTEL_REVID(dev) < size)
-		return si + INTEL_REVID(dev);
+	if (revid < size)
+		return si + revid;
 
 	return NULL;
 }
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author maintainer
#2 lore raw

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

Kabylake A0 is based on Skylake H0.

v2: Don't assume revid+7 and only load the one we are sure about.

v3: Rebase on top of latest changes.

v4: Accept cleaner solution from Jani with kbl_stepping_info
starting on H0 instead of put a hack on revid.

---
 drivers/gpu/drm/i915/intel_csr.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_csr.c +12 -1
index 6c6a669..9bb63a8 100644
@@ -166,6 +166,14 @@ struct stepping_info {
 	char substepping;
 };
 
+/*
+ * Kabylake derivated from Skylake H0, so SKL H0
+ * is the right firmware for KBL A0 (revid 0).
+ */
+static const struct stepping_info kbl_stepping_info[] = {
+	{'H', '0'}, {'I', '0'}
+};
+
 static const struct stepping_info skl_stepping_info[] = {
 	{'A', '0'}, {'B', '0'}, {'C', '0'},
 	{'D', '0'}, {'E', '0'}, {'F', '0'},
@@ -182,7 +190,10 @@ static const struct stepping_info *intel_get_stepping_info(struct drm_device *de
 	const struct stepping_info *si;
 	unsigned int size;
 
-	if (IS_SKYLAKE(dev)) {
+	if (IS_KABYLAKE(dev)) {
+		size = ARRAY_SIZE(kbl_stepping_info);
+		si = kbl_stepping_info;
+	} else if (IS_SKYLAKE(dev)) {
 		size = ARRAY_SIZE(skl_stepping_info);
 		si = skl_stepping_info;
 	} else if (IS_BROXTON(dev)) {
Signature · 6 lines
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#3 lore raw
Quoted 11 lines · Rodrigo Vivi

Kabylake A0 is based on Skylake H0.

v2: Don't assume revid+7 and only load the one we are sure about.

v3: Rebase on top of latest changes.

v4: Accept cleaner solution from Jani with kbl_stepping_info
starting on H0 instead of put a hack on revid.

Thanks.

Quoted 35 lines
---
 drivers/gpu/drm/i915/intel_csr.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_csr.c +12 -1
index 6c6a669..9bb63a8 100644
@@ -166,6 +166,14 @@ struct stepping_info {
 	char substepping;
 };
 
+/*
+ * Kabylake derivated from Skylake H0, so SKL H0
+ * is the right firmware for KBL A0 (revid 0).
+ */
+static const struct stepping_info kbl_stepping_info[] = {
+	{'H', '0'}, {'I', '0'}
+};
+
 static const struct stepping_info skl_stepping_info[] = {
 	{'A', '0'}, {'B', '0'}, {'C', '0'},
 	{'D', '0'}, {'E', '0'}, {'F', '0'},
@@ -182,7 +190,10 @@ static const struct stepping_info *intel_get_stepping_info(struct drm_device *de
 	const struct stepping_info *si;
 	unsigned int size;
 
-	if (IS_SKYLAKE(dev)) {
+	if (IS_KABYLAKE(dev)) {
+		size = ARRAY_SIZE(kbl_stepping_info);
+		si = kbl_stepping_info;
+	} else if (IS_SKYLAKE(dev)) {
 		size = ARRAY_SIZE(skl_stepping_info);
 		si = skl_stepping_info;
 	} else if (IS_BROXTON(dev)) {
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx