aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-18 12:25:34 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-12-30 11:34:26 +0100
commite2648c6cbc73deb17b80d2e8e1f50daf8686b1c8 (patch)
treea3989b1df729af84f25716723a2723813716c451
parent046bb92ce0ef1c797068d211dea38e1f92500068 (diff)
edid-decode: support VTDBs in VFPDB
The VFPDB now supports references to VTDBs as well. Add support for this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--edid-decode.h6
-rw-r--r--parse-cta-block.cpp37
-rw-r--r--parse-displayid-block.cpp12
3 files changed, 53 insertions, 2 deletions
diff --git a/edid-decode.h b/edid-decode.h
index 030bb07..7e02615 100644
--- a/edid-decode.h
+++ b/edid-decode.h
@@ -122,6 +122,8 @@ struct edid_state {
memset(cta.preparsed_has_vic, 0, sizeof(cta.preparsed_has_vic));
cta.preparsed_phys_addr = 0xffff;
cta.preparse_total_dtds = 0;
+ cta.preparse_total_vtdbs = 0;
+ cta.preparse_has_t8vtdb = false;
// DisplayID block state
dispid.version = 0;
@@ -189,7 +191,11 @@ struct edid_state {
struct {
unsigned preparse_total_dtds;
vec_timings_ext vec_dtds;
+ unsigned preparse_total_vtdbs;
+ vec_timings_ext vec_vtdbs;
vec_timings_ext preferred_timings;
+ bool preparse_has_t8vtdb;
+ timings_ext t8vtdb;
vec_timings_ext native_timings;
bool has_vic_1;
bool first_svd_might_be_preferred;
diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index 7a2ff8a..bd708ba 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -540,6 +540,24 @@ void edid_state::cta_vfpdb(const unsigned char *x, unsigned length)
printf(" %s\n", suffix);
cta.preferred_timings.push_back(timings_ext(svr, suffix));
}
+ } else if (svr >= 145 && svr <= 160) {
+ sprintf(suffix, "VTDB %3u", svr - 144);
+ if (svr >= cta.preparse_total_vtdbs + 145) {
+ printf(" %s: Invalid\n", suffix);
+ fail("Invalid VTDB %u.\n", svr - 144);
+ } else {
+ printf(" %s\n", suffix);
+ cta.preferred_timings.push_back(timings_ext(svr, suffix));
+ }
+ } else if (svr == 254) {
+ sprintf(suffix, "T8VTDB");
+ if (!cta.preparse_has_t8vtdb) {
+ printf(" %s: Invalid\n", suffix);
+ fail("Invalid T8VTDB.\n");
+ } else {
+ printf(" %s\n", suffix);
+ cta.preferred_timings.push_back(timings_ext(svr, suffix));
+ }
}
}
}
@@ -2031,6 +2049,13 @@ void edid_state::preparse_cta_block(const unsigned char *x)
case 0x07:
if (x[i + 1] == 0x0d)
cta.has_vfpdb = true;
+ if (x[i + 1] == 0x22)
+ cta.preparse_total_vtdbs++;
+ if (x[i + 1] == 0x23)
+ cta.preparse_has_t8vtdb = true;
+ if (x[i + 1] == 0x32)
+ cta.preparse_total_vtdbs +=
+ ((x[i] & 0x1f) - 2) / (6 + ((x[i + 2] & 0x70) >> 4));
if (x[i + 1] != 0x0e)
continue;
for_ycbcr420 = true;
@@ -2167,8 +2192,16 @@ void edid_state::parse_cta_block(const unsigned char *x)
void edid_state::cta_resolve_svr(vec_timings_ext::iterator iter)
{
- iter->flags = cta.vec_dtds[iter->svr() - 129].flags;
- iter->t = cta.vec_dtds[iter->svr() - 129].t;
+ if (iter->svr() == 254) {
+ iter->flags = cta.t8vtdb.flags;
+ iter->t = cta.t8vtdb.t;
+ } else if (iter->svr() <= 144) {
+ iter->flags = cta.vec_dtds[iter->svr() - 129].flags;
+ iter->t = cta.vec_dtds[iter->svr() - 129].t;
+ } else {
+ iter->flags = cta.vec_vtdbs[iter->svr() - 145].flags;
+ iter->t = cta.vec_vtdbs[iter->svr() - 145].t;
+ }
}
void edid_state::cta_resolve_svrs()
diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index 7036860..6736987 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -321,6 +321,10 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x,
}
print_timings(" ", &t, "DTD", s.c_str(), true);
+ if (is_cta) {
+ timings_ext te(t, "DTD", s);
+ cta.vec_vtdbs.push_back(te);
+ }
}
// tag 0x04
@@ -464,6 +468,10 @@ void edid_state::parse_displayid_type_4_8_timing(unsigned char type, unsigned sh
}
if (t)
print_timings(" ", t, type_name);
+ if (t && is_cta && !cta.t8vtdb.is_valid()) {
+ timings_ext te(*t, type_name, "");
+ cta.t8vtdb = te;
+ }
}
// tag 0x09
@@ -1355,6 +1363,10 @@ void edid_state::parse_displayid_type_10_timing(const unsigned char *x, bool is_
edid_cvt_mode(1 + x[5], t);
print_timings(" ", &t, "CVT", s.c_str());
+ if (is_cta) {
+ timings_ext te(t, "CVT", s);
+ cta.vec_vtdbs.push_back(te);
+ }
}
// tag 0x7e, OUI 3A-02-92 (VESA)

Privacy Policy