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 <[email protected]>
> ---
>  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: signature.asc
Description: PGP signature

Reply via email to