Commit 6e4e9708 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Execute signal callbacks from no-op i915_request_wait

If we enter i915_request_wait() with an already completed request, but
unsignaled dma-fence, signal the fence before returning. This allows us
to execute any of the signal callbacks at the earliest opportunity.

v2: Also signal after busyspin success
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/20190614111053.25615-2-chris@chris-wilson.co.uk
parent a0950768
...@@ -1437,7 +1437,7 @@ long i915_request_wait(struct i915_request *rq, ...@@ -1437,7 +1437,7 @@ long i915_request_wait(struct i915_request *rq,
might_sleep(); might_sleep();
GEM_BUG_ON(timeout < 0); GEM_BUG_ON(timeout < 0);
if (i915_request_completed(rq)) if (dma_fence_is_signaled(&rq->fence))
return timeout; return timeout;
if (!timeout) if (!timeout)
...@@ -1470,8 +1470,10 @@ long i915_request_wait(struct i915_request *rq, ...@@ -1470,8 +1470,10 @@ long i915_request_wait(struct i915_request *rq,
* duration, which we currently lack. * duration, which we currently lack.
*/ */
if (CONFIG_DRM_I915_SPIN_REQUEST && if (CONFIG_DRM_I915_SPIN_REQUEST &&
__i915_spin_request(rq, state, CONFIG_DRM_I915_SPIN_REQUEST)) __i915_spin_request(rq, state, CONFIG_DRM_I915_SPIN_REQUEST)) {
dma_fence_signal(&rq->fence);
goto out; goto out;
}
/* /*
* This client is about to stall waiting for the GPU. In many cases * This client is about to stall waiting for the GPU. In many cases
......
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