Merge "hdmitx: fix mismatch between dv_cap and dv_cap2 [1/1]" into odroidg12-4.9.y-android

This commit is contained in:
Chris
2020-06-11 17:44:36 +09:00
committed by Gerrit Code Review

View File

@@ -2241,6 +2241,64 @@ static void Edid_CVT_timing(struct rx_cap *prxcap, unsigned char *data)
}
}
static void check_dv_truly_support(struct hdmitx_dev *hdev, struct dv_info *dv)
{
struct rx_cap *prxcap = &hdev->rxcap;
unsigned int max_tmds_clk = 0;
if ((dv->ieeeoui == DV_IEEE_OUI) && (dv->ver <= 2)) {
/* check max tmds rate to determine if 4k60 DV can truly be
* supported.
*/
if (prxcap->Max_TMDS_Clock2) {
max_tmds_clk = prxcap->Max_TMDS_Clock2 * 5;
} else {
/* Default min is 74.25 / 5 */
if (prxcap->Max_TMDS_Clock1 < 0xf)
prxcap->Max_TMDS_Clock1 = 0x1e;
max_tmds_clk = prxcap->Max_TMDS_Clock1 * 5;
}
if (dv->ver == 0)
dv->sup_2160p60hz = dv->sup_2160p60hz &&
(max_tmds_clk >= 594);
if ((dv->ver == 1) && (dv->length == 0xB)) {
if (dv->low_latency == 0x00) {
/*standard mode */
dv->sup_2160p60hz = dv->sup_2160p60hz &&
(max_tmds_clk >= 594);
} else if (dv->low_latency == 0x01) {
/* both standard and LL are supported. 4k60 LL
* DV support should/can be determined using
* video formats supported inthe E-EDID as flag
* sup_2160p60hz might not be set.
*/
if ((dv->sup_2160p60hz ||
is_4k60_supported(prxcap)) &&
(max_tmds_clk >= 594))
dv->sup_2160p60hz = 1;
else
dv->sup_2160p60hz = 0;
}
}
if ((dv->ver == 1) && (dv->length == 0xE))
dv->sup_2160p60hz = dv->sup_2160p60hz &&
(max_tmds_clk >= 594);
if (dv->ver == 2) {
/* 4k60 DV support should be determined using video
* formats supported in the EEDID as flag sup_2160p60hz
* is not applicable for VSVDB V2.
*/
if (is_4k60_supported(prxcap) && (max_tmds_clk >= 594))
dv->sup_2160p60hz = 1;
else
dv->sup_2160p60hz = 0;
}
}
}
int hdmitx_edid_parse(struct hdmitx_dev *hdmitx_device)
{
unsigned char CheckSum;
@@ -2251,7 +2309,6 @@ int hdmitx_edid_parse(struct hdmitx_dev *hdmitx_device)
int idx[4];
struct rx_cap *prxcap = &hdmitx_device->rxcap;
struct dv_info *dv = &hdmitx_device->rxcap.dv_info;
unsigned int max_tmds_clk = 0;
if (check_dvi_hdmi_edid_valid(hdmitx_device->EDID_buf)) {
EDID_buf = hdmitx_device->EDID_buf;
@@ -2374,57 +2431,10 @@ int hdmitx_edid_parse(struct hdmitx_dev *hdmitx_device)
/* EDID parsing complete - check if 4k60/50 DV can be truly supported */
dv = &prxcap->dv_info;
if ((dv->ieeeoui == DV_IEEE_OUI) && (dv->ver <= 2)) {
/* check max tmds rate to determine if 4k60 DV can truly be
* supported.
*/
if (prxcap->Max_TMDS_Clock2) {
max_tmds_clk = prxcap->Max_TMDS_Clock2 * 5;
} else {
/* Default min is 74.25 / 5 */
if (prxcap->Max_TMDS_Clock1 < 0xf)
prxcap->Max_TMDS_Clock1 = 0x1e;
max_tmds_clk = prxcap->Max_TMDS_Clock1 * 5;
}
if (dv->ver == 0)
dv->sup_2160p60hz = dv->sup_2160p60hz &&
(max_tmds_clk >= 594);
check_dv_truly_support(hdmitx_device, dv);
dv = &prxcap->dv_info2;
check_dv_truly_support(hdmitx_device, dv);
if ((dv->ver == 1) && (dv->length == 0xB)) {
if (dv->low_latency == 0x00) {
/*standard mode */
dv->sup_2160p60hz = dv->sup_2160p60hz &&
(max_tmds_clk >= 594);
} else if (dv->low_latency == 0x01) {
/* both standard and LL are supported. 4k60 LL
* DV support should/can be determined using
* video formats supported inthe E-EDID as flag
* sup_2160p60hz might not be set.
*/
if ((dv->sup_2160p60hz ||
is_4k60_supported(prxcap)) &&
(max_tmds_clk >= 594))
dv->sup_2160p60hz = 1;
else
dv->sup_2160p60hz = 0;
}
}
if ((dv->ver == 1) && (dv->length == 0xE))
dv->sup_2160p60hz = dv->sup_2160p60hz &&
(max_tmds_clk >= 594);
if (dv->ver == 2) {
/* 4k60 DV support should be determined using video
* formats supported in the EEDID as flag sup_2160p60hz
* is not applicable for VSVDB V2.
*/
if (is_4k60_supported(prxcap) && (max_tmds_clk >= 594))
dv->sup_2160p60hz = 1;
else
dv->sup_2160p60hz = 0;
}
}
edid_check_pcm_declare(&hdmitx_device->rxcap);
/*
* Because DTDs are not able to represent some Video Formats, which can be
@@ -2516,7 +2526,15 @@ int hdmitx_edid_parse(struct hdmitx_dev *hdmitx_device)
prxcap->ieeeoui = HDMI_IEEEOUI;
pr_info(EDID "Invalid edid, consider RX as HDMI device\n");
}
/* if sup_2160p60hz of dv is true, check the MAX_TMDS*/
dv = &prxcap->dv_info;
/* if sup_2160p60hz of dv or dv2 is true, check the MAX_TMDS*/
if (dv->sup_2160p60hz) {
if (prxcap->Max_TMDS_Clock2 * 5 < 590) {
dv->sup_2160p60hz = 0;
pr_info(EDID "clear sup_2160p60hz\n");
}
}
dv = &prxcap->dv_info2;
if (dv->sup_2160p60hz) {
if (prxcap->Max_TMDS_Clock2 * 5 < 590) {
dv->sup_2160p60hz = 0;