drm_gem_shmem_create(9)
π drm_gem_shmem_create(9) π
okay so bestie, welcome to the drm_gem_shmem_create page from the Kernel API Manual β¨ this one is short and sweet and honestly kind of a vibe β it's the "make me a shmem GEM object" function, and the way it just does that? iconic.
β¨ NAME β¨
drm_gem_shmem_create β allocate an object with the given size π
πΈ SYNOPSIS πΈ
struct drm_gem_shmem_object * drm_gem_shmem_create (struct drm_device
*dev , size_t size );
like yes she's one line of C and she's carrying the whole helper file on her back, no cap π
π¦ ARGUMENTS π¦
devβ the DRM device π₯οΈ like, the actual graphics device you're doing all this forsizeβ size of the object to allocate π this is how much you're asking for, bestie, choose wisely
π DESCRIPTION π
This function creates a shmem GEM object. that's it, that's the whole description, and honestly? she ate. short, confident, no notes π
(it's the shmem-flavoured GEM object constructor β the drm_gem_shmem_helper.c crew's whole thing, iykyk π₯)
β RETURN β
On success you get a struct drm_gem_shmem_object * back π«Ά on failure you get an ERR_PTR-encoded negative error code π
fr fr: check it with IS_ERR() before you go dereferencing anything β an ERR_PTR is not a real pointer and touching it is giving "undefined behaviour main character energy" in the worst way π
π§ SEE ALSO π§
- Kernel file
./drivers/gpu/drm/drm_gem_shmem_helper.c overview(9)drm_gem_shmem_init(9)drm_gem_shmem_release(9)drm_gem_shmem_free(9)drm_gem_shmem_pin(9)drm_gem_shmem_unpin(9)drm_gem_shmem_create_with_handle(9)drm_gem_shmem_dumb_create(9)drm_gem_shmem_mmap(9)drm_gem_shmem_print_info(9)drm_gem_shmem_get_sg_table(9)drm_gem_shmem_get_pages_sgt(9)drm_gem_shmem_prime_import_sg_table(9)drm_gem_shmem_prime_import_no_map(9)
the whole shmem squad, assembled π go read them, they're all lowkey obsessed with each other
mwah π this page lives in ./drivers/gpu/drm, dated October 2026, and the day it dropped in the Kernel API Manual was a whole moment β slay, periodt, go allocate something cute πΈβ¨π
π¦ 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