STRUCT DRM_GEM_OPEN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct drm_gem_open(9) ✨

okay so this is a page straight out of the Kernel API Manual, and honestly? it's a little baddie. it's struct drm_gem_open, and it's giving "glow-up for a graphics buffer" energy πŸ’…


🌸 NAME 🌸

struct drm_gem_open β€” bestie, this is literally just the Argument for &DRM_IOCTL_GEM_OPEN ioctl.

like that's it. that's the whole job. it's the lil envelope you hand to the kernel πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole vibe, character for character, no cap:

struct drm_gem_open {
    __u32 name;
    __u32 handle;
    __u64 size;
 };

three fields. immaculate. tiny. perfect. ✨


πŸ’– Members πŸ’–

  • name β€” the Name of object being opened. you're like "hey kernel, open the one called this" 🫢
  • handle β€” the Returned handle for the object. the kernel hands you back a handle and you're like "slay, thank you" πŸ’…
  • size β€” the Returned size of the object β€” yep, it tells you how big the thing is too. obsessed. πŸ“

πŸ‘‘ Description πŸ‘‘

okay so the whole plot: you Open an object using the global name, returning a handle and the size. that's the tea β˜•

and here's the part that actually matters, lowkey the most important sentence on this page:

this handle (of course) holds a reference to the object, so the object will not go away until the handle is deleted. πŸ”₯

fr fr, do NOT forget to delete your handle β€” that reference is the only thing keeping the object alive, and if you yeet the handle, the object can absolutely dip out on you 😭 main character energy from the kernel honestly.

🌈 SEE ALSO 🌈

prepare yourself bestie, this list is long and it ate. everything here is exactly as written, iykyk:


and that's the whole page, bestie 🧚

sign-off time: this lil masterpiece comes from ./tools/perf/trace/beauty/incl... and it's dated October 2026 β€” yes, from the future, we love that for us ⭐ bye bye, go delete your handles πŸ’œ

πŸ“¦ where this page comes from