[PATCH 19/27] edid-decode: fix 1.3/1.4 differences in Model Year and Feature Support

Hans Verkuil hverkuil at xs4all.nl
Thu Aug 31 11:41:12 UTC 2017


From: Hans Verkuil <hansverk at cisco.com>

The Model Year is only available in 1.4. And in 1.3 bits 4-3 are always
for the Display Type.

Signed-off-by: Hans Verkuil <hansverk at cisco.com>
---
 edid-decode.c | 43 +++++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index ed725ff4..660ae7a9 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -2157,6 +2157,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)),
@@ -2167,7 +2186,7 @@ int main(int argc, char **argv)
 
     time(&the_time);
     ptm = localtime(&the_time);
-    if (edid[0x10] < 55 || edid[0x10] == 0xff) {
+    if (edid[0x10] < 55 || (edid[0x10] == 0xff && claims_one_point_four)) {
 	has_valid_week = 1;
 	if (edid[0x11] > 0x0f) {
 	    if (edid[0x10] == 0xff) {
@@ -2183,25 +2202,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) {
@@ -2294,8 +2294,7 @@ int main(int argc, char **argv)
 	printf("\n");
     }
 
-    /* FIXME: this is from 1.4 spec, check earlier */
-    if (analog) {
+    if (analog || !claims_one_point_four) {
 	switch (edid[0x18] & 0x18) {
 	case 0x00: printf("Monochrome or grayscale display\n"); break;
 	case 0x08: printf("RGB color display\n"); break;
-- 
2.14.1



More information about the xorg-devel mailing list