All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: document drm_property_enum.value for bitfields
@ 2021-07-21  6:51 Simon Ser
  2021-07-21 11:43 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Ser @ 2021-07-21  6:51 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, Pekka Paalanen, Leandro Ribeiro

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: Simon Ser <contact@emersion.fr>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Leandro Ribeiro <leandro.ribeiro@collabora.com>
---
 include/drm/drm_property.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h
index bbf5c1fdd7b0..f3ea7f97f372 100644
--- a/include/drm/drm_property.h
+++ b/include/drm/drm_property.h
@@ -37,6 +37,11 @@
  *
  * For enumeration and bitmask properties this structure stores the symbolic
  * decoding for each value. This is used for example for the rotation property.
+ *
+ * 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``.
  */
 struct drm_property_enum {
 	uint64_t value;
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-22  7:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  6:51 [PATCH] drm: document drm_property_enum.value for bitfields Simon Ser
2021-07-21 11:43 ` Daniel Vetter
2021-07-22  7:34   ` Pekka Paalanen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.