drm_mode_object_put(9)
π drm_mode_object_put β the kernel API manual, bestie edition π
Okay so real talk, we're in the drm_mode_object_put(9) page today β it lives in the Kernel API Manual, and honestly? It's a little one-trick pony but it eats every time. β¨
β¨ NAME β¨
drm_mode_object_put β release a mode object reference π«Ά
πΈ SYNOPSIS πΈ
void drm_mode_object_put (struct drm_mode_object *obj );
That's it. That's the whole vibe check. One argument, no return value, no drama. π
π¦ ARGUMENTS π¦
objβ a DRM mode object. Yeah. That's the whole description. The original said "DRM mode object" and honestly the original said it best, so I'm not gonna fumble it. It's the mode object. It's the mode object. π
π₯ DESCRIPTION π₯
So here's the tea, bestie β this function decrements the object's refcount, but only if it's a refcounted modeset object. That's the main character condition right there. π
And if it's not one of those? It's a no-op on any other object. Literally nothing happens. Not me calling a function and it justβ¦ does nothing. π But that's fine, that's the design, that's iconic behaviour and we respect it.
The whole point of this little cutie is to drop references acquired with drm_mode_object_get. So get grabs one, put gives it back. Balanced. Symmetrical. A true friendship. π«Άβ¨
β SEE ALSO β
Y'all, the cross-references on this one are stacked. Go get to know the whole family, fr fr:
- Kernel file
./drivers/gpu/drm/drm_mode_object.c drm_mode_object_add(9)drm_mode_object_unregister(9)drm_mode_object_lease_required(9)drm_mode_object_find(9)drm_mode_object_get(9)drm_object_attach_property(9)drm_object_property_set_value(9)drm_object_property_get_value(9)drm_object_property_get_default_value(9)drm_object_immutable_property_get_value(9)drm_mode_obj_get_properties_ioctl(9)
okay so go calldrm_mode_object_getanddrm_mode_object_putin matching pairs, that's the whole assignment, iykyk π
And that's the page!! π Shoutout to the source tree ./drivers/gpu/drm and the version date October 2026 β that's where this baby comes from, no cap. Slay, stay refcounted, and don't leak. ππ§π
π¦ 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