From: sashiko-bot@kernel.org
To: "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/display: hdmi: Only allow BPC values of 8, 10, 12 and 16
Date: Mon, 08 Jun 2026 11:30:22 +0000 [thread overview]
Message-ID: <20260608113023.67AFB1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260608-hdmi-max-bpc-fix-v1-1-6e8dcebc7274@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The function `sink_supports_format_bpc` explicitly permits 16 BPC for RGB444 and YCBCR444 formats without verifying if the sink's EDID actually supports 48-bit deep color.
--
commit 767fa3cc832e8b93f697ad91bcc66e5b3b1ed85d
Author: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
drm/display: hdmi: Only allow BPC values of 8, 10, 12 and 16
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.
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 4867edbf2622b..b06499dbfe8b3 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -419,6 +419,16 @@ sink_supports_format_bpc(const struct drm_connector *connector,
> return false;
> }
>
> + switch (bpc) {
> + case 8:
> + case 10:
> + case 12:
> + case 16:
[Severity: High]
This is a pre-existing issue, but does explicitly allowing 16 BPC here
expose a missing validation check for 48-bit deep color further down in
sink_supports_format_bpc()?
When checking DRM_OUTPUT_COLOR_FORMAT_RGB444 and
DRM_OUTPUT_COLOR_FORMAT_YCBCR444, the code validates 10 BPC and 12 BPC
against the EDID flags, but completely omits checking 16 BPC against
DRM_EDID_HDMI_DC_48:
drivers/gpu/drm/display/drm_hdmi_state_helper.c:sink_supports_format_bpc() {
...
case DRM_OUTPUT_COLOR_FORMAT_RGB444:
...
if (bpc == 10 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_30)) {
drm_dbg_kms(dev, "10 BPC but sink doesn't support Deep Color 30.\n");
return false;
}
if (bpc == 12 && !(info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_36)) {
drm_dbg_kms(dev, "12 BPC but sink doesn't support Deep Color 36.\n");
return false;
}
drm_dbg_kms(dev, "RGB format supported in that configuration.\n");
return true;
...
}
If the TMDS clock limit permits it, the driver might incorrectly conclude
that the sink supports 16 BPC and program the hardware accordingly, which
could result in a black screen if the monitor doesn't actually support
48-bit deep color.
Should a check for (info->edid_hdmi_rgb444_dc_modes & DRM_EDID_HDMI_DC_48)
be added for the RGB444 and YCBCR444 cases?
> + break;
> + default:
> + return false;
> + }
> +
> if (!info->is_hdmi &&
> (format != DRM_OUTPUT_COLOR_FORMAT_RGB444 || bpc != 8)) {
> drm_dbg_kms(dev, "DVI Monitors require an RGB output at 8 bpc\n");
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260608-hdmi-max-bpc-fix-v1-0-6e8dcebc7274@collabora.com?part=1
next prev parent reply other threads:[~2026-06-08 11:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 11:19 [PATCH 0/2] Make HDMI state helpers handle odd max bpc requests 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-08 11:30 ` sashiko-bot [this message]
2026-06-08 11:46 ` Nicolas Frattaroli
2026-06-08 11:50 ` Nicolas Frattaroli
2026-06-08 11:19 ` [PATCH 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=20260608113023.67AFB1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=nicolas.frattaroli@collabora.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.