From 221652b16b7ea846e6f89f7f4329bb9780064b47 Mon Sep 17 00:00:00 2001 From: Zongdong Jiao Date: Thu, 30 May 2019 20:08:41 +0800 Subject: [PATCH] hdmitx: edid: add suitable case for DolbyVision [1/1] PD#SWPL-7888 Problem: DV tests add more EDID cases v2_yuv444_2_yuv422_0_int_3_12Byte.xml v2_yuv444_0_yuv422_0_int_2_13Byte.xml v2_yuv444_0_yuv422_0_int_2_16Byte.xml Solution: add suitable case for DolbyVision Verify: G12/U212 Change-Id: I323d49ad34b12b6a12ba93f0349f0398f2516bcb Signed-off-by: Zongdong Jiao --- .../media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c | 19 ++++++++++++------- .../media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c | 11 ++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c index 02b7654..5d25b293 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_edid.c @@ -969,7 +969,8 @@ static void Edid_ParsingVendSpec(struct rx_cap *pRXCap, dv->block_flag = ERROR_LENGTH; } if (dv->ver == 2) { - if (dv->length == 0x0B) { + if ((dv->length == 0xB) || (dv->length == 0xC) + || (dv->length == 0xF)) { dv->sup_2160p60hz = 0x1;/*default*/ dv->dm_version = (dat[pos] >> 2) & 0x7; dv->sup_yuv422_12bit = dat[pos] & 0x1; @@ -998,7 +999,7 @@ static void Edid_ParsingVendSpec(struct rx_cap *pRXCap, dv->block_flag = ERROR_LENGTH; } - if (pos > dv->length) + if (pos > (dv->length + 1)) pr_info("hdmitx: edid: maybe invalid dv%d data\n", dv->ver); } @@ -2569,6 +2570,7 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev, { bool valid = 0; struct rx_cap *pRXCap = NULL; + const struct dv_info *dv = &(hdev->RXCap.dv_info); unsigned int rx_max_tmds_clk = 0; unsigned int calc_tmds_clk = 0; int i = 0; @@ -2663,9 +2665,11 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev, /* Rx may not support Y444 */ if (!(pRXCap->native_Mode & (1 << 5))) return 0; - if (pRXCap->dc_y444 && pRXCap->dc_30bit) + if ((pRXCap->dc_y444 && pRXCap->dc_30bit) + || (dv->sup_10b_12b_444 == 0x1)) rx_y444_max_dc = COLORDEPTH_30B; - if (pRXCap->dc_y444 && pRXCap->dc_36bit) + if ((pRXCap->dc_y444 && pRXCap->dc_36bit) + || (dv->sup_10b_12b_444 == 0x2)) rx_y444_max_dc = COLORDEPTH_36B; if (para->cd <= rx_y444_max_dc) valid = 1; @@ -2679,7 +2683,8 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev, return 0; if (pRXCap->dc_y444 && pRXCap->dc_30bit) rx_y422_max_dc = COLORDEPTH_30B; - if (pRXCap->dc_y444 && pRXCap->dc_36bit) + if ((pRXCap->dc_y444 && pRXCap->dc_36bit) + || (dv->sup_yuv422_12bit)) rx_y422_max_dc = COLORDEPTH_36B; if (para->cd <= rx_y422_max_dc) valid = 1; @@ -2689,9 +2694,9 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev, } if (para->cs == COLORSPACE_RGB444) { /* Always assume RX supports RGB444 */ - if (pRXCap->dc_30bit) + if ((pRXCap->dc_30bit) || (dv->sup_10b_12b_444 == 0x1)) rx_rgb_max_dc = COLORDEPTH_30B; - if (pRXCap->dc_36bit) + if ((pRXCap->dc_36bit) || (dv->sup_10b_12b_444 == 0x2)) rx_rgb_max_dc = COLORDEPTH_36B; if (para->cd <= rx_rgb_max_dc) valid = 1; diff --git a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c index c4c86f7..549bad7 100644 --- a/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c +++ b/drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c @@ -2462,6 +2462,7 @@ static ssize_t show_dc_cap(struct device *dev, enum hdmi_vic vic = HDMI_Unknown; int pos = 0; struct rx_cap *pRXCap = &(hdmitx_device.RXCap); + const struct dv_info *dv = &(hdmitx_device.RXCap.dv_info); #if 0 if (pRXCap->dc_48bit_420) @@ -2496,9 +2497,9 @@ static ssize_t show_dc_cap(struct device *dev, } next444: if (pRXCap->dc_y444) { - if (pRXCap->dc_36bit) + if ((pRXCap->dc_36bit) || (dv->sup_10b_12b_444 == 0x2)) pos += snprintf(buf + pos, PAGE_SIZE, "444,12bit\n"); - if (pRXCap->dc_30bit) { + if ((pRXCap->dc_30bit) || (dv->sup_10b_12b_444 == 0x1)) { pos += snprintf(buf + pos, PAGE_SIZE, "444,10bit\n"); pos += snprintf(buf + pos, PAGE_SIZE, "444,8bit\n"); } @@ -2506,7 +2507,7 @@ next444: if (pRXCap->dc_48bit) pos += snprintf(buf + pos, PAGE_SIZE, "444,16bit\n"); #endif - if (pRXCap->dc_36bit) + if ((pRXCap->dc_36bit) || (dv->sup_yuv422_12bit)) pos += snprintf(buf + pos, PAGE_SIZE, "422,12bit\n"); if (pRXCap->dc_30bit) { pos += snprintf(buf + pos, PAGE_SIZE, "422,10bit\n"); @@ -2524,9 +2525,9 @@ nextrgb: if (pRXCap->dc_48bit) pos += snprintf(buf + pos, PAGE_SIZE, "rgb,16bit\n"); #endif - if (pRXCap->dc_36bit) + if ((pRXCap->dc_36bit) || (dv->sup_10b_12b_444 == 0x2)) pos += snprintf(buf + pos, PAGE_SIZE, "rgb,12bit\n"); - if (pRXCap->dc_30bit) + if ((pRXCap->dc_30bit) || (dv->sup_10b_12b_444 == 0x1)) pos += snprintf(buf + pos, PAGE_SIZE, "rgb,10bit\n"); pos += snprintf(buf + pos, PAGE_SIZE, "rgb,8bit\n"); return pos; -- 2.7.4