drm_gem_vram_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– drm_gem_vram_create(9) πŸ’–

okay so bestie, welcome to the kernel API manual β€” this is drm_gem_vram_create(9) and it is literally the glow-up moment for your VRAM-backed GEM object ✨


🌸 NAME 🌸

drm_gem_vram_create β€” Creates a VRAM-backed GEM object

no cap, that's the whole vibe: it makes you a GEM object that lives in VRAM πŸ’…


✨ SYNOPSIS ✨

struct drm_gem_vram_object * drm_gem_vram_create (struct drm_device *dev
, size_t size , unsigned long pg_align );

look at that signature, she's iconic 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the DRM device, like, the whole reason we're here πŸ’–
  • size β€” the buffer size in bytes (yes, bytes, we're being precise)
  • pg_align β€” the buffer's alignment, measured in multiples of the page size 🧚

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” GEM objects get allocated by calling struct drm_driver.gem_create_object, if it's set. if it's not set? then kzalloc will be used instead. that's the fallback, bestie, and it slays in a pinch.

drivers can totally set their own GEM object functions in struct drm_driver.gem_create_object. and if no functions are set at all, then the new GEM object will use the default functions from GEM VRAM helpers. default queen behavior πŸ‘‘


πŸ”₯ RETURN πŸ”₯

a new instance of struct drm_gem_vram_object on success β€” yay πŸŽ‰ β€” or an ERR_PTR-encoded error code otherwise 😭

fr fr, always check that return value. if it's an ERR_PTR-encoded error code, that's not a cute moment, that's a bug in your code.

🌈 SEE ALSO 🌈

like, go read all of them, iykyk πŸ’€πŸ“š


mwah, that's the page! 🫢 this one was brought to you by ./drivers/gpu/drm, stamped October 2026 β€” stay hydrated, check your error pointers, and slay your VRAM allocations, bestie πŸ’œπŸŽ€

πŸ“¦ where this page comes from