[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240308172623.37663eb6.pekka.paalanen@collabora.com>
Date: Fri, 8 Mar 2024 17:26:23 +0200
From: Pekka Paalanen <pekka.paalanen@...labora.com>
To: Alexander Stein <alexander.stein@...tq-group.com>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, Thomas Zimmermann
<tzimmermann@...e.de>, David Airlie <airlied@...il.com>, Daniel Vetter
<daniel@...ll.ch>, Jonathan Corbet <corbet@....net>, Sandy Huang
<hjc@...k-chips.com>, Heiko Stübner <heiko@...ech.de>,
Chen-Yu Tsai <wens@...e.org>, Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>, dri-devel@...ts.freedesktop.org, Hans
Verkuil <hverkuil@...all.nl>, Sebastian Wick <sebastian.wick@...hat.com>,
Ville Syrjälä <ville.syrjala@...ux.intel.com>,
linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linux-rockchip@...ts.infradead.org, linux-sunxi@...ts.linux.dev, Maxime
Ripard <mripard@...nel.org>, Dave Stevenson
<dave.stevenson@...pberrypi.com>
Subject: Re: [PATCH v8 16/27] drm/connector: hdmi: Add Broadcast RGB
property
On Fri, 08 Mar 2024 12:26:14 +0100
Alexander Stein <alexander.stein@...tq-group.com> wrote:
> Hi Maxime,
>
> Am Donnerstag, 7. März 2024, 14:38:43 CET schrieb Maxime Ripard:
> > The i915 driver has a property to force the RGB range of an HDMI output.
> > The vc4 driver then implemented the same property with the same
> > semantics. KWin has support for it, and a PR for mutter is also there to
> > support it.
> >
> > Both drivers implementing the same property with the same semantics,
> > plus the userspace having support for it, is proof enough that it's
> > pretty much a de-facto standard now and we can provide helpers for it.
> >
> > Let's plumb it into the newly created HDMI connector.
> >
> > Reviewed-by: Dave Stevenson <dave.stevenson@...pberrypi.com>
> > Acked-by: Pekka Paalanen <pekka.paalanen@...labora.com>
> > Reviewed-by: Sebastian Wick <sebastian.wick@...hat.com>
> > Signed-off-by: Maxime Ripard <mripard@...nel.org>
> > ---
> > Documentation/gpu/kms-properties.csv | 1 -
> > drivers/gpu/drm/drm_atomic.c | 2 +
> > drivers/gpu/drm/drm_atomic_state_helper.c | 4 +-
> > drivers/gpu/drm/drm_atomic_uapi.c | 4 ++
> > drivers/gpu/drm/drm_connector.c | 88 +++++++++++++++++++++++++++++++
> > include/drm/drm_connector.h | 36 +++++++++++++
> > 6 files changed, 133 insertions(+), 2 deletions(-)
..
> > diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> > index 591d2d500f61..0272e1d05cc6 100644
> > --- a/drivers/gpu/drm/drm_connector.c
> > +++ b/drivers/gpu/drm/drm_connector.c
> > @@ -1210,10 +1210,33 @@ static const u32 dp_colorspaces =
> > BIT(DRM_MODE_COLORIMETRY_SYCC_601) |
> > BIT(DRM_MODE_COLORIMETRY_OPYCC_601) |
> > BIT(DRM_MODE_COLORIMETRY_BT2020_CYCC) |
> > BIT(DRM_MODE_COLORIMETRY_BT2020_YCC);
> >
> > +static const struct drm_prop_enum_list broadcast_rgb_names[] = {
> > + { DRM_HDMI_BROADCAST_RGB_AUTO, "Automatic" },
> > + { DRM_HDMI_BROADCAST_RGB_FULL, "Full" },
> > + { DRM_HDMI_BROADCAST_RGB_LIMITED, "Limited 16:235" },
> > +};
> > +
> > +/*
> > + * drm_hdmi_connector_get_broadcast_rgb_name - Return a string for HDMI connector RGB broadcast selection
> > + * @broadcast_rgb: Broadcast RGB selection to compute name of
> > + *
> > + * Returns: the name of the Broadcast RGB selection, or NULL if the type
> > + * is not valid.
> > + */
> > +const char *
> > +drm_hdmi_connector_get_broadcast_rgb_name(enum drm_hdmi_broadcast_rgb broadcast_rgb)
> > +{
> > + if (broadcast_rgb > DRM_HDMI_BROADCAST_RGB_LIMITED)
>
> I don't know if this was brought up before. IMHO it's easier to read checking:
> if (broadcast_rgb > ARRAY_SIZE(broadcast_rgb_names)
You have an off-by-one bug in that suggestion. ;-)
Thanks,
pq
>
> Best regards,
> Alexander
>
> > + return NULL;
> > +
> > + return broadcast_rgb_names[broadcast_rgb].name;
> > +}
> > +EXPORT_SYMBOL(drm_hdmi_connector_get_broadcast_rgb_name);
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists