__drm_gem_dma_create(9)
π __drm_gem_dma_create β Kernel API Manual realness π
okay so bestie, buckle up, we're in the Kernel API Manual and this page is literally about __drm_gem_dma_create(9). yes the double-underscore one. she's the β¨internalβ¨ sister, iykyk π
πΈ NAME πΈ
__drm_gem_dma_create β create a GEM DMA object without allocating memory π«Ά
like... she makes the object but leaves the actual memory part for later. no cap, that's the whole vibe π
β¨ SYNOPSIS β¨
struct drm_gem_dma_object * __drm_gem_dma_create (struct drm_device *drm
, size_t size , bool private );
three args, boo. drm, size, private. copy it exactly, don't @ me π
π¦ ARGUMENTS π¦
drmβ the DRM device π₯οΈ literally the thing we're building on top ofsizeβ size of the object to allocate π the number, the whole pointprivateβtrueif it's used for internal purposes π so like, it's giving "for our eyes only"
π DESCRIPTION π
okay so here's the tea β this function creates and initializes a GEM DMA object of the given size, but β and this is the main character plot twist β it doesn't allocate any memory to back the object. π«₯
so you get the object, all cute and initialized, and the backing memory is somebody else's problem. not hers. she's booked and busy. periodt π β¨
π₯ RETURN π₯
- on the win: a
struct drm_gem_dma_object *π - on the flop: an
ERR_PTR-encoded negative error code π so fr fr check it before you go dereferencing, bestie
π SEE ALSO π
the kernel file is hanging out in ./drivers/gpu/drm/drm_gem_dma_helper.c and honestly the whole friend group is 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)
all twelve of them, exactly as listed, squad goals π«Άπ
ngl this page is from the ./drivers/gpu/drm corner of the kernel and it's dated October 2026 β shoutout to the source/version and date, they ate π
k bye love u, go check your ERR_PTR before you ship it ππβ¨
π¦ 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