"smpte30hz",
"smpte50hz",
"smpte60hz",
- "smpte50hz420",
- "smpte60hz420",
"2160p50hz",
"2160p60hz",
- "2160p50hz420",
- "2160p60hz420",
NULL
};
+static int is_4k50_fmt(char *mode)
+{
+ int i;
+ static char const *hdmi4k50[] = {
+ "2160p50hz",
+ "2160p60hz",
+ "smpte50hz",
+ "smpte50hz",
+ NULL
+ };
+
+ for (i = 0; hdmi4k50[i]; i++) {
+ if (strcmp(hdmi4k50[i], mode) == 0)
+ return 1;
+ }
+ return 0;
+}
+
/**/
static ssize_t show_disp_cap(struct device *dev,
struct device_attribute *attr, char *buf)
const char *native_disp_mode =
hdmitx_edid_get_native_VIC(&hdmitx_device);
enum hdmi_vic vic;
+ char mode_tmp[32];
if (hdmitx_device.tv_no_edid) {
pos += snprintf(buf+pos, PAGE_SIZE, "null edid\n");
} else {
for (i = 0; disp_mode_t[i]; i++) {
- vic = hdmitx_edid_get_VIC(&hdmitx_device,
- disp_mode_t[i], 0);
+ memset(mode_tmp, 0, sizeof(mode_tmp));
+ strncpy(mode_tmp, disp_mode_t[i], sizeof(mode_tmp));
+ vic = hdmitx_edid_get_VIC(&hdmitx_device, mode_tmp, 0);
+ /* Handling only 4k420 mode */
+ if (vic == HDMI_Unknown) {
+ if (is_4k50_fmt(mode_tmp)) {
+ strcat(mode_tmp, "420");
+ vic = hdmitx_edid_get_VIC(&hdmitx_device,
+ mode_tmp, 0);
+ }
+ }
if (vic != HDMI_Unknown) {
pos += snprintf(buf+pos, PAGE_SIZE, "%s",
disp_mode_t[i]);
pos += snprintf(buf + pos, PAGE_SIZE, "420,8bit\n");
goto next444;
}
+ vic = hdmitx_edid_get_VIC(&hdmitx_device, "smpte60hz420", 0);
+ if (vic != HDMI_Unknown) {
+ pos += snprintf(buf + pos, PAGE_SIZE, "420,8bit\n");
+ goto next444;
+ }
+ vic = hdmitx_edid_get_VIC(&hdmitx_device, "smpte50hz420", 0);
+ if (vic != HDMI_Unknown) {
+ pos += snprintf(buf + pos, PAGE_SIZE, "420,8bit\n");
+ goto next444;
+ }
}
next444:
if (pRXCap->dc_y444) {