[PATCH 18/27] edid-decode: fix week/year interpretation.

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


From: Hans Verkuil <hans.verkuil at cisco.com>

Correctly interpret the week/year bytes.

Signed-off-by: Hans Verkuil <hans.verkuil at cisco.com>
---
 edid-decode.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/edid-decode.c b/edid-decode.c
index 38cd72b6..ed725ff4 100644
--- a/edid-decode.c
+++ b/edid-decode.c
@@ -2172,11 +2172,13 @@ int main(int argc, char **argv)
 	if (edid[0x11] > 0x0f) {
 	    if (edid[0x10] == 0xff) {
 		has_valid_year = 1;
-		printf("Made week %hd of model year %hd\n", edid[0x10],
-		       edid[0x11]);
+		printf("Model year %hd\n", edid[0x11] + 1990);
 	    } else if (edid[0x11] + 90 <= ptm->tm_year) {
 		has_valid_year = 1;
-		printf("Made week %hd of %hd\n", edid[0x10], edid[0x11] + 1990);
+		if (edid[0x10])
+			printf("Made in week %hd of %hd\n", edid[0x10], edid[0x11] + 1990);
+		else
+			printf("Made in year %hd\n", edid[0x11] + 1990);
 	    }
 	}
     }
-- 
2.14.1



More information about the xorg-devel mailing list