Hi,

On Fri, Apr 25, 2025 at 01:26:57PM +0300, Cristian Ciocaltea wrote:
> Try to make use of YUV420 when computing the best output format and
> RGB cannot be supported for any of the available color depths.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocal...@collabora.com>
> ---
>  drivers/gpu/drm/display/drm_hdmi_state_helper.c | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c 
> b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 
> 9e0a468073acbb2477eff1abef1c09d63620afaa..1fba10b92a6baa49150b6ff1e96bf2c2739bf269
>  100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -648,14 +648,26 @@ hdmi_compute_config(const struct drm_connector 
> *connector,
>                                      8, connector->max_bpc);
>       int ret;
>  
> -     /*
> -      * TODO: Add support for YCbCr420 output for HDMI 2.0 capable
> -      * devices, for modes that only support YCbCr420.
> -      */
>       ret = hdmi_compute_format_bpc(connector, conn_state, mode, max_bpc,
>                                     HDMI_COLORSPACE_RGB);
> +     if (!ret)
> +             return 0;

Sorry, I missed it on the previous iteration, but this condition
inversion compared to the rest of the function is throwing me off :)

I believe something like

If (ret) {
   if (connector->ycbcr_420_allowed) {
      hdmi_compute_format_bpc(..., HDMI_COLORSPACE_YUV420)
   } else {
     drm_dbg_kms("Can't use YUV420")
   }
}

Would be more natural

Maxime

Attachment: signature.asc
Description: PGP signature

Reply via email to