All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Also perform gpu reset under execlist mode.
@ 2015-06-25 14:40 bing.niu
  2015-06-25  8:13 ` Chris Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: bing.niu @ 2015-06-25 14:40 UTC (permalink / raw)
  To: intel-gfx; +Cc: bing.niu

From: "Niu,Bing" <bing.niu@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@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

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

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

end of thread, other threads:[~2015-06-25 13:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 14:40 [PATCH] drm/i915: Also perform gpu reset under execlist mode bing.niu
2015-06-25  8:13 ` Chris Wilson
2015-06-25 12:24   ` Wang, Zhi A
2015-06-25 12:37     ` Chris Wilson
2015-06-24 21:56       ` Zhi Wang
2015-06-25 13:42         ` Chris Wilson
2015-06-24 22:13           ` Zhi Wang
2015-06-25 13:20   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.