Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Add drm_modeset_lock_assert_held()

Add a small wrapper around lockdep_assert_held() to make
it a bit more conventinet to use with modeset locks.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190708125325.16576-2-ville.syrjala@linux.intel.com
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>

+9
+9
include/drm/drm_modeset_lock.h
··· 114 114 return ww_mutex_is_locked(&lock->mutex); 115 115 } 116 116 117 + /** 118 + * drm_modeset_lock_assert_held - equivalent to lockdep_assert_held() 119 + * @lock: lock to check 120 + */ 121 + static inline void drm_modeset_lock_assert_held(struct drm_modeset_lock *lock) 122 + { 123 + lockdep_assert_held(&lock->mutex.base); 124 + } 125 + 117 126 int drm_modeset_lock(struct drm_modeset_lock *lock, 118 127 struct drm_modeset_acquire_ctx *ctx); 119 128 int __must_check drm_modeset_lock_single_interruptible(struct drm_modeset_lock *lock);