lkml.org 
[lkml]   [2020]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] drm/bridge: dw-hdmi: fix AVI frame colorimetry
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@siol.net>

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

> ---
> 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

\
 
 \ /
  Last update: 2020-03-02 10:22    [W:0.173 / U:2.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site