[PATCH 15/15] drm/i915: Priority boost switching to an idle ring
Chris Wilson
chris at chris-wilson.co.uk
Wed Jan 3 13:01:02 UTC 2018
In order to maximise concurrency between engines, if we queue a request
to a current idle ring, reorder its dependencies to execute that request
as early as possible and ideally improve occupancy of multiple engines
simultaneously.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_request.h | 1 +
drivers/gpu/drm/i915/intel_lrc.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
index e0615a1ea262..32234a1159aa 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.h
+++ b/drivers/gpu/drm/i915/i915_gem_request.h
@@ -85,6 +85,7 @@ enum {
#define I915_PRIORITY_MASK (-BIT(I915_PRIORITY_SHIFT))
#define I915_PRIORITY_LOCKED BIT(7)
+#define I915_PRIORITY_STALL BIT(0)
struct i915_gem_capture_list {
struct i915_gem_capture_list *next;
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 5daa57712a75..1a1cbe229296 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -992,6 +992,9 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio)
GEM_BUG_ON(prio == I915_PRIORITY_INVALID);
+ if (!RB_EMPTY_ROOT(&request->engine->execlists.queue.rb_root))
+ prio |= I915_PRIORITY_STALL;
+
if (prio <= READ_ONCE(request->priotree.priority))
return;
--
2.15.1
More information about the Intel-gfx-trybot
mailing list