aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_active_types.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-08-16 13:10:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-08-16 18:02:07 +0100
commit25ffd4b11d069300f018f7b04c3c6b8814a128d6 (patch)
tree89d886ba3888822c63fd7b6581cdfb7e9461f89b /drivers/gpu/drm/i915/i915_active_types.h
parentdrm/i915/gt: Mark context->active_count as protected by timeline->mutex (diff)
downloadlinux-dev-25ffd4b11d069300f018f7b04c3c6b8814a128d6.tar.xz
linux-dev-25ffd4b11d069300f018f7b04c3c6b8814a128d6.zip
drm/i915: Markup expected timeline locks for i915_active
As every i915_active_request should be serialised by a dedicated lock, i915_active consists of a tree of locks; one for each node. Markup up the i915_active_request with what lock is supposed to be guarding it so that we can verify that the serialised updated are indeed serialised. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190816121000.8507-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_active_types.h')
-rw-r--r--drivers/gpu/drm/i915/i915_active_types.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_active_types.h b/drivers/gpu/drm/i915/i915_active_types.h
index ae3ee441c114..1854e7d168c1 100644
--- a/drivers/gpu/drm/i915/i915_active_types.h
+++ b/drivers/gpu/drm/i915/i915_active_types.h
@@ -24,6 +24,21 @@ struct i915_active_request {
struct i915_request __rcu *request;
struct list_head link;
i915_active_retire_fn retire;
+#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)
+ /*
+ * Incorporeal!
+ *
+ * Updates to the i915_active_request must be serialised under a lock
+ * to ensure that the timeline is ordered. Normally, this is the
+ * timeline->mutex, but another mutex may be used so long as it is
+ * done so consistently.
+ *
+ * For lockdep tracking of the above, we store the lock we intend
+ * to always use for updates of this i915_active_request during
+ * construction and assert that is held on every update.
+ */
+ struct mutex *lock;
+#endif
};
struct active_node;