aboutsummaryrefslogtreecommitdiffstats
path: root/parse-vtb-ext-block.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-12 13:45:43 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-12 13:45:43 +0100
commit423cfc63206e20ca45c8cf4e968700688363a811 (patch)
tree895308c7110f7151a5f448a759c40ccc20094fcb /parse-vtb-ext-block.cpp
parent8f46a81ba8c7fb8d62e8f2b46735a956b0df8974 (diff)
edid-decode: major cleanup
This makes the layout of the parsed EDID data consistent. New sections start with 'Section Name:' and the following lines are one more indent to the right. Flags are shown as simple strings (no ':'). Values are shown as 'Value: 1234'. Also DMTs now show the DMT ID instead of just 'DMT'. Various new tests were also added. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-vtb-ext-block.cpp')
-rw-r--r--parse-vtb-ext-block.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/parse-vtb-ext-block.cpp b/parse-vtb-ext-block.cpp
index afdb1c0..cd1553a 100644
--- a/parse-vtb-ext-block.cpp
+++ b/parse-vtb-ext-block.cpp
@@ -14,23 +14,32 @@ void edid_state::preparse_vtb_ext_block(const unsigned char *x)
void edid_state::parse_vtb_ext_block(const unsigned char *x)
{
- printf("%s Version %u\n", block.c_str(), x[1]);
+ printf(" Version: %u\n", x[1]);
if (x[1] != 1)
fail("Invalid version %u.\n", x[1]);
- unsigned num_dtb = x[2];
+ unsigned num_dtd = x[2];
unsigned num_cvt = x[3];
unsigned num_st = x[4];
x += 5;
- for (unsigned i = 0; i < num_dtb; i++, x += 18)
- detailed_timings(" ", x);
- for (unsigned i = 0; i < num_cvt; i++, x += 3)
- detailed_cvt_descriptor(" ", x, false);
- for (unsigned i = 0; i < num_st; i++, x += 2) {
- if ((x[1] & 0x3f) >= 60)
- print_standard_timing(" ", x[0], x[1] - 60, true);
- else
- print_standard_timing(" ", x[0], x[1], true, 0);
+ if (num_dtd) {
+ printf(" Detailed Timing Descriptors:\n");
+ for (unsigned i = 0; i < num_dtd; i++, x += 18)
+ detailed_timings(" ", x);
+ }
+ if (num_cvt) {
+ printf(" Coordinated Video Timings:\n");
+ for (unsigned i = 0; i < num_cvt; i++, x += 3)
+ detailed_cvt_descriptor(" ", x, false);
+ }
+ if (num_st) {
+ printf(" Standard Timings:\n");
+ for (unsigned i = 0; i < num_st; i++, x += 2) {
+ if ((x[1] & 0x3f) >= 60)
+ print_standard_timing(" ", x[0], x[1] - 60, true);
+ else
+ print_standard_timing(" ", x[0], x[1], true, 0);
+ }
}
}

Privacy Policy