diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-07-08 14:55:54 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-07-08 15:08:03 +0200 |
commit | 7dfbc959602d7ef28ed918a35fea9f5851ee1347 (patch) | |
tree | 09c5405b122a397d55fd0ae835bb4b871877907b /parse-base-block.cpp | |
parent | 7e0d77a5eef7af53a1d438666a6372fb329f31d9 (diff) |
edid-decode: drop dtd_cnt for non-CTA/Block-0 DTDs
The VFPDB in the CTA extensions can refer to DTDs by their index,
but that only applies to DTDs in block 0 and in CTA blocks, the
DTDs in other extension blocks are ignored. So just show them
as "DTD" without a counter.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-base-block.cpp')
-rw-r--r-- | parse-base-block.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/parse-base-block.cpp b/parse-base-block.cpp index 9f0147e..14cea1e 100644 --- a/parse-base-block.cpp +++ b/parse-base-block.cpp @@ -1205,13 +1205,16 @@ void edid_state::detailed_epi(const unsigned char *x) printf(" EPI Version: %u.%u\n", (x[17] & 0xf0) >> 4, x[17] & 0x0f); } -void edid_state::detailed_timings(const char *prefix, const unsigned char *x) +void edid_state::detailed_timings(const char *prefix, const unsigned char *x, + bool base_or_cta) { struct timings t = {}; unsigned hbl, vbl; std::string s_sync, s_flags; - dtd_cnt++; + // Only count DTDs in base block 0 or CTA extension blocks + if (base_or_cta) + dtd_cnt++; data_block = "Detailed Timing Descriptor #" + std::to_string(dtd_cnt); t.pixclk_khz = (x[0] + (x[1] << 8)) * 10; if (t.pixclk_khz < 10000) { @@ -1324,11 +1327,12 @@ void edid_state::detailed_timings(const char *prefix, const unsigned char *x) calc_ratio(&t); - bool ok = print_timings(prefix, &t, dtd_type().c_str(), s_flags.c_str(), true); + std::string s_type = base_or_cta ? dtd_type() : "DTD"; + bool ok = print_timings(prefix, &t, s_type.c_str(), s_flags.c_str(), true); - if (block_nr == 0 && dtd_cnt == 1) { + if (block_nr == 0 && dtd_cnt == 1 && base_or_cta) { preferred_timings = t; - preferred_type = dtd_type(); + preferred_type = s_type; preferred_flags = s_flags; } |