drm_dev_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ drm_dev_alloc(9) β€” the Kernel API Manual, bestie edition

Okay so real talk, we're in the kernel API manual, section 9, and today's main character is drm_dev_alloc. Buckle up. πŸŽ€


✨ NAME ✨

drm_dev_alloc β€” allocate a brand new DRM device, no cap


🌸 SYNOPSIS 🌸

struct drm_device * drm_dev_alloc (const struct drm_driver *driver ,
struct device *parent );

Like, that's the whole signature. Two args. We love a low-effort call. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • driver β€” the DRM driver you're allocating the device for. It's giving "who is this device's parent-figure," honestly.
  • parent β€” the parent device object. Yep, the whole struct device * situation.

πŸ”₯ DESCRIPTION πŸ”₯

Okay so listen. This is the deprecated version of devm_drm_dev_alloc. Not me, the manpage said it. 😭

And lowkey there are two big things it doesn't do:

  • it does not support subclassing through embedding the struct drm_device in a driver private structure β€” so no cute "my struct contains your struct" situation
  • it does not support automatic cleanup through devres β€” so no free cleanup, you're on your own for teardown, periodt
bestie please note: deprecated means deprecated. It's not quirky, it's just old. Reach for devm_drm_dev_alloc if you can. πŸ’€

⭐ RETURN ⭐

You get a pointer to the shiny new DRM device. Or β€” and this is the important bit β€” ERR_PTR on failure. So yeah, check that thing with IS_ERR(), iykyk. πŸ™ˆ


🌈 SEE ALSO 🌈

The kernel file ./drivers/gpu/drm/drm_drv.c is out here doing the actual work, and these lovely icons are all in the group chat:


🫢 That's the whole vibe. This page lives over in ./drivers/gpu/drm, stamped October 2026 β€” so like, stay safe out there, allocate responsibly, and remember: deprecated is not a personality trait. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from