Skip to contentSkip to conversation

drm/i915: don't try to load GuC fw on pre-gen9

PATCH Applied Jesse Barnes 2 participants 2 messages Sep 10, 2015 – Sep 14, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: don't try to load GuC fw on pre-gen9

This avoids some bad register writes and generally feels more correct than unconditionally trying to redirect interrupts and such.

References: https://bugs.freedesktop.org/show_bug.cgi?id=91777

---
 drivers/gpu/drm/i915/i915_gem.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +16 -13
index 41263cd..fc3a5fd 100644
@@ -4691,19 +4691,22 @@ i915_gem_init_hw(struct drm_device *dev)
 	}
 
 	/* We can't enable contexts until all firmware is loaded */
-	ret = intel_guc_ucode_load(dev);
-	if (ret) {
-		/*
-		 * If we got an error and GuC submission is enabled, map
-		 * the error to -EIO so the GPU will be declared wedged.
-		 * OTOH, if we didn't intend to use the GuC anyway, just
-		 * discard the error and carry on.
-		 */
-		DRM_ERROR("Failed to initialize GuC, error %d%s\n", ret,
-			i915.enable_guc_submission ? "" : " (ignored)");
-		ret = i915.enable_guc_submission ? -EIO : 0;
-		if (ret)
-			goto out;
+	if (HAS_GUC_UCODE(dev)) {
+		ret = intel_guc_ucode_load(dev);
+		if (ret) {
+			/*
+			 * If we got an error and GuC submission is enabled, map
+			 * the error to -EIO so the GPU will be declared wedged.
+			 * OTOH, if we didn't intend to use the GuC anyway, just
+			 * discard the error and carry on.
+			 */
+			DRM_ERROR("Failed to initialize GuC, error %d%s\n", ret,
+				  i915.enable_guc_submission ? "" :
+				  " (ignored)");
+			ret = i915.enable_guc_submission ? -EIO : 0;
+			if (ret)
+				goto out;
+		}
 	}
 
 	/* Now it is safe to go back round and do everything else: */
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 5 lines · Jesse Barnes

This avoids some bad register writes and generally feels more correct than unconditionally trying to redirect interrupts and such.

References: https://bugs.freedesktop.org/show_bug.cgi?id=91777

Queued for -next, thanks for the patch.
-Daniel

Quoted 51 lines
---
 drivers/gpu/drm/i915/i915_gem.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +16 -13
index 41263cd..fc3a5fd 100644
@@ -4691,19 +4691,22 @@ i915_gem_init_hw(struct drm_device *dev)
 	}
 
 	/* We can't enable contexts until all firmware is loaded */
-	ret = intel_guc_ucode_load(dev);
-	if (ret) {
-		/*
-		 * If we got an error and GuC submission is enabled, map
-		 * the error to -EIO so the GPU will be declared wedged.
-		 * OTOH, if we didn't intend to use the GuC anyway, just
-		 * discard the error and carry on.
-		 */
-		DRM_ERROR("Failed to initialize GuC, error %d%s\n", ret,
-			i915.enable_guc_submission ? "" : " (ignored)");
-		ret = i915.enable_guc_submission ? -EIO : 0;
-		if (ret)
-			goto out;
+	if (HAS_GUC_UCODE(dev)) {
+		ret = intel_guc_ucode_load(dev);
+		if (ret) {
+			/*
+			 * If we got an error and GuC submission is enabled, map
+			 * the error to -EIO so the GPU will be declared wedged.
+			 * OTOH, if we didn't intend to use the GuC anyway, just
+			 * discard the error and carry on.
+			 */
+			DRM_ERROR("Failed to initialize GuC, error %d%s\n", ret,
+				  i915.enable_guc_submission ? "" :
+				  " (ignored)");
+			ret = i915.enable_guc_submission ? -EIO : 0;
+			if (ret)
+				goto out;
+		}
 	}
 
 	/* Now it is safe to go back round and do everything else: */
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx