drm_gem_dma_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 drm_gem_dma_create(9) β€” Kernel API Manual 🌸

Okay bestie, so this one is from the Kernel API Manual and it's called drm_gem_dma_create β€” and before you ask, yes, it's giving literally "allocate an object with the given size". No cap. πŸ’…


✨ SYNOPSIS ✨

struct drm_gem_dma_object * drm_gem_dma_create (struct drm_device *drm ,
size_t size );

That's the whole vibe β€” one function, two arguments, and it's gonna hand you back a pointer. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • drm β€” the DRM device. Like, the actual hardware situation you're working with. πŸ–₯️
  • size β€” the size of the object you wanna allocate. Yes, in bytes, and yes, you gotta tell it. πŸ“

πŸ’– DESCRIPTION πŸ’–

So what does it do? It creates a DMA GEM object and allocates memory as the backing store. The allocated memory is gonna occupy a contiguous chunk of bus address space β€” that's the whole point, bestie. πŸ”₯

Now, here's the tea on contiguity (and this part is important, so don't scroll past it):

  • For devices that are directly connected to the memory bus, the allocated memory will be physically contiguous. Like, actually contiguous in physical memory. Slay. ✨
  • For devices that access through an IOMMU, the allocated memory is not expected to be physically contiguous β€” because having contiguous IOVAs is sufficient to meet a device's DMA requirements. So it's fine, it's still valid, it's just not physically contiguous. No big deal. πŸ’…
Lowkey, this distinction matters if you're debugging memory stuff, so keep it in mind, okay? 🧚

πŸ‘‘ RETURN πŸ‘‘

On success, you get a struct drm_gem_dma_object *. On failure, you get an ERR_PTR-encoded negative error code β€” so check that pointer, bestie, because it might be an error in disguise. 😭


🌈 SEE ALSO 🌈

Here's the whole friend group β€” every single one of these is in the kernel file ./drivers/gpu/drm/drm_gem_dma_helper.c, and they're all linked from here:


And that's the whole page, bestie. This icon was dropped from ./drivers/gpu/drm in October 2026 β€” so you know it's fresh, it's official, and it's ready for you to use. Periodt. πŸ’œπŸŽ€

πŸ“¦ where this page comes from