24#ifndef DRM_MODESET_LOCK_H_
25#define DRM_MODESET_LOCK_H_
98#define DRM_MODESET_ACQUIRE_INTERRUPTIBLE BIT(0)
114 WARN_ON(!list_empty(&lock->
head));
123 return ww_mutex_is_locked(&lock->
mutex);
130static inline void drm_modeset_lock_assert_held(
struct drm_modeset_lock *lock)
175#define DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, flags, ret) \
176 if (!drm_drv_uses_atomic_modeset(dev)) \
177 mutex_lock(&dev->mode_config.mutex); \
178 drm_modeset_acquire_init(&ctx, flags); \
180 ret = drm_modeset_lock_all_ctx(dev, &ctx); \
182 goto modeset_lock_fail;
203#define DRM_MODESET_LOCK_ALL_END(dev, ctx, ret) \
205 if (ret == -EDEADLK) { \
206 ret = drm_modeset_backoff(&ctx); \
208 goto modeset_lock_retry; \
210 drm_modeset_drop_locks(&ctx); \
211 drm_modeset_acquire_fini(&ctx); \
212 if (!drm_drv_uses_atomic_modeset(dev)) \
213 mutex_unlock(&dev->mode_config.mutex);
uint8_t flags
Definition virtio.h:0
unsigned int uint32_t
Definition acefiex.h:163
#define __must_check
Definition compiler.h:114
int drm_modeset_backoff(struct drm_modeset_acquire_ctx *ctx)
int __must_check drm_modeset_lock_single_interruptible(struct drm_modeset_lock *lock)
void drm_modeset_acquire_init(struct drm_modeset_acquire_ctx *ctx, uint32_t flags)
void drm_modeset_lock_all(struct drm_device *dev)
void drm_modeset_unlock_all(struct drm_device *dev)
void drm_modeset_lock_init(struct drm_modeset_lock *lock)
void drm_warn_on_modeset_not_all_locked(struct drm_device *dev)
int drm_modeset_lock_all_ctx(struct drm_device *dev, struct drm_modeset_acquire_ctx *ctx)
void drm_modeset_unlock(struct drm_modeset_lock *lock)
void drm_modeset_acquire_fini(struct drm_modeset_acquire_ctx *ctx)
void drm_modeset_drop_locks(struct drm_modeset_acquire_ctx *ctx)
const struct device * dev
Definition drm_print.h:519
int const struct list_head const struct list_head struct list_head * head
Definition list_sort.h:13
#define lockdep_assert_held(l)
Definition lockdep.h:71
u32 depot_stack_handle_t
Definition stackdepot.h:15
Definition drm_crtc.h:955
Definition drm_device.h:75
Definition drm_modeset_lock.h:46
depot_stack_handle_t stack_depot
Definition drm_modeset_lock.h:61
bool trylock_only
Definition drm_modeset_lock.h:71
struct list_head locked
Definition drm_modeset_lock.h:66
struct ww_acquire_ctx ww_ctx
Definition drm_modeset_lock.h:48
struct drm_modeset_lock * contended
Definition drm_modeset_lock.h:55
bool interruptible
Definition drm_modeset_lock.h:74
Definition drm_modeset_lock.h:85
struct list_head head
Definition drm_modeset_lock.h:95
struct ww_mutex mutex
Definition drm_modeset_lock.h:89
Definition drm_plane.h:641