drm_modeset_lock_all_ctx(9)
π drm_modeset_lock_all_ctx(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β this is the page for drm_modeset_lock_all_ctx, and honestly? it's giving "grab everything at once" energy and I'm lowkey obsessed π«Ά
πΈ NAME πΈ
drm_modeset_lock_all_ctx β take all modeset locks π (yes, all of them. every single one. main character behaviour fr fr)
β¨ SYNOPSIS β¨
int drm_modeset_lock_all_ctx (struct drm_device *dev , struct
drm_modeset_acquire_ctx *ctx );
that's the whole vibe. two args, one int back, no cap π
π¦ ARGUMENTS π¦
devβ the DRM device π» like, the thing you're doing all this forctxβ the lock acquisition context ποΈ this is where the locks get tracked, it's literally the whole point
π₯ DESCRIPTION π₯
so what does it do? it takes all modeset locks. every last one. and it's the move when a more fine-grained scheme isn't (yet) implemented β like, someone's gonna do the fancy version eventually but right now we're doing the big sweep π§Ήβ¨ and that's valid
β οΈ but hear me out β this is NOT the same as drm_modeset_lock_all π
unlike drm_modeset_lock_all, this function doesn't take the drm_mode_config.mutex, because that lock isn't required for modeset state changes. so if you're a caller who also needs to grab that lock, you gotta do it outside of the acquire context ctx β like, do it yourself, on your own time, not inside the context π«Ά
and the aftercare? crucial bestie π
locks acquired with this function should be released by calling the drm_modeset_drop_locks function on ctx. don't just leave them hanging, that's so not the vibe π
see also: DRM_MODESET_LOCK_ALL_BEGIN and DRM_MODESET_LOCK_ALL_END β those macros are the sibling energy, iykyk π
β RETURN β
0on success π slay- a negative error-code on failure π (negative = not the good outcome, in case the sign didn't tip you off)
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/drm_modeset_lock.cπ (this is where the magic lives) kms locking(9)drm_modeset_lock_all(9)drm_modeset_unlock_all(9)drm_warn_on_modeset_not_all_locked(9)drm_modeset_acquire_init(9)drm_modeset_acquire_fini(9)drm_modeset_drop_locks(9)drm_modeset_backoff(9)drm_modeset_lock_init(9)drm_modeset_lock(9)drm_modeset_lock_single_interruptible(9)drm_modeset_unlock(9)
like, go read them all, they're literally a whole friend group at this point ππ
and that's the page!! π brought to you from ./drivers/gpu/drm, dated October 2026 β go forth and lock responsibly, bestie, and remember: drop your locks before you leave π¦β¨ periodt
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms