[Intel-gfx] [PATCH 10/12] drm/i915: Annotate dma_fence waits
Daniel Vetter
daniel.vetter at ffwll.ch
Fri Nov 2 09:15:29 UTC 2018
i915_request_wait is simply our i915-optimized version of
dma_fence_wait. They both use the exact same code. To help lockdep
discovering all the dependencies, annotate it.
Cc: Jani Nikula <jani.nikula at linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: intel-gfx at lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
drivers/gpu/drm/i915/i915_request.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 71107540581d..6b9722782d12 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -30,6 +30,10 @@
#include "i915_drv.h"
+static long __i915_request_wait(struct i915_request *rq,
+ unsigned int flags,
+ long timeout);
+
static const char *i915_fence_get_driver_name(struct dma_fence *fence)
{
return "i915";
@@ -66,7 +70,7 @@ static signed long i915_fence_wait(struct dma_fence *fence,
bool interruptible,
signed long timeout)
{
- return i915_request_wait(to_request(fence), interruptible, timeout);
+ return __i915_request_wait(to_request(fence), interruptible, timeout);
}
static void i915_fence_release(struct dma_fence *fence)
@@ -1201,6 +1205,19 @@ static bool __i915_wait_request_check_and_reset(struct i915_request *request)
long i915_request_wait(struct i915_request *rq,
unsigned int flags,
long timeout)
+{
+ long ret;
+
+ dma_fence_wait_acquire();
+ ret = __i915_request_wait(rq, flags, timeout);
+ dma_fence_wait_release();
+
+ return ret;
+}
+
+static long __i915_request_wait(struct i915_request *rq,
+ unsigned int flags,
+ long timeout)
{
const int state = flags & I915_WAIT_INTERRUPTIBLE ?
TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE;
--
2.19.1
More information about the Intel-gfx
mailing list