drm_gem_dma_create(9)
πΈ 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:
dma helpers(9)__drm_gem_dma_create(9)drm_gem_dma_create_with_handle(9)drm_gem_dma_free(9)drm_gem_dma_dumb_create_internal(9)drm_gem_dma_dumb_create(9)drm_gem_dma_get_unmapped_area(9)drm_gem_dma_print_info(9)drm_gem_dma_get_sg_table(9)drm_gem_dma_prime_import_sg_table(9)drm_gem_dma_vmap(9)drm_gem_dma_mmap(9)drm_gem_dma_prime_import_sg_table_vmap(9)
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
- 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