aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-06-26 10:24:57 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-06-26 10:24:57 +0200
commitd5bbd710d52cce51607fb6ae71b20f2f9123c50b (patch)
tree00810fa2ab1077e7f2e21c5175a3e13b124d5437
parent188950472c19492547e298b27f9da0d72cf826df (diff)
edid-decode: simplify the 'first SVD is preferred' test
If the number of reported native timings in the CTA extension is 0, then the first SVD (if any) is preferred. There is no need to check if the timings of the first DTD and the first SVD match, in either case you can pick the first SVD as the preferred timing. With this change the match_timings function can be dropped. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--edid-decode.cpp21
-rw-r--r--edid-decode.h1
-rw-r--r--parse-cta-block.cpp3
3 files changed, 1 insertions, 24 deletions
diff --git a/edid-decode.cpp b/edid-decode.cpp
index d27bcc2..dd44555 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -195,27 +195,6 @@ std::string edid_state::dtd_type()
return buf;
}
-bool edid_state::match_timings(const timings &t1, const timings &t2)
-{
- if (t1.hact != t2.hact ||
- t1.vact != t2.vact ||
- t1.rb != t2.rb ||
- t1.interlaced != t2.interlaced ||
- t1.hfp != t2.hfp ||
- t1.hbp != t2.hbp ||
- t1.hsync != t2.hsync ||
- t1.pos_pol_hsync != t2.pos_pol_hsync ||
- t1.hratio != t2.hratio ||
- t1.vfp != t2.vfp ||
- t1.vbp != t2.vbp ||
- t1.vsync != t2.vsync ||
- t1.pos_pol_vsync != t2.pos_pol_vsync ||
- t1.vratio != t2.vratio ||
- t1.pixclk_khz != t2.pixclk_khz)
- return false;
- return true;
-}
-
static void or_str(std::string &s, const std::string &flag, unsigned &num_flags)
{
if (!num_flags)
diff --git a/edid-decode.h b/edid-decode.h
index 5b98c36..5305467 100644
--- a/edid-decode.h
+++ b/edid-decode.h
@@ -173,7 +173,6 @@ struct edid_state {
bool print_timings(const char *prefix, const struct timings *t,
const char *type, const char *flags = "",
bool detailed = false);
- bool match_timings(const timings &t1, const timings &t2);
void edid_gtf_mode(unsigned refresh, struct timings &t);
void edid_cvt_mode(unsigned refresh, struct timings &t);
void detailed_cvt_descriptor(const char *prefix, const unsigned char *x, bool first);
diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index 96c2aaf..4a8f0c9 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -380,8 +380,7 @@ void edid_state::cta_svd(const unsigned char *x, unsigned n, bool for_ycbcr420)
break;
}
bool override_pref = i == 0 && !for_ycbcr420 &&
- first_svd_might_be_preferred &&
- !match_timings(*t, preferred_timings);
+ first_svd_might_be_preferred;
char type[16];
sprintf(type, "VIC %3u", vic);

Privacy Policy