drmm_mutex_init(9)
π drmm_mutex_init(9) β the kernel API manual, bestie edition
okay so first things first, the manual is literally called drmm_mutex_init(9) and it lives in the Kernel API Manual β yes we're in kernel land today, put your hair up π
β¨ NAME β¨
drmm_mutex_init β the &drm_device-managed version of mutex_init(), no cap π¦
πΈ SYNOPSIS πΈ
drmm_mutex_init (dev , lock );
like, that's the whole call. yes the spacing is quirky, that's just how it is, don't come for her π
π ARGUMENTS π
devβ your DRM device. the main character here πlockβ the lock you want to be initialized. she's getting set up β¨
π RETURN π
Returns 0 on success β slay β or a negative errno code otherwise π so pls actually check it, bestie.
π DESCRIPTION π
So here's the tea: this is a drm_device-managed version of mutex_init. That's it, that's the vibe.
The way that it works is the initialized lock gets automatically destroyed on the final drm_dev_put β so you don't have to manually clean her up, the device handles it for you. it's giving responsible adult energy, honestly π«Ά
π₯ SEE ALSO π₯
- Kernel file
./include/drm/drm_managed.h drmm_add_action(9)drmm_add_action_or_reset(9)drmm_kzalloc(9)drmm_kmalloc_array(9)drmm_kcalloc(9)drmm_alloc_ordered_workqueue(9)
go read those next, iykyk πβ¨
okay that's the whole page, go be iconic with your managed mutexes π
sign-off vibes: this one came from ./include/drm, dated October 2026, and it's still literally drmm_mutex_init(9) β 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