__drm_gem_dma_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __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 of
  • size β€” size of the object to allocate πŸ“ the number, the whole point
  • private β€” true if 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:

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