Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: don't try to load GuC fw on pre-gen9
@ 2015-09-10 21:55 Jesse Barnes
  2015-09-14  9:26 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Jesse Barnes @ 2015-09-10 21:55 UTC (permalink / raw)
  To: intel-gfx

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
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_gem.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 41263cd..fc3a5fd 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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: */
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915: don't try to load GuC fw on pre-gen9
  2015-09-10 21:55 [PATCH] drm/i915: don't try to load GuC fw on pre-gen9 Jesse Barnes
@ 2015-09-14  9:26 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2015-09-14  9:26 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Thu, Sep 10, 2015 at 02:55:00PM -0700, Jesse Barnes wrote:
> 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
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

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

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 29 ++++++++++++++++-------------
>  1 file changed, 16 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 41263cd..fc3a5fd 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -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: */
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-14  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-10 21:55 [PATCH] drm/i915: don't try to load GuC fw on pre-gen9 Jesse Barnes
2015-09-14  9:26 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox