aboutsummaryrefslogtreecommitdiffstats
path: root/parse-base-block.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-08 16:09:49 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-07-08 16:46:35 +0200
commit9eef7b57c5013cc7d77c40e4a51e9900e7e2939e (patch)
tree2d9643c2a070bff9b5de9f3730a55003bc61fc77 /parse-base-block.cpp
parent6e4e522a68ed0999fc7aeffa7cb088c03d594cb7 (diff)
edid-decode: report and check native timings
Determine what the native timings are (if any) and report them. Also check against the preferred timing to see if there are major discrepancies. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-base-block.cpp')
-rw-r--r--parse-base-block.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 14cea1e..2b1e40a 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -1330,10 +1330,13 @@ void edid_state::detailed_timings(const char *prefix, const unsigned char *x,
std::string s_type = base_or_cta ? dtd_type() : "DTD";
bool ok = print_timings(prefix, &t, s_type.c_str(), s_flags.c_str(), true);
- if (block_nr == 0 && dtd_cnt == 1 && base_or_cta) {
+ if (block_nr == 0 && dtd_cnt == 1) {
preferred_timings = t;
preferred_type = s_type;
preferred_flags = s_flags;
+ native_timing = t;
+ native_type = s_type;
+ native_flags = s_flags;
}
if ((max_display_width_mm && !t.hsize_mm) ||
@@ -1723,15 +1726,18 @@ void edid_state::parse_base_block(const unsigned char *x)
if (memcmp(x + 0x19, srgb_chromaticity, sizeof(srgb_chromaticity)))
fail("sRGB is signaled, but the chromaticities do not match.\n");
}
- if (x[0x18] & 0x02) {
- if (edid_minor >= 4)
- printf(" First detailed timing includes the native pixel format and preferred refresh rate\n");
- else
- printf(" First detailed timing is preferred timing\n");
- has_preferred_timing = 1;
- } else if (edid_minor >= 4) {
+ if (edid_minor >= 4) {
/* 1.4 always has a preferred timing and this bit means something else. */
has_preferred_timing = 1;
+ printf(" First detailed timing %s the native pixel format and preferred refresh rate\n",
+ (x[0x18] & 0x02) ? "includes" : "does not include");
+ } else {
+ if (x[0x18] & 0x02) {
+ printf(" First detailed timing is the preferred timings\n");
+ has_preferred_timing = 1;
+ } else if (edid_minor == 3) {
+ fail("EDID 1.3 requires that the first detailed timing is the preferred timing\n");
+ }
}
if (x[0x18] & 0x01) {

Privacy Policy