Re: [PATCH 1/4] drm/bridge: dw-hdmi: fix AVI frame colorimetry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jernej,

Thank you for the patch.

On Sat, Feb 29, 2020 at 05:30:40PM +0100, Jernej Skrabec wrote:
> CTA-861-F explicitly states that for RGB colorspace colorimetry should
> be set to "none". Fix that.
> 
> Fixes: def23aa7e982 ("drm: bridge: dw-hdmi: Switch to V4L bus format and encodings")
> Signed-off-by: Jernej Skrabec <jernej.skrabec@xxxxxxxx>

Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

> ---
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 46 +++++++++++++----------
>  1 file changed, 26 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 67fca439bbfb..24965e53d351 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -1624,28 +1624,34 @@ static void hdmi_config_AVI(struct dw_hdmi *hdmi, struct drm_display_mode *mode)
>  		frame.colorspace = HDMI_COLORSPACE_RGB;
>  
>  	/* Set up colorimetry */
> -	switch (hdmi->hdmi_data.enc_out_encoding) {
> -	case V4L2_YCBCR_ENC_601:
> -		if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV601)
> -			frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
> -		else
> +	if (!hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format)) {
> +		switch (hdmi->hdmi_data.enc_out_encoding) {
> +		case V4L2_YCBCR_ENC_601:
> +			if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV601)
> +				frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
> +			else
> +				frame.colorimetry = HDMI_COLORIMETRY_ITU_601;
> +			frame.extended_colorimetry =
> +					HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
> +			break;
> +		case V4L2_YCBCR_ENC_709:
> +			if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV709)
> +				frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
> +			else
> +				frame.colorimetry = HDMI_COLORIMETRY_ITU_709;
> +			frame.extended_colorimetry =
> +					HDMI_EXTENDED_COLORIMETRY_XV_YCC_709;
> +			break;
> +		default: /* Carries no data */
>  			frame.colorimetry = HDMI_COLORIMETRY_ITU_601;
> +			frame.extended_colorimetry =
> +					HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
> +			break;
> +		}
> +	} else {
> +		frame.colorimetry = HDMI_COLORIMETRY_NONE;
>  		frame.extended_colorimetry =
> -				HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
> -		break;
> -	case V4L2_YCBCR_ENC_709:
> -		if (hdmi->hdmi_data.enc_in_encoding == V4L2_YCBCR_ENC_XV709)
> -			frame.colorimetry = HDMI_COLORIMETRY_EXTENDED;
> -		else
> -			frame.colorimetry = HDMI_COLORIMETRY_ITU_709;
> -		frame.extended_colorimetry =
> -				HDMI_EXTENDED_COLORIMETRY_XV_YCC_709;
> -		break;
> -	default: /* Carries no data */
> -		frame.colorimetry = HDMI_COLORIMETRY_ITU_601;
> -		frame.extended_colorimetry =
> -				HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
> -		break;
> +			HDMI_EXTENDED_COLORIMETRY_XV_YCC_601;
>  	}
>  
>  	frame.scan_mode = HDMI_SCAN_MODE_NONE;

-- 
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux