MLK-18163-2: drm: imx: dcss: Fix bit depth checking for YUV420
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Wed, 2 May 2018 10:29:20 +0000 (13:29 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
When YUV420 is used, we need to check that the deep color mode actually
supports the bit depth required. Currently, the code checks the RGB bit
depth.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit 5ac33861906cb7be660cc5c0a0f494194a81275a)

drivers/gpu/drm/imx/dcss/dcss-crtc.c

index a3ff82c..c956bc5 100644 (file)
@@ -191,7 +191,7 @@ void dcss_crtc_setup_opipe(struct drm_crtc *crtc, struct drm_connector *conn,
        /* FIXME: we should get the connector colorspace some other way */
        if (vic == 97 &&
            (di->color_formats & DRM_COLOR_FORMAT_YCRCB420) &&
-           (di->bpc >= 10))
+           (di->hdmi.y420_dc_modes & DRM_EDID_YCBCR420_DC_30))
                dcss_crtc->opipe_pix_format = DRM_FORMAT_P010;
        else
                dcss_crtc->opipe_pix_format = DRM_FORMAT_ARGB8888;