[PATCH 48/87] drm/i915: Priority boost switching to an idle ring
Chris Wilson
chris at chris-wilson.co.uk
Sat Mar 24 11:41:24 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_request.h | 5 +++--
drivers/gpu/drm/i915/intel_lrc.c | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h
index 1220c110f3b8..23798554b48f 100644
--- a/drivers/gpu/drm/i915/i915_request.h
+++ b/drivers/gpu/drm/i915/i915_request.h
@@ -86,10 +86,11 @@ enum {
I915_PRIORITY_INVALID = INT_MIN
};
-#define I915_PRIORITY_SHIFT 1
+#define I915_PRIORITY_SHIFT 2
#define I915_PRIORITY_MASK (-BIT(I915_PRIORITY_SHIFT))
-#define I915_PRIORITY_NEWCLIENT BIT(0)
+#define I915_PRIORITY_NEWCLIENT BIT(1)
+#define I915_PRIORITY_STALL BIT(0)
struct i915_capture_list {
struct i915_capture_list *next;
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 043fa88b708f..8fe201a094e8 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1134,6 +1134,9 @@ static void execlists_schedule(struct i915_request *request, int prio)
if (i915_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.16.3
More information about the Intel-gfx-trybot
mailing list