aboutsummaryrefslogtreecommitdiffstats
path: root/parse-displayid-block.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-12 12:08:08 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-12 12:08:08 +0200
commitc5d0f39107ab1dfc2939580de30146b27e8dbf2c (patch)
tree22a047dfd2245b9bc7bec36383a08c1e6799cf3c /parse-displayid-block.cpp
parent3c5a9a29d0eeb27c74813bb2b91b8e0c51ed4f76 (diff)
edid-decode: add DisplayID preferred timings
List the preferred timings as per the DisplayID extension blocks. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-displayid-block.cpp')
-rw-r--r--parse-displayid-block.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index 961b121..5301406 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -264,7 +264,8 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x, bool ty
break;
default:
s += "undefined";
- fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
+ if ((x[3] & 0xf) > 8)
+ fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
break;
}
switch ((x[3] >> 5) & 0x3) {
@@ -304,8 +305,10 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x, bool ty
t.vsync /= 2;
t.vbp /= 2;
}
- if (x[3] & 0x80)
+ if (x[3] & 0x80) {
s += ", preferred";
+ dispid.preferred_timings.push_back(timings_ext(t, "DTD", s));
+ }
print_timings(" ", &t, "DTD", s.c_str(), true);
}
@@ -360,8 +363,10 @@ void edid_state::parse_displayid_type_2_timing(const unsigned char *x)
fail("Reserved stereo 0x03.\n");
break;
}
- if (x[3] & 0x80)
+ if (x[3] & 0x80) {
s += ", preferred";
+ dispid.preferred_timings.push_back(timings_ext(t, "DTD", s));
+ }
print_timings(" ", &t, "DTD", s.c_str(), true);
}
@@ -415,7 +420,8 @@ void edid_state::parse_displayid_type_3_timing(const unsigned char *x)
break;
default:
s += "undefined";
- fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
+ if ((x[3] & 0xf) > 8)
+ fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
break;
}
@@ -425,8 +431,10 @@ void edid_state::parse_displayid_type_3_timing(const unsigned char *x)
edid_cvt_mode(1 + (x[2] & 0x7f), t);
- if (x[0] & 0x80)
+ if (x[0] & 0x80) {
s += ", preferred";
+ dispid.preferred_timings.push_back(timings_ext(t, "CVT", s));
+ }
print_timings(" ", &t, "CVT", s.c_str());
}
@@ -868,8 +876,6 @@ void edid_state::parse_displayid_type_5_timing(const unsigned char *x)
}
if (x[0] & 0x10)
s += ", refresh rate * (1000/1001) supported";
- if (x[0] & 0x80)
- s += ", preferred";
switch (x[0] & 0x03) {
case 0: t.rb = 2; break;
@@ -879,6 +885,11 @@ void edid_state::parse_displayid_type_5_timing(const unsigned char *x)
edid_cvt_mode(1 + x[6], t);
+ if (x[0] & 0x80) {
+ s += ", preferred";
+ dispid.preferred_timings.push_back(timings_ext(t, "CVT", s));
+ }
+
print_timings(" ", &t, "CVT", s.c_str());
}
@@ -1007,8 +1018,10 @@ void edid_state::parse_displayid_type_6_timing(const unsigned char *x)
break;
}
- if (x[2] & 0x80)
+ if (x[2] & 0x80) {
s += ", preferred";
+ dispid.preferred_timings.push_back(timings_ext(t, "DTD", s));
+ }
print_timings(" ", &t, "DTD", s.c_str(), true);
}

Privacy Policy