[PATCH 2/2] drm/i915/execlists: Clear STOP_RING bit before restoring the context
Chris Wilson
chris at chris-wilson.co.uk
Tue Aug 14 11:21:04 UTC 2018
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/intel_lrc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 3f90c74038ef..13d49c49a107 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1338,6 +1338,20 @@ __execlists_context_pin(struct intel_engine_cs *engine,
GEM_BUG_ON(!intel_ring_offset_valid(ce->ring, ce->ring->head));
ce->lrc_reg_state[CTX_RING_HEAD+1] = ce->ring->head;
+ /*
+ * After a reset the context may have preserved the STOP bit
+ * of RING_MI_MODE we use to freeze an active engine before the
+ * reset. If that bit is restored the ring stops instead of
+ * executing.
+ */
+ if (ce->lrc_reg_state[88] == 0x209c) {
+ pr_err("Found MI_MODE: %08x [%s %s]",
+ ce->lrc_reg_state[89],
+ (ce->lrc_reg_state[89] & MODE_IDLE) ? "idle" : "",
+ (ce->lrc_reg_state[89] & STOP_RING) ? "stopped" : "");
+ ce->lrc_reg_state[89] &= ~(STOP_RING << 16);
+ }
+
ce->state->obj->pin_global++;
i915_gem_context_get(ctx);
return ce;
--
2.18.0
More information about the Intel-gfx-trybot
mailing list