[PATCH 21/21] drm/i915/execlists: Skip preemption-timeout for lite restores
Chris Wilson
chris at chris-wilson.co.uk
Thu Feb 13 12:27:03 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_execlists_submission.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
index 1736e77166dd..90a7f140193a 100644
--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
+++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
@@ -1111,6 +1111,11 @@ static unsigned long active_preempt_timeout(struct intel_engine_cs *engine)
if (unlikely(intel_context_is_banned(rq->context)))
return 1;
+ /* 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;
+
return READ_ONCE(engine->props.preempt_timeout_ms);
}
--
2.25.0
More information about the Intel-gfx-trybot
mailing list