diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-07-13 15:10:35 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-07-13 15:10:35 +0200 |
commit | 1e148375628be5171f1fce6add2ead64c3e34806 (patch) | |
tree | 1162f12930f180675cb6c200d23563cdfe7850f0 | |
parent | c07521c152c93cd371367b0024b3b0c81b9ae08b (diff) |
edid-decode: cta.preferred_timings wasn't cleared
If the first svd can be the preferred timing, then clear
cta.preferred_timings before adding that SVD. It overrides
the regular DTD, so any existing preferred timings must be
cleared first.
Also set first_svd_might_be_preferred to false once this is
done to avoid this to be repeated if there are SVDs in multiple
CTA extension blocks.
And never set first_svd_might_be_preferred if there is a VFPDB.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | edid-decode.h | 3 | ||||
-rw-r--r-- | parse-cta-block.cpp | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/edid-decode.h b/edid-decode.h index 1ab5e36..998ccab 100644 --- a/edid-decode.h +++ b/edid-decode.h @@ -113,7 +113,7 @@ struct edid_state { // CTA-861 block state cta.has_vic_1 = cta.first_svd_might_be_preferred = - cta.has_hdmi = cta.has_vcdb = false; + cta.has_hdmi = cta.has_vcdb = cta.has_vfpdb = false; cta.last_block_was_hdmi_vsdb = cta.have_hf_vsdb = cta.have_hf_scdb = 0; cta.first_block = 1; cta.supported_hdmi_vic_codes = cta.supported_hdmi_vic_vsb_codes = 0; @@ -193,6 +193,7 @@ struct edid_state { unsigned char byte3; bool has_hdmi; bool has_vcdb; + bool has_vfpdb; unsigned short preparsed_phys_addr; int last_block_was_hdmi_vsdb; int have_hf_vsdb, have_hf_scdb; diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp index 88c75ba..75bd4a3 100644 --- a/parse-cta-block.cpp +++ b/parse-cta-block.cpp @@ -394,8 +394,10 @@ void edid_state::cta_svd(const unsigned char *x, unsigned n, bool for_ycbcr420) print_timings(" ", t, type, flags); } if (override_pref) { + cta.preferred_timings.clear(); cta.preferred_timings.push_back(timings_ext(*t, type, flags)); warn("VIC %u is the preferred timing, overriding the first detailed timings. Is this intended?\n", vic); + cta.first_svd_might_be_preferred = false; } if (native) cta.native_timings.push_back(timings_ext(*t, type, flags)); @@ -1883,6 +1885,8 @@ void edid_state::preparse_cta_block(const unsigned char *x) } break; case 0x07: + if (x[i + 1] == 0x0d) + cta.has_vfpdb = true; if (x[i + 1] != 0x0e) continue; for_ycbcr420 = true; @@ -1949,7 +1953,7 @@ void edid_state::parse_cta_block(const unsigned char *x) unsigned native_dtds = x[3] & 0x0f; cta.native_timings.clear(); - if (!native_dtds) { + if (!native_dtds && !cta.has_vfpdb) { cta.first_svd_might_be_preferred = true; } else if (native_dtds > cta.preparse_total_dtds) { fail("There are more Native DTDs (%u) than DTDs (%u).\n", |