STRUCT DRM_MODE_OBJECT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct drm_mode_object(9) ✨

okay so this is from the Kernel API Manual and it's literally the blueprint for modeset objects β€” like the main-character base struct everyone else inherits the vibe from πŸ’…

πŸŽ€ NAME πŸŽ€

struct drm_mode_object β€” the base structure for modeset objects, no cap 🫢

🌸 SYNOPSIS 🌸

struct drm_mode_object {
    uint32_t id;
    uint32_t type;
    struct drm_object_properties *properties;
    struct kref refcount;
    void (*free_cb)(struct kref *kref);
 };

πŸ¦‹ Members πŸ¦‹

  • id β€” the userspace visible identifier, aka the name tag everyone in userspace gets to see πŸ’–
  • type β€” what kind of object this is, and it's gotta be one of the DRM_MODE_OBJECT_ values ⭐
  • properties β€” the properties attached to this object, including their values. the whole package, bestie πŸŽ€
  • refcount β€” the reference count, for objects that have a dynamic lifetime πŸ”₯
  • free_cb β€” the free function callback, and heads up: this one's only set for objects with a dynamic lifetime πŸ‘‘

πŸ’œ Description πŸ’œ

So this is the base structure for modeset objects that are visible to userspace. You can look objects up using drm_mode_object_find. Besides the basic uapi interface properties like id and type, it provides two services:

  • It tracks attached properties and their values. This is what drm_crtc, drm_plane and drm_connector use. Properties get attached by calling drm_object_attach_property before the object is visible to userspace β€” timing matters, periodt ⏰✨
  • For objects with dynamic lifetimes (as indicated by a non-NULL free_cb) it provides reference counting through drm_mode_object_get and drm_mode_object_put. This is used by drm_framebuffer, drm_connector and drm_property_blob. Those objects go ahead and provide specialized reference counting wrappers, because of course they do πŸ’…

🌈 SEE ALSO 🌈

  • Kernel file ./include/drm/drm_mode_object.h struct drm_object_properties(9)

and that's the whole page, bestie πŸ“ tysm for reading β€” it lives in ./include/drm and the version stamp says October 2026, so mark your calendar πŸ§šπŸ’–

πŸ“¦ where this page comes from