drm/i915: Add ourselves to the gpu error waitqueue for the entire wait

Add ourselves to the gpu error waitqueue earlier on, even before we
determine we have to wait on the seqno. This is so that we can then
share the waitqueue between stages in subsequent patches.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170223074422.4125-6-chris@chris-wilson.co.uk
This commit is contained in:
Chris Wilson 2017-02-23 07:44:11 +00:00
parent 4b36b2e506
commit 7de53bf7e6
1 changed files with 5 additions and 5 deletions

View File

@ -1097,6 +1097,9 @@ long i915_wait_request(struct drm_i915_gem_request *req,
trace_i915_gem_request_wait_begin(req, flags); trace_i915_gem_request_wait_begin(req, flags);
if (flags & I915_WAIT_LOCKED)
add_wait_queue(errq, &reset);
if (!i915_sw_fence_done(&req->execute)) { if (!i915_sw_fence_done(&req->execute)) {
timeout = __i915_request_wait_for_execute(req, flags, timeout); timeout = __i915_request_wait_for_execute(req, flags, timeout);
if (timeout < 0) if (timeout < 0)
@ -1112,9 +1115,6 @@ long i915_wait_request(struct drm_i915_gem_request *req,
goto complete; goto complete;
set_current_state(state); set_current_state(state);
if (flags & I915_WAIT_LOCKED)
add_wait_queue(errq, &reset);
intel_wait_init(&wait, req->global_seqno); intel_wait_init(&wait, req->global_seqno);
if (intel_engine_add_wait(req->engine, &wait)) if (intel_engine_add_wait(req->engine, &wait))
/* In order to check that we haven't missed the interrupt /* In order to check that we haven't missed the interrupt
@ -1174,11 +1174,11 @@ wakeup:
} }
intel_engine_remove_wait(req->engine, &wait); intel_engine_remove_wait(req->engine, &wait);
if (flags & I915_WAIT_LOCKED)
remove_wait_queue(errq, &reset);
__set_current_state(TASK_RUNNING); __set_current_state(TASK_RUNNING);
complete: complete:
if (flags & I915_WAIT_LOCKED)
remove_wait_queue(errq, &reset);
trace_i915_gem_request_wait_end(req); trace_i915_gem_request_wait_end(req);
return timeout; return timeout;