aboutsummaryrefslogtreecommitdiffstats
path: root/parse-displayid-block.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-23 09:43:44 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-12-30 11:34:26 +0100
commit95d81c95f89424bc5ff541d941eeea4addeeda1c (patch)
treefda0b956366d893ee492300b0e327e8562c0978c /parse-displayid-block.cpp
parentfa87c71f11a17400def68dad20dc26fd0c447dcd (diff)
edid-decode: use DTD or T10VTDB for a T7VTDB if possible
Check if a T7VTDB can also be represented by a DTD or a T10VTDB. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-displayid-block.cpp')
-rw-r--r--parse-displayid-block.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index 44b8bec..96c8191 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -324,6 +324,28 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x,
if (is_cta) {
timings_ext te(t, "DTD", s);
cta.vec_vtdbs.push_back(te);
+
+ // Only use a T7VTDB if is cannot be expressed by a
+ // DTD or a T10VTDB.
+ if (t.hact <= 4095 && t.vact <= 4095 &&
+ t.pixclk_khz <= 655360 && !(x[3] & 0xe0)) {
+ fail("This T7VTDB can be represented as an 18-byte DTD.\n");
+ return;
+ }
+ unsigned htot = t.hact + t.hfp + t.hsync + t.hbp;
+ unsigned vtot = t.vact + t.vfp + t.vsync + t.vbp;
+ unsigned refresh = (t.pixclk_khz * 1000ULL) / (htot * vtot);
+
+ for (unsigned rb = 0; rb <= 3; rb++) {
+ timings cvt_t = calc_cvt_mode(refresh, t.hact, t.vact, rb);
+ if (match_timings(t, cvt_t)) {
+ fail("This T7VTDB can be represented as a T10VTDB.\n");
+ return;
+ }
+ }
+ timings cvt_t = calc_cvt_mode(refresh, t.hact, t.vact, 3 | RB_FLAG);
+ if (match_timings(t, cvt_t))
+ fail("This T7VTDB can be represented as a T10VTDB.\n");
}
}

Privacy Policy