[Intel-gfx] [PATCH] drm/i915: Also perform gpu reset under execlist mode.

bing.niu at intel.com bing.niu at intel.com
Thu Jun 25 07:40:15 PDT 2015


From: "Niu,Bing" <bing.niu at intel.com>

It is found that i915 will not reset gpu under execlist mode when
unload module. that will lead to some issues when unload/load module
with different submission mode. e.g. from execlist mode to ring
buffer mode via loading/unloading i915. Because HW is not in a reset
state and registers are not clean under such condition.

Signed-off-by: Niu,Bing <bing.niu at intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 133afcf..551478c 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -372,13 +372,13 @@ void i915_gem_context_fini(struct drm_device *dev)
 	struct intel_context *dctx = dev_priv->ring[RCS].default_context;
 	int i;
 
-	if (dctx->legacy_hw_ctx.rcs_state) {
-		/* The only known way to stop the gpu from accessing the hw context is
-		 * to reset it. Do this as the very last operation to avoid confusing
-		 * other code, leading to spurious errors. */
-		intel_gpu_reset(dev);
+    /* The only known way to stop the gpu from accessing the hw context is
+     * to reset it. Do this as the very last operation to avoid confusing
+     * other code, leading to spurious errors. */
+    intel_gpu_reset(dev);
 
-		/* When default context is created and switched to, base object refcount
+	if (dctx->legacy_hw_ctx.rcs_state) {
+	    /* When default context is created and switched to, base object refcount
 		 * will be 2 (+1 from object creation and +1 from do_switch()).
 		 * i915_gem_context_fini() will be called after gpu_idle() has switched
 		 * to default context. So we need to unreference the base object once
-- 
1.7.9.5



More information about the Intel-gfx mailing list