[PATCH] reset-kernel-context

Chris Wilson chris at chris-wilson.co.uk
Fri Dec 15 22:44:46 UTC 2017


---
 drivers/gpu/drm/i915/i915_drv.c | 5 +++++
 drivers/gpu/drm/i915/i915_gem.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ca9f4b2862eb..dc6f3ab72417 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -2024,6 +2024,11 @@ int i915_reset_engine(struct intel_engine_cs *engine, unsigned int flags)
 		goto out;
 	}
 
+	if (!IS_ERR(active_request)) {
+		ret = -EIO;
+		goto out;
+	}
+
 	if (!engine->i915->guc.execbuf_client)
 		ret = intel_gt_reset_engine(engine->i915, engine);
 	else
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4a7f5579a7a5..ae908f2ed95f 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3114,11 +3114,16 @@ void i915_gem_reset(struct drm_i915_private *dev_priv)
 
 	for_each_engine(engine, dev_priv, id) {
 		struct i915_gem_context *ctx;
+		struct drm_i915_gem_request *rq;
 
 		i915_gem_reset_engine(engine, engine->hangcheck.active_request);
 		ctx = fetch_and_zero(&engine->last_retired_context);
 		if (ctx)
 			engine->context_unpin(engine, ctx);
+
+		rq = i915_gem_request_alloc(engine, dev_priv->kernel_context);
+		if (!IS_ERR(rq))
+			__i915_add_request(rq, false);
 	}
 
 	i915_gem_restore_fences(dev_priv);
-- 
2.15.1



More information about the Intel-gfx-trybot mailing list