summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_context.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-04-29 12:07:35 +0300
committerChris Wilson <chris@chris-wilson.co.uk>2019-04-29 13:12:37 +0300
commit62c8e423450d7140a640651227ec563d6b0141ce (patch)
treea40f24f50fb15029ecd1402e08b139188c46c80c /drivers/gpu/drm/i915/i915_gem_context.c
parent46472b3efb61b033f9b4807a178434c50f31d5c5 (diff)
downloadlinux-62c8e423450d7140a640651227ec563d6b0141ce.tar.xz
drm/i915: Skip unused contexts for context_barrier_task()
If the context has not been used yet, it needs no barrier, and in the process fix up the selftest in mock_contexts. Testcase: igt/gem_ctx_clone/vm Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190429090735.326-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_context.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_context.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 939c17070780..65cefc520e79 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -924,15 +924,15 @@ static int context_barrier_task(struct i915_gem_context *ctx,
for_each_gem_engine(ce, i915_gem_context_lock_engines(ctx), it) {
struct i915_request *rq;
- if (!(ce->engine->mask & engines))
- continue;
-
if (I915_SELFTEST_ONLY(context_barrier_inject_fault &
ce->engine->mask)) {
err = -ENXIO;
break;
}
+ if (!(ce->engine->mask & engines) || !ce->state)
+ continue;
+
rq = intel_context_create_request(ce);
if (IS_ERR(rq)) {
err = PTR_ERR(rq);