hdmitx: add colorimetry feature to vpp
authorYi Zhou <yi.zhou@amlogic.com>
Fri, 2 Mar 2018 08:38:20 +0000 (16:38 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 13 Mar 2018 07:25:00 +0000 (23:25 -0800)
PD#161350: hdmitx: add colorimetry feature to vpp

Some special TVs just define HDR static Metadata,but don't
define colorimetry block. Therefore, hdmitx should use
another feature to accurately indicate HDR function

Change-Id: I8d9a9243c2e0fbcf8c938625aa8d2a20b1441a1b
Signed-off-by: Yi Zhou <yi.zhou@amlogic.com>
drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c
drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c
include/linux/amlogic/media/vout/vinfo.h

index 35b6097..9ac0b02 100644 (file)
@@ -2031,6 +2031,8 @@ int hdmitx_edid_parse(struct hdmitx_dev *hdmitx_device)
                                (pRXCap->hdr_sup_eotf_hdr << 1) |
                                (pRXCap->hdr_sup_eotf_smpte_st_2084 << 2) |
                                (pRXCap->hdr_sup_eotf_hlg << 3);
+                       info->hdr_info.colorimetry_support =
+                               pRXCap->colorimetry_data;
                        info->hdr_info.lumi_max = pRXCap->hdr_lum_max;
                        info->hdr_info.lumi_avg = pRXCap->hdr_lum_avg;
                        info->hdr_info.lumi_min = pRXCap->hdr_lum_min;
index 3d7bbd6..2843456 100644 (file)
@@ -397,7 +397,10 @@ static int set_disp_mode_auto(void)
                (strncmp(info->name, "null", 4) == 0))) {
                info->hdr_info.hdr_support = (hdev->RXCap.hdr_sup_eotf_sdr << 0)
                                | (hdev->RXCap.hdr_sup_eotf_hdr << 1)
-                               | (hdev->RXCap.hdr_sup_eotf_smpte_st_2084 << 2);
+                               | (hdev->RXCap.hdr_sup_eotf_smpte_st_2084 << 2)
+                               | (hdev->RXCap.hdr_sup_eotf_hlg << 3);
+               info->hdr_info.colorimetry_support =
+                       hdev->RXCap.colorimetry_data;
                info->hdr_info.lumi_max = hdev->RXCap.hdr_lum_max;
                info->hdr_info.lumi_avg = hdev->RXCap.hdr_lum_avg;
                info->hdr_info.lumi_min = hdev->RXCap.hdr_lum_min;
@@ -1891,6 +1894,8 @@ static ssize_t show_hdr_cap(struct device *dev,
                pRXCap->hdr_lum_avg);
        pos += snprintf(buf + pos, PAGE_SIZE, "    Min: %d\n",
                pRXCap->hdr_lum_min);
+       pos += snprintf(buf + pos, PAGE_SIZE, "    colorimetry_data: %x\n",
+               pRXCap->colorimetry_data);
 
        return pos;
 }
@@ -2990,6 +2995,7 @@ static void clear_hdr_info(struct hdmitx_dev *hdev)
 
        if (info) {
                info->hdr_info.hdr_support = 0;
+               info->hdr_info.colorimetry_support = 0;
                info->hdr_info.lumi_max = 0;
                info->hdr_info.lumi_avg = 0;
                info->hdr_info.lumi_min = 0;
index 46a0a8f..21e3617 100644 (file)
@@ -56,6 +56,9 @@ struct master_display_info_s {
 
 struct hdr_info {
        u32 hdr_support; /* RX EDID hdr support types */
+       /*bit7:BT2020RGB    bit6:BT2020YCC bit5:BT2020cYCC bit4:adobeRGB*/
+       /*bit3:adobeYCC601 bit2:sYCC601     bit1:xvYCC709    bit0:xvYCC601*/
+       u8 colorimetry_support; /* RX EDID colorimetry support types */
        u32 lumi_max; /* RX EDID Lumi Max value */
        u32 lumi_avg; /* RX EDID Lumi Avg value */
        u32 lumi_min; /* RX EDID Lumi Min value */