Commit c8a0e2ae authored by Chris Wilson's avatar Chris Wilson

drm/i915: Acquire the signaler's timeline HWSP last

Acquiring the signaler's timeline takes an active reference to their
HWSP that we would like to avoid if possible, so take it after
performing all of our allocations required to set up the fencing. The
acquisition also provides the final check that the target has not
already signaled allowing us to avoid the semaphore at the last moment.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190503140239.32668-1-chris@chris-wilson.co.uk
parent 46034d2b
...@@ -851,13 +851,13 @@ emit_semaphore_wait(struct i915_request *to, ...@@ -851,13 +851,13 @@ emit_semaphore_wait(struct i915_request *to,
if (err < 0) if (err < 0)
return err; return err;
/* We need to pin the signaler's HWSP until we are finished reading. */ /* Only submit our spinner after the signaler is running! */
err = i915_timeline_read_hwsp(from, to, &hwsp_offset); err = i915_request_await_execution(to, from, gfp);
if (err) if (err)
return err; return err;
/* Only submit our spinner after the signaler is running! */ /* We need to pin the signaler's HWSP until we are finished reading. */
err = i915_request_await_execution(to, from, gfp); err = i915_timeline_read_hwsp(from, to, &hwsp_offset);
if (err) if (err)
return err; return err;
......
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