ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: Pekka Paalanen <pekka.paalanen@collabora.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>
Cc: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Sandy Huang" <hjc@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>, "Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	dri-devel@lists.freedesktop.org,
	"Hans Verkuil" <hverkuil@xs4all.nl>,
	"Sebastian Wick" <sebastian.wick@redhat.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev,
	"Maxime Ripard" <mripard@kernel.org>,
	"Dave Stevenson" <dave.stevenson@raspberrypi.com>
Subject: Re: [PATCH v8 16/27] drm/connector: hdmi: Add Broadcast RGB property
Date: Fri, 8 Mar 2024 17:26:23 +0200	[thread overview]
Message-ID: <20240308172623.37663eb6.pekka.paalanen@collabora.com> (raw)
In-Reply-To: <2599919.Lt9SDvczpP@steina-w>

[-- Attachment #1: Type: text/plain, Size: 3029 bytes --]

On Fri, 08 Mar 2024 12:26:14 +0100
Alexander Stein <alexander.stein@ew.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@raspberrypi.com>
> > Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
> > Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
> > Signed-off-by: Maxime Ripard <mripard@kernel.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);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-03-08 15:26 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 13:38 [PATCH v8 00/27] drm/connector: Create HDMI Connector infrastructure Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 01/27] drm/connector: Introduce an HDMI connector initialization function Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 02/27] drm/tests: connector: Add tests for drmm_connector_hdmi_init Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 03/27] drm/connector: hdmi: Create an HDMI sub-state Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 04/27] drm/connector: hdmi: Add output BPC to the connector state Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 05/27] drm/tests: Add output bpc tests Maxime Ripard
2024-03-08  8:39   ` Alexander Stein
2024-03-07 13:38 ` [PATCH v8 06/27] drm/connector: hdmi: Add support for output format Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 07/27] drm/tests: Add output formats tests Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 08/27] drm/connector: hdmi: Add HDMI compute clock helper Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 09/27] drm/tests: Add HDMI TDMS character rate tests Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 10/27] drm/connector: hdmi: Calculate TMDS character rate Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 11/27] drm/tests: Add TDMS character rate connector state tests Maxime Ripard
2024-03-08 11:11   ` Alexander Stein
2024-03-07 13:38 ` [PATCH v8 12/27] drm/connector: hdmi: Add custom hook to filter TMDS character rate Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 13/27] drm/tests: Add HDMI connector rate filter hook tests Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 14/27] drm/connector: hdmi: Compute bpc and format automatically Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 15/27] drm/tests: Add HDMI connector bpc and format tests Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 16/27] drm/connector: hdmi: Add Broadcast RGB property Maxime Ripard
2024-03-08 11:26   ` Alexander Stein
2024-03-08 15:26     ` Pekka Paalanen [this message]
2024-03-07 13:38 ` [PATCH v8 17/27] drm/tests: Add tests for " Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 18/27] drm/connector: hdmi: Add RGB Quantization Range to the connector state Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 19/27] drm/tests: Add RGB Quantization tests Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 20/27] drm/connector: hdmi: Add Infoframes generation Maxime Ripard
2024-03-07 21:34   ` Dmitry Baryshkov
2024-03-07 22:02   ` Dmitry Baryshkov
2024-03-08 12:47   ` Alexander Stein
2024-03-07 13:38 ` [PATCH v8 21/27] drm/tests: Add infoframes test Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 22/27] drm/connector: hdmi: Create Infoframe DebugFS entries Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 23/27] drm/vc4: hdmi: Switch to HDMI connector Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 24/27] drm/vc4: tests: Remove vc4_dummy_plane structure Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 25/27] drm/vc4: tests: Convert to plane creation helper Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 26/27] drm/rockchip: inno_hdmi: Switch to HDMI connector Maxime Ripard
2024-03-07 13:38 ` [PATCH v8 27/27] drm/sun4i: hdmi: " Maxime Ripard

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=20240308172623.37663eb6.pekka.paalanen@collabora.com \
    --to=pekka.paalanen@collabora.com \
    --cc=airlied@gmail.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=corbet@lwn.net \
    --cc=daniel@ffwll.ch \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=samuel@sholland.org \
    --cc=sebastian.wick@redhat.com \
    --cc=tzimmermann@suse.de \
    --cc=ville.syrjala@linux.intel.com \
    --cc=wens@csie.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).