STRUCT DRM_MASTER(9)
okay so bestie, welcome to struct drm_master(9), fresh out of the Kernel API Manual β this is the whole lore drop on the drm master structure and honestly it ate π
β¨
π NAME π
struct drm_master β the drm master structure, that's the whole name, no cap π«Ά
π¦ SYNOPSIS π¦
struct drm_master {
struct kref refcount;
struct drm_device *dev;
char *unique;
int unique_len;
struct idr magic_map;
void *driver_priv;
struct drm_master *lessor;
int lessee_id;
struct list_head lessee_list;
struct list_head lessees;
struct idr leases;
struct idr lessee_idr;
};
π MEMBERS π
okay so here's the cast of characters, one by one, and every single one of them is important π₯
refcountβ the refcount for this whole master object. it's the thing keeping it alive, bestie.devβ link back to the DRM device. like a little "home" pointer πΈuniqueβ the unique identifier, e.g. busid. protected bydrm_device.master_mutexso don't go touching it without the lock, fr fr.unique_lenβ the length of theuniquefield. also protected bydrm_device.master_mutex. lock gang only πmagic_mapβ the map of used authentication tokens. yep, protected bydrm_device.master_mutextoo, it's giving very consistent.driver_privβ pointer to driver-private information. the driver's own little secrets πlessorβ the lease grantor! this one only gets set if thisstruct drm_masterrepresents a lessee holding a lease of objects from a lessor. full owners of the device have this set toNULLβ main character behaviour, honestly π
the lessor does not change once it's set in drm_lease_create, and each lessee holds a reference to its lessor that it releases upon being destroyed in drm_lease_destroy. so like, the bond is permanent until destruction π
See also the :ref: section on display resource leasing <drm_leasing>.
lessee_idβ the ID for lessees. owners (i.e. wherelessorisNULL) always have ID0, periodt. protected bydrm_device.mode_config'sdrm_mode_config.idr_mutex.lessee_listβ the list entry of lessees of the lessor, where they get linked tolessees. not used for owners, sorry owners. protected bydrm_device.mode_config'sdrm_mode_config.idr_mutex.lesseesβ the list ofdrm_masters leasing from this one. protected bydrm_device.mode_config'sdrm_mode_config.idr_mutex.
this list is empty if no leases have been granted, or if all lessees have been destroyed. and since lessors are referenced by all their lessees, this master literally cannot be destroyed unless the list is empty. no cap, that's a hard requirement π
leasesβ the objects leased to thisdrm_master. protected bydrm_device.mode_config'sdrm_mode_config.idr_mutex.
objects are leased all together in drm_lease_create, and they're removed all together when the lease is revoked. all-or-nothing energy β¨
lessee_idrβ all lessees under this owner (only used wherelessorisNULL). protected bydrm_device.mode_config'sdrm_mode_config.idr_mutex.
π DESCRIPTION π
heads up π«Ά note that master structures are only relevant for the legacy/primary device nodes β so there can only be one per device, not one per drm_minor. iykyk π
π SEE ALSO π
- Kernel file
./include/drm/drm_auth.hβ go read it, bestie π
and that's the whole page, you're so welcome π§ββοΈ this little gem came from the source tree at ./include/drm and it's dated October 2026 β slay, go forth and master your devices πππ¦
π¦ 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