aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-04-22 16:59:45 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-04-22 16:59:45 +0200
commit5b288237e7f49c3430241644085778d7a3394a93 (patch)
tree5cc203326760ff327f975bbc36b2ec0ee5075821
parentf5d64041f09d60510b0ddb06e16f6107f3893cd8 (diff)
edid-decode: various fixes
1) Drop an obsolete and always false test in print_standard_timing 2) Drop a test for image width/height where one of the two is 0. 3) Simplify rate test in cta_hf_scdb() (rate is always > 0) 4) Fix Dolby Vision bit for global dimming (0x04 instead of 0x02) Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: val.zapod.vz@gmail.com
-rw-r--r--parse-base-block.cpp13
-rw-r--r--parse-cta-block.cpp4
2 files changed, 4 insertions, 13 deletions
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index bd5ad37..9f0147e 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -831,11 +831,6 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns
return;
}
- if (b1 == 0) {
- fail("Non-conformant standard timing (0 horiz).\n");
- return;
- }
-
t = find_std_id((b1 << 8) | b2, dmt_id);
if (t) {
char type[16];
@@ -1662,13 +1657,9 @@ void edid_state::parse_base_block(const unsigned char *x)
printf(" Maximum image size: %u cm x %u cm\n", x[0x15], x[0x16]);
max_display_width_mm = x[0x15] * 10;
max_display_height_mm = x[0x16] * 10;
- if ((max_display_height_mm && !max_display_width_mm) ||
- (max_display_width_mm && !max_display_height_mm))
- fail("Invalid maximum image size (%u cm x %u cm).\n",
- max_display_width_mm, max_display_height_mm);
- else if (max_display_width_mm < 100 || max_display_height_mm < 100)
+ if (x[0x15] < 10 || x[0x16] < 10)
warn("Dubious maximum image size (%ux%u is smaller than 10x10 cm).\n",
- max_display_width_mm, max_display_height_mm);
+ x[0x15], x[0x16]);
}
else if (edid_minor >= 4 && (x[0x15] || x[0x16])) {
if (x[0x15])
diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index b42be2d..96c2aaf 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -797,7 +797,7 @@ static void cta_hf_scdb(const unsigned char *x, unsigned length)
printf(" Version: %u\n", x[0]);
if (rate) {
printf(" Maximum TMDS Character Rate: %u MHz\n", rate);
- if ((rate && rate <= 340) || rate > 600)
+ if (rate <= 340 || rate > 600)
fail("Max TMDS rate is > 0 and <= 340 or > 600.\n");
}
if (x[2] & 0x80)
@@ -922,7 +922,7 @@ static void cta_dolby_vision(const unsigned char *x, unsigned length)
if (version == 0) {
if (x[0] & 0x02)
printf(" Supports 2160p60\n");
- if (x[0] & 0x02)
+ if (x[0] & 0x04)
printf(" Supports global dimming\n");
unsigned char dm_version = x[16];
printf(" DM Version: %u.%u\n", dm_version >> 4, dm_version & 0xf);

Privacy Policy