__drm_dev_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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 here
  • driver β€” the DRM driver. the main character, fr fr πŸ‘‘
  • size β€” the size of the struct that contains struct drm_device. yes, the container, not the device itself, keep up bestie 🧚
  • offset β€” the offset of the drm_device within 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:


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