X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Fdrm%2Fdrm_modeset_lock.h;h=75a5c45e21c72f2ca34da9f9ccb4d7e2908bd7e3;hb=a9e2e4733cb6457aa6cbae4489b68ff0684848af;hp=402aa7a6a058dc68e3923d1ee2ad7296800d3d69;hpb=5235cd21212ca3701b678d7e93682999a772c995;p=karo-tx-linux.git diff --git a/include/drm/drm_modeset_lock.h b/include/drm/drm_modeset_lock.h index 402aa7a6a058..75a5c45e21c7 100644 --- a/include/drm/drm_modeset_lock.h +++ b/include/drm/drm_modeset_lock.h @@ -29,7 +29,7 @@ struct drm_modeset_lock; /** - * drm_modeset_acquire_ctx - locking context (see ww_acquire_ctx) + * struct drm_modeset_acquire_ctx - locking context (see ww_acquire_ctx) * @ww_ctx: base acquire ctx * @contended: used internally for -EDEADLK handling * @locked: list of held locks @@ -53,10 +53,15 @@ struct drm_modeset_acquire_ctx { * list of held locks (drm_modeset_lock) */ struct list_head locked; + + /** + * Trylock mode, use only for panic handlers! + */ + bool trylock_only; }; /** - * drm_modeset_lock - used for locking modeset resources. + * struct drm_modeset_lock - used for locking modeset resources. * @mutex: resource locking * @head: used to hold it's place on state->locked list when * part of an atomic update @@ -120,6 +125,17 @@ int drm_modeset_lock_interruptible(struct drm_modeset_lock *lock, void drm_modeset_unlock(struct drm_modeset_lock *lock); struct drm_device; +struct drm_crtc; + +void drm_modeset_lock_all(struct drm_device *dev); +int __drm_modeset_lock_all(struct drm_device *dev, bool trylock); +void drm_modeset_unlock_all(struct drm_device *dev); +void drm_modeset_lock_crtc(struct drm_crtc *crtc); +void drm_modeset_unlock_crtc(struct drm_crtc *crtc); +void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); +struct drm_modeset_acquire_ctx * +drm_modeset_legacy_acquire_ctx(struct drm_crtc *crtc); + int drm_modeset_lock_all_crtcs(struct drm_device *dev, struct drm_modeset_acquire_ctx *ctx);