[PATCH edid-decode 2/9] Add missing VICs

Arnaud Vrac rawoul at gmail.com
Fri Jul 8 14:09:35 UTC 2016


From: Arnaud Vrac <avrac at freebox.fr>

---
 edid-decode.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 70 insertions(+), 10 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index fa851b4..ea3768b 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -703,30 +703,90 @@ static const char *edid_cea_modes[] = {
     "1280x720 at 30Hz",
     "1920x1080 at 120Hz",
     "1920x1080 at 100Hz",
+    "1280x720 at 24Hz",
+    "1280x720 at 25Hz",
+    "1280x720 at 30Hz",
+    "1280x720 at 50Hz",
+    "1280x720 at 60Hz",
+    "1280x720 at 100Hz",
+    "1280x720 at 120Hz",
+    "1920x1080 at 24Hz",
+    "1920x1080 at 25Hz",
+    "1920x1080 at 30Hz",
+    "1920x1080 at 50Hz",
+    "1920x1080 at 60Hz",
+    "1920x1080 at 100Hz",
+    "1920x1080 at 120Hz",
+    "1680x720 at 24Hz",
+    "1680x720 at 25Hz",
+    "1680x720 at 30Hz",
+    "1680x720 at 50Hz",
+    "1680x720 at 60Hz",
+    "1680x720 at 100Hz",
+    "1680x720 at 120Hz",
+    "2560x1080 at 24Hz",
+    "2560x1080 at 25Hz",
+    "2560x1080 at 30Hz",
+    "2560x1080 at 50Hz",
+    "2560x1080 at 60Hz",
+    "2560x1080 at 100Hz",
+    "2560x1080 at 120Hz",
+    "3840x2160 at 24Hz",
+    "3840x2160 at 25Hz",
+    "3840x2160 at 30Hz",
+    "3840x2160 at 50Hz",
+    "3840x2160 at 60Hz",
+    "4096x2160 at 24Hz",
+    "4096x2160 at 25Hz",
+    "4096x2160 at 30Hz",
+    "4096x2160 at 50Hz",
+    "4096x2160 at 60Hz",
+    "3840x2160 at 24Hz",
+    "3840x2160 at 25Hz",
+    "3840x2160 at 30Hz",
+    "3840x2160 at 50Hz",
+    "3840x2160 at 60Hz",
 };
 
 static void
-cea_video_block(unsigned char *x)
+cea_svd(unsigned char *x, int n)
 {
     int i;
-    int length = x[0] & 0x1f;
 
-    for (i = 1; i <= length; i++)  {
-	unsigned char vic = x[i] & 0x7f;
-	unsigned char native = x[i] & 0x80;
+    for (i = 0; i < n; i++)  {
+	unsigned char svd = x[i];
+	unsigned char native;
+	unsigned char vic;
 	const char *mode;
-	int index;
 
-	index = vic - 1;
-	if (index < ARRAY_SIZE(edid_cea_modes))
-	    mode = edid_cea_modes[index];
+	if ((svd & 0x7f) == 0)
+	    continue;
+
+	if ((svd - 1) & 0x40) {
+	    vic = svd;
+	    native = 0;
+	} else {
+	    vic = svd & 0x7f;
+	    native = svd & 0x80;
+	}
+
+	if (vic > 0 && vic <= ARRAY_SIZE(edid_cea_modes))
+	    mode = edid_cea_modes[vic - 1];
 	else
 	    mode = "Unknown mode";
 
-	printf("    VIC %02d %s %s\n", vic, mode, native ? "(native)" : "");
+	printf("    VIC %3d %s %s\n", vic, mode, native ? "(native)" : "");
     }
 }
 
+static void
+cea_video_block(unsigned char *x)
+{
+    int length = x[0] & 0x1f;
+
+    cea_svd(x + 1, length);
+}
+
 static const char *edid_cea_hdmi_modes[] = {
     "3840x2160 at 30Hz",
     "3840x2160 at 25Hz",
-- 
2.7.4



More information about the xorg-devel mailing list