[Intel-gfx] [edid-decode 1/7] Print the resolutions next to the CEA VICs

Damien Lespiau damien.lespiau at intel.com
Wed Aug 7 15:58:17 CEST 2013


Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 edid-decode.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 82 insertions(+), 2 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index 9840db6..7515181 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -32,6 +32,8 @@
 #include <time.h>
 #include <ctype.h>
 
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
+
 static int claims_one_point_oh = 0;
 static int claims_one_point_two = 0;
 static int claims_one_point_three = 0;
@@ -569,14 +571,92 @@ cea_audio_block(unsigned char *x)
     }
 }
 
+static const char *edid_cea_modes[] = {
+    "640x480 at 60Hz",
+    "720x480 at 60Hz",
+    "720x480 at 60Hz",
+    "1280x720 at 60Hz",
+    "1920x1080i at 60Hz",
+    "1440x480i at 60Hz",
+    "1440x480i at 60Hz",
+    "1440x240 at 60Hz",
+    "1440x240 at 60Hz",
+    "2880x480i at 60Hz",
+    "2880x480i at 60Hz"
+    "2880x240 at 60Hz",
+    "2880x240 at 60Hz",
+    "1440x480 at 60Hz",
+    "1440x480 at 60Hz",
+    "1920x1080 at 60Hz",
+    "720x576 at 50Hz",
+    "720x576 at 50Hz",
+    "1280x720 at 50Hz",
+    "1920x1080i at 50Hz",
+    "1440x576i at 50Hz",
+    "1440x576i at 50Hz",
+    "1440x288 at 50Hz",
+    "1440x288 at 50Hz",
+    "2880x576i at 50Hz",
+    "2880x576i at 50Hz",
+    "2880x288 at 50Hz",
+    "2880x288 at 50Hz",
+    "1440x576 at 50Hz",
+    "1440x576 at 50Hz",
+    "1920x1080 at 50Hz",
+    "1920x1080 at 24Hz",
+    "1920x1080 at 25Hz",
+    "1920x1080 at 30Hz",
+    "2880x480 at 60Hz",
+    "2880x480 at 60Hz",
+    "2880x576 at 50Hz",
+    "2880x576 at 50Hz",
+    "1920x1080i at 50Hz",
+    "1920x1080i at 100Hz",
+    "1280x720 at 100Hz",
+    "720x576 at 100Hz",
+    "720x576 at 100Hz",
+    "1440x576 at 100Hz",
+    "1440x576 at 100Hz",
+    "1920x1080i at 120Hz",
+    "1280x720 at 120Hz",
+    "720x480 at 120Hz",
+    "720x480 at 120Hz",
+    "1440x480i at 120Hz",
+    "1440x480i at 120Hz",
+    "720x576 at 200Hz",
+    "720x576 at 200Hz",
+    "1440x576i at 200Hz",
+    "1440x576i at 200Hz",
+    "720x480 at 240Hz",
+    "720x480 at 240Hz",
+    "1440x480i at 240Hz",
+    "1440x480i at 240Hz",
+    "1280x720 at 24Hz",
+    "1280x720 at 25Hz",
+    "1280x720 at 30Hz",
+    "1920x1080 at 120Hz",
+    "1920x1080 at 100Hz",
+};
+
 static void
 cea_video_block(unsigned char *x)
 {
     int i;
     int length = x[0] & 0x1f;
 
-    for (i = 1; i < length; i++)
-	printf("    VIC %02d %s\n", x[i] & 0x7f, x[i] & 0x80 ? "(native)" : "");
+    for (i = 1; i < length; i++)  {
+	unsigned char vic = x[i] & 0x7f;
+	unsigned char native = x[i] & 0x80;
+	const char *mode;
+
+	vic--;
+	if (vic < ARRAY_SIZE(edid_cea_modes))
+	    mode = edid_cea_modes[vic];
+	else
+	    mode = "Unknown mode";
+
+	printf("    VIC %02d %s %s\n", vic, mode, native ? "(native)" : "");
+    }
 }
 
 static void
-- 
1.8.3.1




More information about the Intel-gfx mailing list