drm_gem_vram_create(9)
π 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 π
- Kernel file
./drivers/gpu/drm/drm_gem_vram_helper.coverview(9) drm_gem_vram_put(9)drm_gem_vram_offset(9)drm_gem_vram_vmap(9)drm_gem_vram_vunmap(9)drm_gem_vram_fill_create_dumb(9)drm_gem_vram_object_free(9)drm_gem_vram_driver_dumb_create(9)drm_gem_vram_plane_helper_prepare_fb(9)drm_gem_vram_plane_helper_cleanup_fb(9)drm_gem_vram_object_vmap(9)drm_gem_vram_object_vunmap(9)drm_vram_mm_debugfs_init(9)drmm_vram_helper_init(9)drm_vram_helper_mode_valid(9)
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
- 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