STRUCT DRM_GEM_OPEN(9)
β¨ 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:
- Kernel file
./tools/perf/trace/beauty/include/uapi/drm/drm.hstructdrm_gem_close(9), structdrm_gem_flink(9), structdrm_gem_change_handle(9),DRM_CAP_DUMB_BUFFER(9),DRM_CAP_VBLANK_HIGH_CRTC(9),DRM_CAP_DUMB_PREFERRED_DEPTH(9),DRM_CAP_DUMB_PREFER_SHADOW(9),DRM_CAP_PRIME(9),DRM_PRIME_CAP_IMPORT(9),DRM_PRIME_CAP_EXPORT(9),DRM_CAP_TIMESTAMP_MONOTONIC(9),DRM_CAP_ASYNC_PAGE_FLIP(9),DRM_CAP_CURSOR_WIDTH(9),DRM_CAP_CURSOR_HEIGHT(9),DRM_CAP_ADDFB2_MODIFIERS(9),DRM_CAP_PAGE_FLIP_TARGET(9),DRM_CAP_CRTC_IN_VBLANK_EVENT(9),DRM_CAP_SYNCOBJ(9),DRM_CAP_SYNCOBJ_TIMELINE(9),DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP(9),DRM_CLIENT_CAP_STEREO_3D(9),DRM_CLIENT_CAP_UNIVERSAL_PLANES(9),DRM_CLIENT_CAP_ATOMIC(9),DRM_CLIENT_CAP_ASPECT_RATIO(9),DRM_CLIENT_CAP_WRITEBACK_CONNECTORS(9),DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT(9),DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE(9), structdrm_syncobj_eventfd(9),DRM_IOCTL_GEM_CLOSE(9),DRM_IOCTL_PRIME_HANDLE_TO_FD(9),DRM_IOCTL_PRIME_FD_TO_HANDLE(9),DRM_IOCTL_MODE_RMFB(9),DRM_IOCTL_MODE_CREATE_DUMB(9),DRM_IOCTL_MODE_GETFB2(9),DRM_IOCTL_SYNCOBJ_EVENTFD(9),DRM_IOCTL_MODE_CLOSEFB(9),DRM_IOCTL_SET_CLIENT_NAME(9),DRM_IOCTL_GEM_CHANGE_HANDLE(9), structdrm_event(9),DRM_EVENT_VBLANK(9),DRM_EVENT_FLIP_COMPLETE(9),DRM_EVENT_CRTC_SEQUENCE(9)
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
- 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