[PATCH 25/64] drm/i915: Priority boost switching to an idle ring

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 19 21:33:18 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 3759a4d0724b..0aa123904e7d 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -995,6 +995,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