[Intel-gfx] [PATCH] drm/i915/execlists: Skip preemption-timeout for lite restores

Chris Wilson chris at chris-wilson.co.uk
Thu Jan 30 10:57:30 UTC 2020


If we are planning to perform a lite-restore, we want to replace the
running context with itself. We can therefore exempt this from the
preemption timeout.

Doing so does however increase the risk of a higher priority client
arriving later finding itself unable to proceed because of an unchecked
earlier failed preemption.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index 9a0d0282f3ca..eb83c87c8b4e 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -1737,6 +1737,11 @@ static unsigned long active_preempt_timeout(struct intel_engine_cs *engine)
 	if (!rq)
 		return 0;
 
+	/* Don't enforce a lite-restore, the client is already running */
+	GEM_BUG_ON(!engine->execlists.pending[0]);
+	if (rq->context == engine->execlists.pending[0]->context)
+		return 0;
+
 	/* Force a fast reset for terminated contexts (ignoring sysfs!) */
 	if (unlikely(intel_context_is_banned(rq->context)))
 		return 1;
-- 
2.25.0



More information about the Intel-gfx mailing list