[PATCH 39/84] drm/i915: Priority boost switching to an idle ring

Chris Wilson chris at chris-wilson.co.uk
Sat Feb 3 10:25:52 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 7bebf97abca7..9ecd3ff416c5 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 6f0467c928ae..202064e0c21a 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -952,6 +952,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