drm_dev_alloc(9)
π 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 wholestruct 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_devicein 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:
- 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)
π«Ά 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
- 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