Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: Check EDID for HDMI connection

Check EDID Vendor Specific Data Block bytes to see if the connection
is HDMI and set FB_MISC_HDMI.

Signed-off-by: David Ung <davidu@nvidia.com>
Signed-off-by: Christopher Freeman <cfreeman@nvidia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

authored by

David Ung and committed by
Tomi Valkeinen
e6853aaf f474f0e1

+9 -1
+8 -1
drivers/video/fbdev/core/fbmon.c
··· 1012 1012 while (pos < edid[2]) { 1013 1013 u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7; 1014 1014 pr_debug("Data block %u of %u bytes\n", type, len); 1015 - if (type == 2) 1015 + if (type == 2) { 1016 1016 for (i = pos; i < pos + len; i++) { 1017 1017 u8 idx = edid[pos + i] & 0x7f; 1018 1018 svd[svd_n++] = idx; 1019 1019 pr_debug("N%sative mode #%d\n", 1020 1020 edid[pos + i] & 0x80 ? "" : "on-n", idx); 1021 1021 } 1022 + } else if (type == 3 && len >= 3) { 1023 + /* Check Vendor Specific Data Block. For HDMI, 1024 + it is always 00-0C-03 for HDMI Licensing, LLC. */ 1025 + if (edid[pos + 1] == 3 && edid[pos + 2] == 0xc && 1026 + edid[pos + 3] == 0) 1027 + specs->misc |= FB_MISC_HDMI; 1028 + } 1022 1029 pos += len + 1; 1023 1030 } 1024 1031
+1
include/linux/fb.h
··· 47 47 48 48 #define FB_MISC_PRIM_COLOR 1 49 49 #define FB_MISC_1ST_DETAIL 2 /* First Detailed Timing is preferred */ 50 + #define FB_MISC_HDMI 4 50 51 struct fb_chroma { 51 52 __u32 redx; /* in fraction of 1024 */ 52 53 __u32 greenx;