Commit a02eb975 authored by Chris Wilson's avatar Chris Wilson

drm/i915/execlists: Cache the priolist when rescheduling

When rescheduling a change of dependencies, they all need to be added to
the same priolist (at least the ones on the same engine!). Since we
likely want to move a batch of requests, keep the priolist around.

v2: Throw in an assert to catch trivial errors quickly.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180508003046.2633-2-chris@chris-wilson.co.uk
parent 87c7acf8
...@@ -346,6 +346,7 @@ static void __unwind_incomplete_requests(struct intel_engine_cs *engine) ...@@ -346,6 +346,7 @@ static void __unwind_incomplete_requests(struct intel_engine_cs *engine)
p = lookup_priolist(engine, last_prio); p = lookup_priolist(engine, last_prio);
} }
GEM_BUG_ON(p->priority != rq_prio(rq));
list_add(&rq->sched.link, &p->requests); list_add(&rq->sched.link, &p->requests);
} }
} }
...@@ -1198,7 +1199,8 @@ sched_lock_engine(struct i915_sched_node *node, struct intel_engine_cs *locked) ...@@ -1198,7 +1199,8 @@ sched_lock_engine(struct i915_sched_node *node, struct intel_engine_cs *locked)
static void execlists_schedule(struct i915_request *request, static void execlists_schedule(struct i915_request *request,
const struct i915_sched_attr *attr) const struct i915_sched_attr *attr)
{ {
struct intel_engine_cs *engine; struct i915_priolist *uninitialized_var(pl);
struct intel_engine_cs *engine, *last;
struct i915_dependency *dep, *p; struct i915_dependency *dep, *p;
struct i915_dependency stack; struct i915_dependency stack;
const int prio = attr->priority; const int prio = attr->priority;
...@@ -1271,6 +1273,7 @@ static void execlists_schedule(struct i915_request *request, ...@@ -1271,6 +1273,7 @@ static void execlists_schedule(struct i915_request *request,
__list_del_entry(&stack.dfs_link); __list_del_entry(&stack.dfs_link);
} }
last = NULL;
engine = request->engine; engine = request->engine;
spin_lock_irq(&engine->timeline.lock); spin_lock_irq(&engine->timeline.lock);
...@@ -1287,8 +1290,12 @@ static void execlists_schedule(struct i915_request *request, ...@@ -1287,8 +1290,12 @@ static void execlists_schedule(struct i915_request *request,
node->attr.priority = prio; node->attr.priority = prio;
if (!list_empty(&node->link)) { if (!list_empty(&node->link)) {
__list_del_entry(&node->link); if (last != engine) {
queue_request(engine, node, prio); pl = lookup_priolist(engine, prio);
last = engine;
}
GEM_BUG_ON(pl->priority != prio);
list_move_tail(&node->link, &pl->requests);
} }
if (prio > engine->execlists.queue_priority && if (prio > engine->execlists.queue_priority &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment