STRUCT DRM_OBJECT_PROPERTIES(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct drm_object_properties(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this one's all about struct drm_object_properties, and it's genuinely not as scary as it looks, i promise 🫢


✨ NAME ✨

struct drm_object_properties β€” property tracking for &drm_mode_object πŸŽ€


🌸 SYNOPSIS 🌸

struct drm_object_properties {
    int count;
    struct drm_property *properties[DRM_OBJECT_MAX_PROPERTY];
    uint64_t values[DRM_OBJECT_MAX_PROPERTY];
 };

like, that's the whole vibe. three members. iconique. ✨


πŸ¦‹ Members πŸ¦‹

  • count β€” the number of valid properties you've got going on. it must be less than or equal to DRM_OBJECT_MAX_PROPERTY. no cap, that's a hard limit πŸ’€
  • properties β€” an array of pointers to drm_property.
⚠️ NOTE: if we ever start dynamically destroying properties (ie. not at drm_mode_config_cleanup time), then we'd have to do a better job of detaching property from mode objects to avoid dangling property pointers. like, dangling pointers are not the move, bestie 😭
  • values β€” the array that stores the property values, matching properties. and listen β€” do not read/write values directly, okay? use drm_object_property_get_value and drm_object_property_set_value instead. that's the whole point πŸ™ˆ

so here's the tea on atomic drivers β˜•βœ¨

atomic drivers do not store mutable properties in this array β€” they only keep the decoded values in the corresponding state structure. the decoding happens via these hooks:

  • drm_crtc.atomic_get_property and drm_crtc.atomic_set_property β€” the hooks for struct drm_crtc
  • drm_plane_funcs.atomic_get_property and drm_plane_funcs.atomic_set_property β€” the hooks for struct drm_plane
  • drm_connector_funcs.atomic_get_property and drm_connector_funcs.atomic_set_property β€” the hooks for struct drm_connector

which means (and this is the important part, so pay attention πŸ”₯): atomic drivers should not use drm_object_property_set_value and drm_object_property_get_value on mutable objects β€” i.e. those without the DRM_MODE_PROP_IMMUTABLE flag set. lowkey a big deal, don't skip it πŸ’…

and one more thing bestie 🌈 β€” for atomic drivers, the default value of properties is stored in this array, so you can use drm_object_property_get_default_value to retrieve it. slay.


πŸ‘‘ SEE ALSO πŸ‘‘

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

mwah, that's the whole page πŸ’– this came from ./include/drm, October 2026 edition β€” go forth and track those properties, bestie, you got this πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from