]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Check signaled state after enabling signaling
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 8 Jun 2017 11:14:02 +0000 (12:14 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 8 Jun 2017 11:33:08 +0000 (12:33 +0100)
Setting up the irq to signal the request completion takes a finite
amount of time, during which it is possible that the request already
completed. Check afterwards, just in case, so that we can respond
immediately.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170608111405.16466-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_request.c

index 0d1e0d8873ef61f143609f8b19161cd921caa4d5..46d869e26b4d9f8d26f95519e38c12ffe1478dec 100644 (file)
@@ -62,7 +62,7 @@ static bool i915_fence_enable_signaling(struct dma_fence *fence)
                return false;
 
        intel_engine_enable_signaling(to_request(fence), true);
-       return true;
+       return !i915_fence_signaled(fence);
 }
 
 static signed long i915_fence_wait(struct dma_fence *fence,