From b2ae38b061daa2d4e081bab17eae420c32e3d90c Mon Sep 17 00:00:00 2001 From: Laurentiu Palcu Date: Fri, 23 Mar 2018 08:23:11 -0500 Subject: [PATCH] MLK-17703-6: drm: imx: dcss: fix output colorimetry in crtc The detection of the supported output colorimetry was wrong. This patch will fix that and, also, get rid of the REC2100HLG EOTF setting for now. It produces bad colors. Signed-off-by: Laurentiu Palcu --- drivers/gpu/drm/imx/dcss/dcss-crtc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/imx/dcss/dcss-crtc.c b/drivers/gpu/drm/imx/dcss/dcss-crtc.c index cd384fceacbe..803ff9034282 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-crtc.c +++ b/drivers/gpu/drm/imx/dcss/dcss-crtc.c @@ -171,19 +171,17 @@ void dcss_crtc_setup_opipe(struct drm_crtc *crtc, struct drm_connector *conn, struct drm_display_info *di = &conn->display_info; int vic; - if ((colorimetry & HDMI_EXTENDED_COLORIMETRY_BT2020) || - (colorimetry & HDMI_EXTENDED_COLORIMETRY_BT2020_CONST_LUM)) + if ((colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_BT2020)) || + (colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_BT2020_CONST_LUM))) dcss_crtc->opipe_g = G_REC2020; - else if (colorimetry & HDMI_EXTENDED_COLORIMETRY_OPRGB) + else if (colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_OPRGB)) dcss_crtc->opipe_g = G_ADOBE_ARGB; - else if (colorimetry & HDMI_EXTENDED_COLORIMETRY_XV_YCC_709) + else if (colorimetry & BIT(HDMI_EXTENDED_COLORIMETRY_XV_YCC_709)) dcss_crtc->opipe_g = G_REC709; else dcss_crtc->opipe_g = G_REC601_PAL; - if (eotf & (1 << 3)) - dcss_crtc->opipe_nl = NL_2100HLG; - else if (eotf & (1 << 2)) + if (eotf & (1 << 2)) dcss_crtc->opipe_nl = NL_REC2084; else dcss_crtc->opipe_nl = NL_REC709; -- 2.17.1