summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_request.h
diff options
context:
space:
mode:
authorChris Wilson2016-09-09 15:11:50 +0200
committerChris Wilson2016-09-09 15:23:03 +0200
commit22dd3bb9190566c7c3b80edb7dea67d1e21d0f91 (patch)
tree01898a53077a19a7c4608716a7c638924bc0992b /drivers/gpu/drm/i915/i915_gem_request.h
parentdrm/i915: Expand bool interruptible to pass flags to i915_wait_request() (diff)
downloadkernel-qcow2-linux-22dd3bb9190566c7c3b80edb7dea67d1e21d0f91.tar.gz
kernel-qcow2-linux-22dd3bb9190566c7c3b80edb7dea67d1e21d0f91.tar.xz
kernel-qcow2-linux-22dd3bb9190566c7c3b80edb7dea67d1e21d0f91.zip
drm/i915: Mark up all locked waiters
In the next patch we want to handle reset directly by a locked waiter in order to avoid issues with returning before the reset is handled. To handle the reset, we must first know whether we hold the struct_mutex. If we do not hold the struct_mtuex we can not perform the reset, but we do not block the reset worker either (and so we can just continue to wait for request completion) - otherwise we must relinquish the mutex. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-10-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_request.h')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_request.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.h b/drivers/gpu/drm/i915/i915_gem_request.h
index 479896ef791e..def35721e9ed 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.h
+++ b/drivers/gpu/drm/i915/i915_gem_request.h
@@ -222,7 +222,8 @@ int i915_wait_request(struct drm_i915_gem_request *req,
s64 *timeout,
struct intel_rps_client *rps)
__attribute__((nonnull(1)));
-#define I915_WAIT_INTERRUPTIBLE BIT(0)
+#define I915_WAIT_INTERRUPTIBLE BIT(0)
+#define I915_WAIT_LOCKED BIT(1) /* struct_mutex held, handle GPU reset */
static inline u32 intel_engine_get_seqno(struct intel_engine_cs *engine);
@@ -576,7 +577,9 @@ i915_gem_active_wait(const struct i915_gem_active *active, struct mutex *mutex)
if (!request)
return 0;
- return i915_wait_request(request, I915_WAIT_INTERRUPTIBLE, NULL, NULL);
+ return i915_wait_request(request,
+ I915_WAIT_INTERRUPTIBLE | I915_WAIT_LOCKED,
+ NULL, NULL);
}
/**
@@ -639,7 +642,9 @@ i915_gem_active_retire(struct i915_gem_active *active,
if (!request)
return 0;
- ret = i915_wait_request(request, I915_WAIT_INTERRUPTIBLE, NULL, NULL);
+ ret = i915_wait_request(request,
+ I915_WAIT_INTERRUPTIBLE | I915_WAIT_LOCKED,
+ NULL, NULL);
if (ret)
return ret;