Commit 3012248f authored by Simon Ser's avatar Simon Ser

drm: document drm_property_enum.value for bitfields

When a property has the type DRM_MODE_PROP_BITMASK, the value field
stores a bitshift, not a bitmask, which can be surprising.
Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
Cc: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/NUZTPTKKZtAlDhxIXFB1qrUqWBYKapkBxCnb1S1bc3g@cp3-web-033.plabs.ch
parent 03b7c552
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
/** /**
* struct drm_property_enum - symbolic values for enumerations * struct drm_property_enum - symbolic values for enumerations
* @value: numeric property value for this enum entry
* @head: list of enum values, linked to &drm_property.enum_list * @head: list of enum values, linked to &drm_property.enum_list
* @name: symbolic name for the enum * @name: symbolic name for the enum
* *
...@@ -39,6 +38,14 @@ ...@@ -39,6 +38,14 @@
* decoding for each value. This is used for example for the rotation property. * decoding for each value. This is used for example for the rotation property.
*/ */
struct drm_property_enum { struct drm_property_enum {
/**
* @value: numeric property value for this enum entry
*
* If the property has the type &DRM_MODE_PROP_BITMASK, @value stores a
* bitshift, not a bitmask. In other words, the enum entry is enabled
* if the bit number @value is set in the property's value. This enum
* entry has the bitmask ``1 << value``.
*/
uint64_t value; uint64_t value;
struct list_head head; struct list_head head;
char name[DRM_PROP_NAME_LEN]; char name[DRM_PROP_NAME_LEN];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment