video: rockchip: hdmi: fix CTS HF1-53 HDR test
authorZheng Yang <zhengyang@rock-chips.com>
Wed, 16 Nov 2016 11:26:24 +0000 (19:26 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 15 Feb 2017 08:57:01 +0000 (16:57 +0800)
1. HDR MetaData HB2 is 26.
2. Under HF1-53, HDR MetaData should be sent and
PB1 value should be exist in EDID.

Change-Id: I616b4cdcf321ea0080b845c868d1f4cd4881fd14
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(cherry picked from commit 39c34527e735b84e6ceb8a2e386aed0060111858)

drivers/video/rockchip/hdmi/rockchip-hdmi-core.c
drivers/video/rockchip/hdmi/rockchip-hdmi-sysfs.c
drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c

index 70aa0ff0d23863b629ba17bec0f74eab08875fde..c8e97df92c3375a7863c20f9cfcc2454a991ad08 100644 (file)
@@ -203,12 +203,16 @@ static void hdmi_wq_set_video(struct hdmi *hdmi)
                video->vic = hdmi->vic & HDMI_VIC_MASK;
                video->eotf = 0;
                if (hdmi->eotf) {
-                       if (hdmi->eotf & hdmi->edid.hdr.hdrinfo.eotf)
+                       if (hdmi->eotf & hdmi->edid.hdr.hdrinfo.eotf) {
                                video->eotf = hdmi->eotf;
-                       else
+                       } else {
                                pr_err("sink eotf %x not support eotf %x\n",
                                       hdmi->edid.hdr.hdrinfo.eotf,
                                       hdmi->eotf);
+                               if (hdmi->edid.hdr.hdrinfo.eotf &
+                                   EOTF_TRADITIONAL_GMMA_SDR)
+                                       video->eotf = EOTF_TRADITIONAL_GMMA_SDR;
+                       }
                }
                /* ST_2084 must be 10bit and bt2020 */
                if (video->eotf & EOTF_ST_2084) {
index 37e0af0e8d0d966a1e3186f77063fae0d74b227d..49ecc91cd54468fcddb97b567e1803200d254b8d 100644 (file)
@@ -258,12 +258,14 @@ static int hdmi_set_color(struct rk_display_device *device,
        } else if (!strncmp(buf, "hdr", 3)) {
                if (sscanf(buf, "hdr=%d", &value) == -1)
                        return -1;
-               pr_debug("current hdr eotf is %d input hdr eotf is %d\n",
-                        hdmi->eotf, value);
+               pr_info("current hdr eotf is %d input hdr eotf is %d\n",
+                       hdmi->eotf, value);
                if (hdmi->eotf != value &&
-                   (hdmi->eotf & hdmi->edid.hdr.hdrinfo.eotf ||
+                   (value & hdmi->edid.hdr.hdrinfo.eotf ||
                     hdmi->eotf == 0))
                        hdmi->eotf = value;
+               else
+                       return 0;
        } else {
                return -1;
        }
index e364897d7dcac0296e95c16a6361e92f325cc3bd..9f3cd60a0e8145422f82a2f82505e884c9f4bee8 100644 (file)
@@ -1620,7 +1620,7 @@ static void hdmi_dev_config_hdr(struct hdmi_dev *hdmi_dev,
                return;
 
        hdmi_writel(hdmi_dev, FC_DRM_HB, 1);/*verion = 0x1*/
-       hdmi_writel(hdmi_dev, (FC_DRM_HB + 1), 27);/*length of following data*/
+       hdmi_writel(hdmi_dev, (FC_DRM_HB + 1), 26);/*length of following data*/
        hdmi_writel(hdmi_dev, FC_DRM_PB, eotf / 2);
        hdmi_writel(hdmi_dev, FC_DRM_PB + 1, 0);