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 d2e05e8ccd9b..edaaf59c40fc 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 @@ -47,6 +47,7 @@ #include #include +#include #include #include #ifdef CONFIG_AMLOGIC_SND_SOC @@ -2170,7 +2171,7 @@ static int is_4k50_fmt(char *mode) "2160p50hz", "2160p60hz", "smpte50hz", - "smpte50hz", + "smpte60hz", NULL }; @@ -2181,6 +2182,33 @@ static int is_4k50_fmt(char *mode) return 0; } +static int is_4k_fmt(char *mode) +{ + int i; + static char const *hdmi4k[] = { + "2160p", + "smpte", + NULL + }; + + for (i = 0; hdmi4k[i]; i++) { + if (strstr(mode, hdmi4k[i])) + return 1; + } + return 0; +} + +/* below items has feature limited, may need extra judgement */ +static bool hdmitx_limited_1080p(void) +{ + if (is_meson_gxl_package_805X()) + return 1; + else if (is_meson_gxl_package_805Y()) + return 1; + else + return 0; +} + /**/ static ssize_t show_disp_cap(struct device *dev, struct device_attribute *attr, char *buf) @@ -2197,6 +2225,8 @@ static ssize_t show_disp_cap(struct device *dev, for (i = 0; disp_mode_t[i]; i++) { memset(mode_tmp, 0, sizeof(mode_tmp)); strncpy(mode_tmp, disp_mode_t[i], 31); + if (hdmitx_limited_1080p() && is_4k_fmt(mode_tmp)) + continue; vic = hdmitx_edid_get_VIC(&hdmitx_device, mode_tmp, 0); /* Handling only 4k420 mode */ if (vic == HDMI_Unknown) {