aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_timeline.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_timeline.h')
-rw-r--r--drivers/gpu/drm/i915/i915_timeline.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_timeline.h b/drivers/gpu/drm/i915/i915_timeline.h
index a2c2c3ab5fb0..ebd71b487220 100644
--- a/drivers/gpu/drm/i915/i915_timeline.h
+++ b/drivers/gpu/drm/i915/i915_timeline.h
@@ -83,6 +83,25 @@ void i915_timeline_init(struct drm_i915_private *i915,
83 const char *name); 83 const char *name);
84void i915_timeline_fini(struct i915_timeline *tl); 84void i915_timeline_fini(struct i915_timeline *tl);
85 85
86static inline void
87i915_timeline_set_subclass(struct i915_timeline *timeline,
88 unsigned int subclass)
89{
90 lockdep_set_subclass(&timeline->lock, subclass);
91
92 /*
93 * Due to an interesting quirk in lockdep's internal debug tracking,
94 * after setting a subclass we must ensure the lock is used. Otherwise,
95 * nr_unused_locks is incremented once too often.
96 */
97#ifdef CONFIG_DEBUG_LOCK_ALLOC
98 local_irq_disable();
99 lock_map_acquire(&timeline->lock.dep_map);
100 lock_map_release(&timeline->lock.dep_map);
101 local_irq_enable();
102#endif
103}
104
86struct i915_timeline * 105struct i915_timeline *
87i915_timeline_create(struct drm_i915_private *i915, const char *name); 106i915_timeline_create(struct drm_i915_private *i915, const char *name);
88 107