From: Maxime Ripard <mripard@kernel.org>
To: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Dmitry Baryshkov <lumag@kernel.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel@collabora.com
Subject: Re: [PATCH 0/2] Make HDMI state helpers handle odd max bpc requests
Date: Thu, 18 Jun 2026 17:48:42 +0200 [thread overview]
Message-ID: <20260618-evasive-devious-cassowary-70a2b6@houat> (raw)
In-Reply-To: <n8gESqWZSRS1IhbHdJvkLQ@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 2283 bytes --]
On Tue, Jun 09, 2026 at 05:46:20PM +0200, Nicolas Frattaroli wrote:
> On Tuesday, 9 June 2026 14:51:12 Central European Summer Time Maxime Ripard wrote:
> > Hi,
> >
> > On Mon, Jun 08, 2026 at 01:19:06PM +0200, Nicolas Frattaroli wrote:
> > > With the "max bpc" KMS connector property, userspace can arbitrarily
> > > restrict the upper end of the bits-per-component range. This is fine and
> > > good, except the HDMI state helpers never considered that max_bpc could
> > > be influenced by a userspace setting, so assumed it'll always be an even
> > > value from the HDMI standards.
> > >
> > > This, unfortunately, is not the world we live in anymore. Patch 1
> > > corrects sink_supports_format_bpc to return false on BPCs outside of
> > > what HDMI allows. Patch 2 then corrects handling of odd-numbered max
> > > bpcs by rounding the loop start value down to an even number instead. It
> > > also adds a KUnit test to make sure nobody breaks this again in the
> > > future.
> > >
> > > Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> >
> > Do you have a bit more details on the world you live in? :)
> >
> > In particular, why would erroring out on setting an odd value in
> > atomic_set_property not work?
>
> It would work, but it'd be an inferior solution IMHO. (If the intent
> was to point out this is already done then I can't find the code where
> such a check is performed.)
>
> It's perfectly fine, albeit weird, for userspace to say it wants a max
> bpc of 11. That HDMI does not support 11 bpc isn't really something the
> upper end of the range should concern itself with, much like we don't
> error out on a max bpc of 14 either even though HDMI does not support
> bit depths of 14 bits.
Yeah, this makes total sense indeed.
> By counting from the next even number, we don't leak our implementation's
> choice of trying every other bit depth through the uAPI with an overly
> restrictive constraint being placed. In an alternate universe, mirror
> world Maxime may have decided to i-- in that for loop instead just in
> case, and the second patch wouldn't be needed.
Damn current world Maxime :D
Thanks for the explanation, the series looks mostly fine and I had two
nits.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
next prev parent reply other threads:[~2026-06-18 15:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 11:19 Nicolas Frattaroli
2026-06-08 11:19 ` [PATCH 1/2] drm/display: hdmi: Only allow BPC values of 8, 10, 12 and 16 Nicolas Frattaroli
2026-06-18 15:47 ` Maxime Ripard
2026-06-18 15:57 ` Nicolas Frattaroli
2026-06-08 11:19 ` [PATCH 2/2] drm/display: hdmi: Round odd max_bpc down to even numbers Nicolas Frattaroli
2026-06-18 15:45 ` Maxime Ripard
2026-06-09 12:51 ` [PATCH 0/2] Make HDMI state helpers handle odd max bpc requests Maxime Ripard
2026-06-09 15:46 ` Nicolas Frattaroli
2026-06-18 15:48 ` Maxime Ripard [this message]
2026-06-10 7:45 ` Michel Dänzer
2026-06-18 15:41 ` 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=20260618-evasive-devious-cassowary-70a2b6@houat \
--to=mripard@kernel.org \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lumag@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=nicolas.frattaroli@collabora.com \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®