STRUCT DRM_MODESET_ACQUIRE_CTX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct drm_modeset_acquire_ctx(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual β€” yes we're in the kernel manual, yes it's giving big-brain energy, and yes this page is literally about a struct. Stay with me, it's actually cute πŸ¦‹

✨ NAME ✨

struct drm_modeset_acquire_ctx β€” the locking context (see ww_acquire_ctx) πŸ’–


🌸 SYNOPSIS 🌸

struct drm_modeset_acquire_ctx {
    struct ww_acquire_ctx ww_ctx;
    struct drm_modeset_lock *contended;
    depot_stack_handle_t stack_depot;
    struct list_head locked;
    bool trylock_only;
    bool interruptible;
};

🧚 MEMBERS 🧚

  • ww_ctx β€” the base acquire ctx, the main character of the whole struct ngl πŸ‘‘
  • contended β€” used internally for -EDEADLK handling, like the little drama manager behind the scenes πŸ’€
  • stack_depot β€” used internally for contention debugging, so when things get messy there's receipts 🫢
  • locked β€” a list_head of the held locks, i.e. the guest list of everything currently locked in πŸ“‹βœ¨
  • trylock_only β€” trylock mode, used in atomic contexts and panic notifiers, so basically the "no waiting around, we're in a crisis" mode 😭πŸ”₯
  • interruptible β€” whether interruptible locking should be used, like, can we bail or not πŸ™ˆ

πŸŽ€ DESCRIPTION πŸŽ€

So here's the vibe: every thread that's competing for a set of locks has to use one acquire ctx. One. Per thread. No sharing, no cap. πŸ’…

And if any lock fxn returns -EDEADLK, it must back off and retry β€” like babe, don't fight the deadlock, just step back and try again πŸ”βœ¨

lowkey important: this isn't optional behaviour, it's the rule fr fr 🫑

⭐ SEE ALSO ⭐

Kernel file ./include/drm/drm_modeset_lock.h struct drm_modeset_lock(9), drm_modeset_lock_fini(9), drm_modeset_is_locked(9), drm_modeset_lock_assert_held(9), DRM_MODESET_LOCK_ALL_BEGIN(9), DRM_MODESET_LOCK_ALL_END(9) β€” go read those too, iykyk πŸ’–


and that's the whole page bestie πŸŽ‰ sourced straight from ./include/drm, dated October 2026, and yes we slayed the entire acquire ctx πŸ˜ŒπŸ’… periodt 🌈⭐

πŸ“¦ where this page comes from