From: Pekka Paalanen <ppaalanen@gmail.com>
To: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org,
Leandro Ribeiro <leandro.ribeiro@collabora.com>
Subject: Re: [PATCH] drm: document drm_property_enum.value for bitfields
Date: Thu, 22 Jul 2021 10:34:27 +0300 [thread overview]
Message-ID: <20210722103427.1a75add8@eldfell> (raw)
In-Reply-To: <YPgISaTbkBxYaBHX@phenom.ffwll.local>
[-- Attachment #1: Type: text/plain, Size: 1922 bytes --]
On Wed, 21 Jul 2021 13:43:05 +0200
Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Jul 21, 2021 at 06:51:30AM +0000, Simon Ser wrote:
> > 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``.
>
> Please move this into an inline comment to make it clear that this is
> specifically about @value. With that:
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
With that
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Thanks,
pq
> I was also pondering whether we have a nice place to link to for
> "property's value" but really they're just uint64_t all over the place,
> and only stored in the drm_mode_object for non-atomic properties. So
> wording sounds like the best option we have.
>
> > */
> > struct drm_property_enum {
> > uint64_t value;
> > --
> > 2.32.0
> >
> >
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2021-07-22 7:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210722103427.1a75add8@eldfell \
--to=ppaalanen@gmail.com \
--cc=contact@emersion.fr \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=leandro.ribeiro@collabora.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).