video: fbmon: add HDMI dectetion to fbmod edid parsing
Erik Gilling [Mon, 7 Feb 2011 03:32:17 +0000 (19:32 -0800)]
Looks for ieee registration numver 0x000c03 as per HDMI spec.

Change-Id: I6875b24c66e8754510edabcb4f9ba682a50d6ac1
Signed-off-by: Erik Gilling <konkers@android.com>

drivers/video/fbmon.c
include/linux/fb.h

index 4f57485..c648562 100644 (file)
@@ -1001,13 +1001,22 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
        while (pos < edid[2]) {
                u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7;
                pr_debug("Data block %u of %u bytes\n", type, len);
-               if (type == 2)
+               if (type == 2) {
                        for (i = pos; i < pos + len; i++) {
                                u8 idx = edid[pos + i] & 0x7f;
                                svd[svd_n++] = idx;
                                pr_debug("N%sative mode #%d\n",
                                         edid[pos + i] & 0x80 ? "" : "on-n", idx);
                        }
+               } else if (type == 0x3) {
+                       if (len >= 3) {
+                               u32 ieee_reg = edid[pos] |
+                                       (edid[pos + 1] << 8) |
+                                       (edid[pos + 2] << 16);
+                               if (ieee_reg == 0x000c03)
+                                       specs->misc |= FB_MISC_HDMI;
+                       }
+               }
                pos += len + 1;
        }
 
index 1d6836c..6119551 100644 (file)
@@ -439,6 +439,8 @@ struct file;
 
 #define FB_MISC_PRIM_COLOR     1
 #define FB_MISC_1ST_DETAIL     2       /* First Detailed Timing is preferred */
+#define FB_MISC_HDMI           4       /* display supports HDMI signaling */
+
 struct fb_chroma {
        __u32 redx;     /* in fraction of 1024 */
        __u32 greenx;