[PATCH 19/45] trim-priolist
Chris Wilson
chris at chris-wilson.co.uk
Wed Jan 27 10:26:51 UTC 2021
---
drivers/gpu/drm/i915/i915_scheduler.c | 29 +++++++++++++++++----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_scheduler.c b/drivers/gpu/drm/i915/i915_scheduler.c
index 522c0e737fcc..0947aaab66cc 100644
--- a/drivers/gpu/drm/i915/i915_scheduler.c
+++ b/drivers/gpu/drm/i915/i915_scheduler.c
@@ -349,8 +349,8 @@ lookup_priolist(struct intel_engine_cs *engine, int prio)
return &pl->requests;
}
-static void remove_priolist(struct intel_engine_cs *engine,
- struct list_head *plist)
+static void __remove_priolist(struct intel_engine_cs *engine,
+ struct list_head *plist)
{
struct i915_sched_engine * const se = &engine->active;
struct i915_priolist_root *root = &se->queue;
@@ -384,6 +384,19 @@ static void remove_priolist(struct intel_engine_cs *engine,
GEM_BUG_ON(tmp != old);
}
+static void remove_from_priolist(struct intel_engine_cs *engine,
+ struct i915_request *rq,
+ struct list_head *list)
+{
+ struct list_head *prev = rq->sched.link.prev;
+
+ GEM_BUG_ON(!i915_request_in_priority_queue(rq));
+
+ list_move_tail(&rq->sched.link, list);
+ if (list_empty(prev))
+ __remove_priolist(engine, prev);
+}
+
void i915_priolist_advance(struct i915_priolist_root *root,
struct i915_priolist *pl)
{
@@ -554,13 +567,8 @@ static void __i915_request_set_priority(struct i915_request *rq, int prio)
continue;
GEM_BUG_ON(rq->engine != engine);
- if (i915_request_in_priority_queue(rq)) {
- struct list_head *prev = rq->sched.link.prev;
-
- list_move_tail(&rq->sched.link, plist);
- if (list_empty(prev))
- remove_priolist(engine, prev);
- }
+ if (i915_request_in_priority_queue(rq))
+ remove_from_priolist(engine, rq, plist);
/* Defer (tasklet) submission until after all updates. */
kick_submission(engine, rq, prio);
@@ -693,8 +701,7 @@ void __i915_sched_defer_request(struct intel_engine_cs *engine,
/* Note list is reversed for waiters wrt signal hierarchy */
GEM_BUG_ON(rq->engine != engine);
- GEM_BUG_ON(!i915_request_in_priority_queue(rq));
- list_move(&rq->sched.link, &dfs);
+ remove_from_priolist(engine, rq, &dfs);
/* Track our visit, and prevent duplicate processing */
clear_bit(I915_FENCE_FLAG_PQUEUE, &rq->fence.flags);
--
2.20.1
More information about the Intel-gfx-trybot
mailing list