From 4c3d8c989e94d4ae426e74b8a53886f0a6d529b5 Mon Sep 17 00:00:00 2001 From: Laurentiu Palcu Date: Tue, 13 Nov 2018 11:01:36 +0200 Subject: [PATCH] MLK-20117 drm/imx/dcss: fix color issue when Adobe_ARGB gamut is used Adobe ARGB gamut was selected even if the output pipe pixel encoding was YUV. That produced a pink tint on the screen. This patch will make sure the Adobe ARGB gamut is selected only when the output pipe pixel encoding is RGB. Signed-off-by: Laurentiu Palcu --- drivers/gpu/drm/imx/dcss/dcss-crtc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/imx/dcss/dcss-crtc.c b/drivers/gpu/drm/imx/dcss/dcss-crtc.c index 29f35d70961d..b310ea966947 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-crtc.c +++ b/drivers/gpu/drm/imx/dcss/dcss-crtc.c @@ -191,13 +191,16 @@ void dcss_crtc_setup_opipe(struct drm_crtc *crtc, struct drm_connector *conn, if ((colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_BT2020)) || (colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_BT2020_CONST_LUM))) dcss_crtc->opipe_g = G_REC2020; - else if (colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_OPRGB)) + else if ((colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_OPRGB)) && + !(crtc->state->adjusted_mode.private_flags & YUV_MODE)) dcss_crtc->opipe_g = G_ADOBE_ARGB; else dcss_crtc->opipe_g = G_REC709; if ((eotf & (1 << 2)) && dcss_crtc->opipe_g == G_REC2020) dcss_crtc->opipe_nl = NL_REC2084; + else if (dcss_crtc->opipe_g == G_ADOBE_ARGB) + dcss_crtc->opipe_nl = NL_SRGB; else dcss_crtc->opipe_nl = NL_REC709; -- 2.17.1