drm_gem_dma_..._with_handle(9)
π drm_gem_dma_create_with_handle β Kernel API Manual β¨
okay bestie, welcome to the drm_gem_dma_..._with_handle(9) page (yes the title got shortened with ... and no we will not be discussing it, it's giving mysterious). this is the Kernel API Manual and today we're learning how GEM objects get born and handed a little name tag π
πΈ NAME πΈ
drm_gem_dma_create_with_handle β allocate an object with the given size and return a GEM handle to it. that's it, that's the whole vibe. allocate, register, hand back a handle. iconic behavior honestly π
β¨ SYNOPSIS β¨
struct drm_gem_dma_object * drm_gem_dma_create_with_handle (struct
drm_file *file_priv , struct drm_device *drm , size_t size , uint32_t
*handle );
like, structure-wise: it hands you back a struct drm_gem_dma_object *, and it takes four things. we'll go through them one by one, don't worry π«Ά
π¦ ARGUMENTS π¦
file_privβ the DRM file-private structure you're registering the handle for. it's the "whose name tag is this" of it all πdrmβ the DRM device. the main character, the whole device, the icon πsizeβ size of the object to allocate. how much memory we're claiming, fr fr πhandleβ return location for the GEM handle. this is where the shiny new handle gets dropped off for you π
π DESCRIPTION π
so what does this thing actually do? it creates a DMA GEM object, allocating a chunk of memory as backing store. literally building the whole thing from scratch, no cap β¨
then β and this is the slay part β the GEM object gets added to the list of objects associated with the given file, and a handle to it is returned. it's registered, it's official, it's in the group chat now π
and listen: the allocated memory will occupy a contiguous chunk of bus address space. contiguous. one chunk. no gaps. that's the whole point bestie π₯
for more details, go see drm_gem_dma_create. it's got the lore iykyk π
β RETURN β
on success you get a struct drm_gem_dma_object * β yay π
on failure you get a ERR_PTR-encoded negative error code. so like, it's still a pointer, but it's a pointer that's screaming an error at you through encoding. check it, bestie, always check it π
π SEE ALSO π
Kernel file ./drivers/gpu/drm/drm_gem_dma_helper.c β that's the home base π
and the whole friend group:
dma helpers(9)__drm_gem_dma_create(9)drm_gem_dma_create(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 page!! π«Ά this whole thing lives under./drivers/gpu/drm, dated October 2026, and the page itself isdrm_gem_dma_..._with_handle(9)β go off, kernel docs, you ate π πβ¨
π¦ 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