__drm_dev_alloc(9)
π
__drm_dev_alloc β a kernel API manual moment
okay so bestie, welcome to the __drm_dev_alloc(9) page, straight out of the Kernel API Manual. no cap, this one's niche but it's iconic niche. grab a matcha, we're doing pointer allocation lore π
β¨ NAME β¨
__drm_dev_alloc β the allocation of a &drm_device instance, aka bringing a whole DRM device into existence π«
πΈ SYNOPSIS πΈ
void * __drm_dev_alloc (struct device *parent , const struct drm_driver
*driver , size_t size , size_t offset );
like, four arguments, one pointer out. she's efficient π
π ARGUMENTS π
parentβ the parent device object π«Ά the literal mother figure heredriverβ the DRM driver. the main character, fr fr πsizeβ the size of the struct that containsstruct drm_device. yes, the container, not the device itself, keep up bestie π§offsetβ the offset of thedrm_devicewithin that container. it's giving "where's the device hiding inside the bigger struct" energy π
π¦ DESCRIPTION π¦
so here's the tea, and this part is loud: this should *NOT* be used by any drivers. like, at all. not even a little. it's a dedicated interface made specifically for the corresponding Rust abstraction β¨ so unless you're that, step away from the function π
behavior-wise, it's the same as devm_drm_dev_alloc, but without the corresponding resource management through the parent device. so you don't get the cute auto-cleanup, you get the raw version π«
and it is not the same as drm_dev_alloc β because that one is the deprecated version, and it does not support subclassing. deprecated era, we don't stan π
π RETURN π
a pointer to the new DRM device π ... or an ERR_PTR on failure π (check it, bestie, always check it)
β SEE ALSO β
the whole friend group, one big group chat:
- the Kernel file
./drivers/gpu/drm/drm_drv.c - driver instance overview(9)
drm_put_dev(9)drm_dev_enter(9)drm_dev_exit(9)drm_dev_unplug(9)drm_dev_set_dma_dev(9)drm_dev_wedged_event(9)- component helper usage recommendations(9)
drm_dev_alloc(9)drm_dev_get(9)drm_dev_put(9)drmm_cgroup_register_region(9)drm_dev_register(9)drm_dev_unregister(9)
ngl, lowkey the vibe check here is: not for drivers, made for the Rust abstraction, no devm resource management, and definitely not the deprecated drm_dev_alloc. iykyk π§ββοΈ
and that's the page, bestie!! this little gem lives in ./drivers/gpu/drm and the version stamp is from October 2026 β slay, see you in the next manpage πππ₯
π¦ 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