[PATCH 27/66] drm/i915: Priority boost switching to an idle ring
Chris Wilson
chris at chris-wilson.co.uk
Sat Jan 20 19:43:49 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 66e4cf9bff6f..ee1520077757 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 056ba0e13382..bbf849430303 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1001,6 +1001,9 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio)
if (i915_gem_request_completed(request))
return;
+ 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