drm_dev_set_dma_dev(9)
β¨ drm_dev_set_dma_dev(9) β¨
okay so this is a page from the Kernel API Manual β yes, that Kernel API Manual, the big serious one β and it's about one tiny little function that does one tiny little thing. but bestie, that tiny little thing MATTERS, so let's get into it π«Ά
πΈ NAME πΈ
drm_dev_set_dma_dev β literally just: set the DMA device for a DRM device. that's the whole vibe check. π
π SYNOPSIS π
void drm_dev_set_dma_dev (struct drm_device *dev , struct device
*dma_dev );
two pointers in, nothing out. void return, she doesn't report back, she just does it. main character energy fr fr π
π¦ ARGUMENTS π¦
devβ the DRM device. the one you're setting the DMA device on. she's the subject of the sentence πdma_devβ the DMA device, orNULL. that's right,NULLis a valid value here, not a mistake, hold that thought π
π DESCRIPTION π
So what does it actually do? It sets the DMA device of the given DRM device. simple. iconic. no notes. β¨
But β and this is the part where you lean in β this is only required if the DMA device is different from the DRM device's parent. if the DMA device is already the parent, you don't need this function at all. don't be out here calling it for fun, it's not a personality trait π
The important detail tho: after you call this function, the DRM device holds a reference on dma_dev. like, it's committed now. keeping it alive. that's a real reference, so treat it with respect π
And if you wanna undo it, or you never actually needed it? Pass NULL to clear the DMA device. that's the escape hatch, bestie, and it's right there in the arguments section. NULL is doing double duty as both "no DMA device" and "never mind, cancel that". multi-talented π
π SEE ALSO π
the whole friend group, assembled. go read these, iykyk:
- 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_wedged_event(9)component helper usage recommendations(9)__drm_dev_alloc(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)
not me listing fifteen cross-references and still having zero thoughts about the cgroup one. go look it up, she's in there for a reason π
that's the whole page, bestie. go set some DMA devices (only when the parent isn't already it, remember the rule, i'm begging) and slay π
signed off from ./drivers/gpu/drm, dated October 2026 β yes, the future, we're being that ahead of schedule β¨ππ¦
π¦ 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