MLK-18104: drm: imx: dcss: Fix brightness on some HDMI 1.4 ports
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Fri, 20 Apr 2018 11:19:56 +0000 (14:19 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Some HDR TVs have multiple HDMI ports but only one of them is HDMI 2.0
compliant, hence HDR capable. The rest are HDMI 1.4.

The HDMI 1.4 ports' supported colorimetry is only REC.709 and REC.601.
However, the supported EOTF in HDR metadata block can be BT.2084 which
should be matched with REC.2020.

This patch makes sure that BT2084 is used only if colorimetry supports
REC.2020. Otherwise, REC.709 will be used.

Additionally, change a message from info to debug. No need for it to
show up all the time.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/drm/imx/dcss/dcss-crtc.c

index d057c47..a3ff82c 100644 (file)
@@ -176,7 +176,7 @@ void dcss_crtc_setup_opipe(struct drm_crtc *crtc, struct drm_connector *conn,
        else
                dcss_crtc->opipe_g = G_REC709;
 
-       if (eotf & (1 << 2))
+       if ((eotf & (1 << 2)) && dcss_crtc->opipe_g == G_REC2020)
                dcss_crtc->opipe_nl = NL_REC2084;
        else
                dcss_crtc->opipe_nl = NL_REC709;
@@ -196,9 +196,9 @@ void dcss_crtc_setup_opipe(struct drm_crtc *crtc, struct drm_connector *conn,
        else
                dcss_crtc->opipe_pix_format = DRM_FORMAT_ARGB8888;
 
-       DRM_INFO("OPIPE_CFG: gamut = %d, nl = %d, pr = %d, pix_format = %d\n",
-                dcss_crtc->opipe_g, dcss_crtc->opipe_nl,
-                dcss_crtc->opipe_pr, dcss_crtc->opipe_pix_format);
+       DRM_DEBUG_KMS("OPIPE_CFG: gamut = %d, nl = %d, pr = %d, pix_fmt = %d\n",
+                     dcss_crtc->opipe_g, dcss_crtc->opipe_nl,
+                     dcss_crtc->opipe_pr, dcss_crtc->opipe_pix_format);
 }
 
 int dcss_crtc_get_opipe_cfg(struct drm_crtc *crtc,