From: Zheng Yang Date: Wed, 16 Nov 2016 11:26:24 +0000 (+0800) Subject: video: rockchip: hdmi: fix CTS HF1-53 HDR test X-Git-Tag: firefly_0821_release~635 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=53af51be75e679eaee136d24e5f0ab1af306c55f;p=firefly-linux-kernel-4.4.55.git video: rockchip: hdmi: fix CTS HF1-53 HDR test 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 (cherry picked from commit 39c34527e735b84e6ceb8a2e386aed0060111858) --- diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c b/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c index 70aa0ff0d238..c8e97df92c33 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmi-core.c @@ -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) { diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmi-sysfs.c b/drivers/video/rockchip/hdmi/rockchip-hdmi-sysfs.c index 37e0af0e8d0d..49ecc91cd544 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmi-sysfs.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmi-sysfs.c @@ -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; } diff --git a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c index e364897d7dca..9f3cd60a0e81 100644 --- a/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c +++ b/drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c @@ -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);