drm_dev_set_dma_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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, or NULL. that's right, NULL is 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:

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