aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-02-13 12:16:03 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-02-13 12:16:03 +0100
commitff5eb4659d6c6717c350108dd5bcd552c3d9ee0b (patch)
tree93dd5d0d8aa74344d47b6445c6f3fe0a9546056e
parentf78149a5af421b6b40c0c3a465af1d5a9627a034 (diff)
edid-decode: move up do_checks check
The print_timings() function skips the validation checks if !do_checks. But it should also skip the setting of min/max state variables used to determine whether any timings are out of range. I.e., if do_checks is false, just show the timings without any side-effects. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--edid-decode.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/edid-decode.cpp b/edid-decode.cpp
index e3ead8c..5d55c0b 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -478,6 +478,9 @@ bool edid_state::print_timings(const char *prefix, const struct timings *t,
else if (detailed)
print_detailed_timing(len + strlen(type) + 6, t);
+ if (!do_checks)
+ return ok;
+
if (refresh) {
min_vert_freq_hz = min(min_vert_freq_hz, refresh);
max_vert_freq_hz = max(max_vert_freq_hz, refresh);
@@ -487,8 +490,6 @@ bool edid_state::print_timings(const char *prefix, const struct timings *t,
max_hor_freq_hz = max(max_hor_freq_hz, (pixclk_khz * 1000) / (t->hact + hbl));
max_pixclk_khz = max(max_pixclk_khz, pixclk_khz);
}
- if (!do_checks)
- return ok;
if (t->ycbcr420 && t->pixclk_khz < 590000)
warn_once("Some YCbCr 4:2:0 timings are invalid for HDMI (which requires an RGB timings pixel rate >= 590 MHz).\n");

Privacy Policy