drm_gem_shmem_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 for
  • size β€” 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 🧚

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