]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Execute signal callbacks from no-op i915_request_wait
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 14 Jun 2019 11:10:53 +0000 (12:10 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 14 Jun 2019 11:16:32 +0000 (12:16 +0100)
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: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190614111053.25615-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_request.c

index 1cbc3ef4fc27b36015347bb1f9df246d30749940..5ee1ef92a9d92d4938f90de815ad78e3a6de665d 100644 (file)
@@ -1437,7 +1437,7 @@ long i915_request_wait(struct i915_request *rq,
        might_sleep();
        GEM_BUG_ON(timeout < 0);
 
-       if (i915_request_completed(rq))
+       if (dma_fence_is_signaled(&rq->fence))
                return timeout;
 
        if (!timeout)
@@ -1470,8 +1470,10 @@ long i915_request_wait(struct i915_request *rq,
         * duration, which we currently lack.
         */
        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;
+       }
 
        /*
         * This client is about to stall waiting for the GPU. In many cases