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 v2 1/2] drm/display: hdmi: Only allow BPC values of 8, 10, 12 and 16
Date: Fri, 19 Jun 2026 16:01:48 +0200 [thread overview]
Message-ID: <20260619-shapeless-proficient-corgi-4cdeb1@houat> (raw)
In-Reply-To: <20260618-hdmi-max-bpc-fix-v2-1-7b67f489b0cc@collabora.com>
[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]
Hi Nicolas,
On Thu, Jun 18, 2026 at 08:54:23PM +0200, Nicolas Frattaroli wrote:
> As per the comment in sink_supports_format_bpc(), CTA-861-F defines that
> only bits-per-channel values of 8, 10, 12 and 16 are allowed for HDMI.
> Allowing more than this has surprising consequences for the atomic check
> phase. The HDMI state helpers may accidentally conclude that a sink
> supports 11bpc if a caller asks for it.
>
> Fix this by exiting early if the bpc value doesn't match one of those
> given in the standard.
>
> Fixes: 26ff1c38fc29 ("drm/connector: hdmi: Compute bpc and format automatically")
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> ---
> drivers/gpu/drm/display/drm_hdmi_state_helper.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index ce17eeefc2da..0bf6102244f7 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -420,6 +420,16 @@ sink_supports_format_bpc(const struct drm_connector *connector,
> return false;
> }
>
> + switch (bpc) {
> + case 8:
> + case 10:
> + case 12:
> + case 16:
> + break;
> + default:
> + return false;
> + }
> +
Sorry for not noticing in your first version, but I'd move this before
the VIC 1 check, and would add a comment to refer to the spec (possibly
by splitting the comment already there for the VIC 1 check).
We should also log debug message on failure like we do for every other
rejection path.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]
next prev parent reply other threads:[~2026-06-19 14:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 18:54 [PATCH v2 0/2] Make HDMI state helpers handle odd max bpc requests Nicolas Frattaroli
2026-06-18 18:54 ` [PATCH v2 1/2] drm/display: hdmi: Only allow BPC values of 8, 10, 12 and 16 Nicolas Frattaroli
2026-06-19 14:01 ` Maxime Ripard [this message]
2026-06-18 18:54 ` [PATCH v2 2/2] drm/display: hdmi: Round odd max_bpc down to even numbers Nicolas Frattaroli
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=20260619-shapeless-proficient-corgi-4cdeb1@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®