[PATCH edid-decode 1/3] Do the EDID version parsing before anything else

Tormod Volden lists.tormod at gmail.com
Tue Dec 20 13:17:24 PST 2011


From: Tormod Volden <debian.tormod at gmail.com>

So that the version conformance flags can be used in other code.

Signed-off-by: Tormod Volden <debian.tormod at gmail.com>
---
 edid-decode.c |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index ab4bde8..c3e556f 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -944,6 +944,25 @@ int main(int argc, char **argv)
 	// return 1;
     }
 
+    printf("EDID version: %hd.%hd\n", edid[0x12], edid[0x13]);
+    if (edid[0x12] == 1) {
+	if (edid[0x13] > 4) {
+	    printf("Claims > 1.4, assuming 1.4 conformance\n");
+	    edid[0x13] = 4;
+	}
+	switch (edid[0x13]) {
+	case 4:
+	    claims_one_point_four = 1;
+	case 3:
+	    claims_one_point_three = 1;
+	case 2:
+	    claims_one_point_two = 1;
+	default:
+	    break;
+	}
+	claims_one_point_oh = 1;
+    }
+
     printf("Manufacturer: %s Model %x Serial Number %u\n",
 	    manufacturer_name(edid + 0x08),
 	    (unsigned short)(edid[0x0A] + (edid[0x0B] << 8)),
@@ -967,25 +986,6 @@ int main(int argc, char **argv)
 	}
     }
 
-    printf("EDID version: %hd.%hd\n", edid[0x12], edid[0x13]);
-    if (edid[0x12] == 1) {
-	if (edid[0x13] > 4) {
-	    printf("Claims > 1.4, assuming 1.4 conformance\n");
-	    edid[0x13] = 4;
-	}
-	switch (edid[0x13]) {
-	case 4:
-	    claims_one_point_four = 1;
-	case 3:
-	    claims_one_point_three = 1;
-	case 2:
-	    claims_one_point_two = 1;
-	default:
-	    break;
-	}
-	claims_one_point_oh = 1;
-    }
-
     /* display section */
 
     if (edid[0x14] & 0x80) {
-- 
1.7.5.4



More information about the xorg-devel mailing list