summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hansverk@cisco.com>2017-08-31 13:41:12 +0200
committerAdam Jackson <ajax@redhat.com>2017-09-07 12:13:32 -0400
commitf1799a90e4a7ff114cfb24ad6ea0660159dd94a5 (patch)
tree73269cb9fcfdf8f06c19c01212046a02cdbf770d
parent4798aef8b6f16d86e6d03f8e1667fc2da6ad37d1 (diff)
edid-decode: fix 1.3/1.4 differences in Model Year and Feature Support
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@cisco.com>
-rw-r--r--edid-decode.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/edid-decode.c b/edid-decode.c
index ed725ff..660ae7a 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;