[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200302092124.GD11960@pendragon.ideasonboard.com>
Date: Mon, 2 Mar 2020 11:21:24 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Jernej Skrabec <jernej.skrabec@...l.net>
Cc: a.hajda@...sung.com, narmstrong@...libre.com, jonas@...boo.se,
airlied@...ux.ie, daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [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@...l.net>
Acked-by: Laurent Pinchart <laurent.pinchart@...asonboard.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
Powered by blists - more mailing lists