diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-07 20:30:46 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-05-08 04:24:22 -0400 |
commit | a02eb975be78171f66a47c103e57e7940d0860a7 (patch) | |
tree | 483d8b739151344c1199f4c7504cb4d62ec4e7a6 | |
parent | 87c7acf867700a9f32db81b227174bf83fecfde3 (diff) |
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: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180508003046.2633-2-chris@chris-wilson.co.uk
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index bf9a44dae558..046adf397a71 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -346,6 +346,7 @@ static void __unwind_incomplete_requests(struct intel_engine_cs *engine) | |||
346 | p = lookup_priolist(engine, last_prio); | 346 | p = lookup_priolist(engine, last_prio); |
347 | } | 347 | } |
348 | 348 | ||
349 | GEM_BUG_ON(p->priority != rq_prio(rq)); | ||
349 | list_add(&rq->sched.link, &p->requests); | 350 | list_add(&rq->sched.link, &p->requests); |
350 | } | 351 | } |
351 | } | 352 | } |
@@ -1198,7 +1199,8 @@ sched_lock_engine(struct i915_sched_node *node, struct intel_engine_cs *locked) | |||
1198 | static void execlists_schedule(struct i915_request *request, | 1199 | static void execlists_schedule(struct i915_request *request, |
1199 | const struct i915_sched_attr *attr) | 1200 | const struct i915_sched_attr *attr) |
1200 | { | 1201 | { |
1201 | struct intel_engine_cs *engine; | 1202 | struct i915_priolist *uninitialized_var(pl); |
1203 | struct intel_engine_cs *engine, *last; | ||
1202 | struct i915_dependency *dep, *p; | 1204 | struct i915_dependency *dep, *p; |
1203 | struct i915_dependency stack; | 1205 | struct i915_dependency stack; |
1204 | const int prio = attr->priority; | 1206 | const int prio = attr->priority; |
@@ -1271,6 +1273,7 @@ static void execlists_schedule(struct i915_request *request, | |||
1271 | __list_del_entry(&stack.dfs_link); | 1273 | __list_del_entry(&stack.dfs_link); |
1272 | } | 1274 | } |
1273 | 1275 | ||
1276 | last = NULL; | ||
1274 | engine = request->engine; | 1277 | engine = request->engine; |
1275 | spin_lock_irq(&engine->timeline.lock); | 1278 | spin_lock_irq(&engine->timeline.lock); |
1276 | 1279 | ||
@@ -1287,8 +1290,12 @@ static void execlists_schedule(struct i915_request *request, | |||
1287 | 1290 | ||
1288 | node->attr.priority = prio; | 1291 | node->attr.priority = prio; |
1289 | if (!list_empty(&node->link)) { | 1292 | if (!list_empty(&node->link)) { |
1290 | __list_del_entry(&node->link); | 1293 | if (last != engine) { |
1291 | queue_request(engine, node, prio); | 1294 | pl = lookup_priolist(engine, prio); |
1295 | last = engine; | ||
1296 | } | ||
1297 | GEM_BUG_ON(pl->priority != prio); | ||
1298 | list_move_tail(&node->link, &pl->requests); | ||
1292 | } | 1299 | } |
1293 | 1300 | ||
1294 | if (prio > engine->execlists.queue_priority && | 1301 | if (prio > engine->execlists.queue_priority && |