diff options
author | Dave Stevenson <dave.stevenson@raspberrypi.com> | 2022-02-21 10:59:02 +0100 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-02-25 17:55:42 +0100 |
commit | adf47b75297ebc71c53b6dc2d3c55f42b8fb79fd (patch) | |
tree | 36431419fe1a978bd2e82c1b71ef3e105afad1fb /include/drm/drm_mode_object.h | |
parent | drm/omap: plane: Fix zpos initial value mismatch (diff) | |
download | linux-adf47b75297ebc71c53b6dc2d3c55f42b8fb79fd.tar.xz linux-adf47b75297ebc71c53b6dc2d3c55f42b8fb79fd.zip |
drm/object: Add drm_object_property_get_default_value() function
Some functions to create properties (drm_plane_create_zpos_property or
drm_plane_create_color_properties for example) will ask for a range of
acceptable value and an initial one.
This initial value is then stored in the values array for that property.
Let's provide an helper to access this property.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220221095918.18763-7-maxime@cerno.tech
Diffstat (limited to '')
-rw-r--r-- | include/drm/drm_mode_object.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h index c34a3e8030e1..912f1e415685 100644 --- a/include/drm/drm_mode_object.h +++ b/include/drm/drm_mode_object.h @@ -98,6 +98,10 @@ struct drm_object_properties { * Hence 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. + * + * For atomic drivers the default value of properties is stored in this + * array, so drm_object_property_get_default_value can be used to + * retrieve it. */ uint64_t values[DRM_OBJECT_MAX_PROPERTY]; }; @@ -126,6 +130,9 @@ int drm_object_property_set_value(struct drm_mode_object *obj, int drm_object_property_get_value(struct drm_mode_object *obj, struct drm_property *property, uint64_t *value); +int drm_object_property_get_default_value(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t *val); void drm_object_attach_property(struct drm_mode_object *obj, struct drm_property *property, |