drm/i915: Push the use-semaphore marker onto the intel_context

Instead of rummaging through the intel_context to peek at the GEM
context in the middle of request submission to decide whether to use
semaphores, store that information on the intel_context itself.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Andi Shyti <andi.shyti@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191220101230.256839-2-chris@chris-wilson.co.uk
This commit is contained in:
Chris Wilson
2019-12-20 10:12:30 +00:00
parent 9f3ccd40ac
commit 0f100b7048
5 changed files with 64 additions and 25 deletions

View File

@@ -917,18 +917,16 @@ i915_request_await_request(struct i915_request *to, struct i915_request *from)
return ret;
}
if (to->engine == from->engine) {
if (to->engine == from->engine)
ret = i915_sw_fence_await_sw_fence_gfp(&to->submit,
&from->submit,
I915_FENCE_GFP);
} else if (intel_engine_has_semaphores(to->engine) &&
to->context->gem_context->sched.priority >= I915_PRIORITY_NORMAL) {
else if (intel_context_use_semaphores(to->context))
ret = emit_semaphore_wait(to, from, I915_FENCE_GFP);
} else {
else
ret = i915_sw_fence_await_dma_fence(&to->submit,
&from->fence, 0,
I915_FENCE_GFP);
}
if (ret < 0)
return ret;