aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--edid-decode.13
-rw-r--r--edid-decode.cpp66
-rw-r--r--edid-decode.h6
-rw-r--r--parse-base-block.cpp157
-rw-r--r--parse-cta-block.cpp102
-rw-r--r--parse-di-ext-block.cpp96
-rw-r--r--parse-displayid-block.cpp46
-rw-r--r--parse-ls-ext-block.cpp4
-rw-r--r--parse-vtb-ext-block.cpp2
9 files changed, 268 insertions, 214 deletions
diff --git a/edid-decode.1 b/edid-decode.1
index 39200e3..239f6e8 100644
--- a/edid-decode.1
+++ b/edid-decode.1
@@ -89,6 +89,9 @@ reported at the end.
Check if the EDID conforms to the standards. Warnings and failures are
reported as they happen.
.TP
+\fB\-p\fR, \fB\-\-preferred\-timing\fR
+Report the preferred timing at the end.
+.TP
\fB\-s\fR, \fB\-\-skip\-hex\-dump\fR
Skip the initial hex dump of the EDID.
.TP
diff --git a/edid-decode.cpp b/edid-decode.cpp
index 7313c78..a1ec6bc 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -41,6 +41,7 @@ enum Option {
OptExtract = 'e',
OptHelp = 'h',
OptOutputFormat = 'o',
+ OptPreferredTiming = 'p',
OptSkipHexDump = 's',
OptSkipSHA = 128,
OptLast = 256
@@ -52,6 +53,7 @@ static struct option long_options[] = {
{ "help", no_argument, 0, OptHelp },
{ "output-format", required_argument, 0, OptOutputFormat },
{ "extract", no_argument, 0, OptExtract },
+ { "preferred-timing", no_argument, 0, OptPreferredTiming },
{ "skip-hex-dump", no_argument, 0, OptSkipHexDump },
{ "skip-sha", no_argument, 0, OptSkipSHA },
{ "check-inline", no_argument, 0, OptCheckInline },
@@ -77,6 +79,7 @@ static void usage(void)
" warnings are reported at the end.\n"
" -C, --check-inline check if the EDID conforms to the standards, failures and\n"
" warnings are reported inline.\n"
+ " -p, --preferred-timing report the preferred timing\n"
" -s, --skip-hex-dump skip the initial hex dump of the EDID\n"
" --skip-sha skip the SHA report\n"
" -e, --extract extract the contents of the first block in hex values\n"
@@ -137,7 +140,7 @@ void do_checksum(const char *prefix, const unsigned char *x, size_t len)
if ((unsigned char)(check + sum) != 0) {
printf(" (should be 0x%02x)\n", -sum & 0xff);
- fail("Invalid checksum 0x%02x (should be 0x%02x)\n",
+ fail("Invalid checksum 0x%02x (should be 0x%02x).\n",
check, -sum & 0xff);
return;
}
@@ -163,12 +166,33 @@ void calc_ratio(struct timings *t)
t->vratio = t->vact / d;
}
+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;
+}
+
void edid_state::print_timings(const char *prefix, const struct timings *t,
const char *suffix)
{
if (!t) {
// Should not happen
- fail("Unknown short timings\n");
+ fail("Unknown short timings.\n");
return;
}
@@ -265,21 +289,21 @@ bool edid_state::print_detailed_timings(const char *prefix, const struct timings
t.hact + hbl ? (double)t.pixclk_khz / (t.hact + hbl) : 0.0);
if (t.hbp <= 0)
- fail("0 or negative horizontal back porch\n");
+ fail("0 or negative horizontal back porch.\n");
if (t.vbp <= 0)
- fail("0 or negative vertical back porch\n");
+ fail("0 or negative vertical back porch.\n");
if ((!max_display_width_mm && t.hsize_mm) ||
(!max_display_height_mm && t.vsize_mm)) {
- fail("Mismatch of image size vs display size: image size is set, but not display size\n");
+ fail("Mismatch of image size vs display size: image size is set, but not display size.\n");
} else if (!t.hsize_mm && !t.vsize_mm) {
/* this is valid */
} else if (t.hsize_mm > max_display_width_mm + 9 ||
t.vsize_mm > max_display_height_mm + 9) {
- fail("Mismatch of image size %ux%u mm vs display size %ux%u mm\n",
+ fail("Mismatch of image size %ux%u mm vs display size %ux%u mm.\n",
t.hsize_mm, t.vsize_mm, max_display_width_mm, max_display_height_mm);
} else if (t.hsize_mm < max_display_width_mm - 9 &&
t.vsize_mm < max_display_height_mm - 9) {
- fail("Mismatch of image size %ux%u mm vs display size %ux%u mm\n",
+ fail("Mismatch of image size %ux%u mm vs display size %ux%u mm.\n",
t.hsize_mm, t.vsize_mm, max_display_width_mm, max_display_height_mm);
}
if (refresh) {
@@ -729,7 +753,7 @@ void edid_state::parse_block_map(const unsigned char *x)
if (block_nr == 1)
saw_block_1 = true;
else if (!saw_block_1)
- fail("No EDID Block Map Extension found in block 1\n");
+ fail("No EDID Block Map Extension found in block 1.\n");
if (block_nr > 1)
offset = 128;
@@ -740,12 +764,12 @@ void edid_state::parse_block_map(const unsigned char *x)
if (x[i]) {
last_valid_block_tag++;
if (i != last_valid_block_tag && !fail_once) {
- fail("Valid block tags are not consecutive\n");
+ fail("Valid block tags are not consecutive.\n");
fail_once = true;
}
printf(" Block %3u: %s\n", block, block_name(block).c_str());
if (block >= num_blocks && !fail_once) {
- fail("Invalid block number %u\n", block);
+ fail("Invalid block number %u.\n", block);
fail_once = true;
}
}
@@ -780,7 +804,7 @@ void edid_state::parse_extension(const unsigned char *x)
break;
case 0x20:
printf("%s\n", block.c_str());
- fail("Deprecated extension block, do not use\n");
+ fail("Deprecated extension block, do not use.\n");
break;
case 0x40:
parse_di_ext_block(x);
@@ -794,12 +818,12 @@ void edid_state::parse_extension(const unsigned char *x)
case 0xf0:
parse_block_map(x);
if (block_nr != 1 && block_nr != 128)
- fail("Must be used in block 1 and 128\n");
+ fail("Must be used in block 1 and 128.\n");
break;
default:
printf("%s\n", block.c_str());
hex_block(" ", x, EDID_PAGE_SIZE);
- fail("Unknown Extension Block\n");
+ fail("Unknown Extension Block.\n");
break;
}
@@ -836,9 +860,9 @@ int edid_state::parse_edid()
block = "";
block_nr = EDID_MAX_BLOCKS;
if (uses_gtf && !supports_gtf)
- fail("GTF timings are used, but the EDID does not signal GTF support\n");
+ fail("GTF timings are used, but the EDID does not signal GTF support.\n");
if (uses_cvt && !supports_cvt)
- fail("CVT timings are used, but the EDID does not signal CVT support\n");
+ fail("CVT timings are used, but the EDID does not signal CVT support.\n");
if (has_display_range_descriptor &&
(min_vert_freq_hz < min_display_vert_freq_hz ||
max_vert_freq_hz > max_display_vert_freq_hz ||
@@ -861,11 +885,13 @@ int edid_state::parse_edid()
min_display_hor_freq_hz / 1000.0, max_display_hor_freq_hz / 1000.0,
max_pixclk_khz / 1000.0, max_display_pixclk_khz / 1000.0);
- if (edid_minor < 4) {
- fail("%s", buf);
- } else {
- warn("%s", buf);
- }
+ msg(edid_minor >= 4, "%s", buf);
+ }
+
+ if (options[OptPreferredTiming]) {
+ printf("\n----------------\n");
+ printf("\nPreferred Video Timings:\n");
+ print_detailed_timings("", preferred_timings, "");
}
if (!options[OptCheck] && !options[OptCheckInline])
diff --git a/edid-decode.h b/edid-decode.h
index 82d82ca..fc407db 100644
--- a/edid-decode.h
+++ b/edid-decode.h
@@ -79,6 +79,8 @@ struct edid_state {
// CTA-861 block state
bool has_640x480p60_est_timing;
bool has_cta861_vic_1;
+ bool first_svd_might_be_preferred;
+ bool has_hdmi;
unsigned supported_hdmi_vic_codes;
unsigned supported_hdmi_vic_vsb_codes;
bool preparsed_has_vic[2][256];
@@ -94,6 +96,7 @@ struct edid_state {
unsigned block_nr;
std::string block;
std::string data_block;
+ timings preferred_timings;
unsigned min_hor_freq_hz;
unsigned max_hor_freq_hz;
@@ -107,6 +110,7 @@ struct edid_state {
void print_timings(const char *prefix, const struct timings *t,
const char *suffix);
bool print_detailed_timings(const char *prefix, const struct timings &t, const char *flags);
+ 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);
@@ -114,7 +118,7 @@ struct edid_state {
bool gtf_only = false, unsigned vrefresh_offset = 60);
void detailed_display_range_limits(const unsigned char *x);
void detailed_epi(const unsigned char *x);
- void detailed_timings(const char *prefix, const unsigned char *x);
+ timings detailed_timings(const char *prefix, const unsigned char *x);
void detailed_block(const unsigned char *x);
void parse_base_block(const unsigned char *x);
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 52d4cfa..c2bd1c6 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -24,7 +24,7 @@ static char *manufacturer_name(const unsigned char *x)
name[3] = 0;
if (!isupper(name[0]) || !isupper(name[1]) || !isupper(name[2]))
- fail("Manufacturer name field contains garbage\n");
+ fail("Manufacturer name field contains garbage.\n");
return name;
}
@@ -710,7 +710,7 @@ void edid_state::detailed_cvt_descriptor(const char *prefix, const unsigned char
uses_cvt = true;
cvt_t.vact = x[0];
if (!cvt_t.vact)
- fail("CVT byte 0 is 0, which is a reserved value\n");
+ fail("CVT byte 0 is 0, which is a reserved value.\n");
cvt_t.vact |= (x[1] & 0xf0) << 4;
cvt_t.vact++;
cvt_t.vact *= 2;
@@ -737,16 +737,16 @@ void edid_state::detailed_cvt_descriptor(const char *prefix, const unsigned char
cvt_t.hact = 8 * (((cvt_t.vact * cvt_t.hratio) / cvt_t.vratio) / 8);
if (x[1] & 0x03)
- fail("Reserved bits of CVT byte 1 are non-zero\n");
+ fail("Reserved bits of CVT byte 1 are non-zero.\n");
if (x[2] & 0x80)
- fail("Reserved bit of CVT byte 2 is non-zero\n");
+ fail("Reserved bit of CVT byte 2 is non-zero.\n");
if (!(x[2] & 0x1f))
- fail("CVT byte 2 does not support any vertical rates\n");
+ fail("CVT byte 2 does not support any vertical rates.\n");
preferred = (x[2] & 0x60) >> 5;
if (preferred == 1 && (x[2] & 0x01))
preferred = 4;
if (!(x[2] & (1 << (4 - preferred))))
- fail("The preferred CVT Vertical Rate is not supported\n");
+ fail("The preferred CVT Vertical Rate is not supported.\n");
static const char *s_pref = "CVT, preferred vertical rate";
@@ -789,23 +789,23 @@ char *extract_string(const unsigned char *x, unsigned len)
if (x[i] == 0x0a) {
seen_newline = 1;
if (!i)
- fail("Empty string\n");
+ fail("Empty string.\n");
else if (s[i - 1] == 0x20)
- fail("One or more trailing spaces\n");
+ fail("One or more trailing spaces.\n");
} else if (x[i] == 0x20) {
s[i] = x[i];
} else {
- fail("Non-printable character\n");
+ fail("Non-printable character.\n");
return s;
}
} else if (x[i] != 0x20) {
- fail("Non-space after newline\n");
+ fail("Non-space after newline.\n");
return s;
}
}
/* Does the string end with a space? */
if (!seen_newline && s[len - 1] == 0x20)
- fail("One or more trailing spaces\n");
+ fail("One or more trailing spaces.\n");
return s;
}
@@ -820,12 +820,12 @@ void edid_state::print_standard_timing(const char *prefix, unsigned char b1, uns
if (b1 <= 0x01) {
if (b1 != 0x01 || b2 != 0x01)
- fail("Use 0x0101 as the invalid Standard Timings code, not 0x%02x%02x\n", b1, b2);
+ fail("Use 0x0101 as the invalid Standard Timings code, not 0x%02x%02x.\n", b1, b2);
return;
}
if (b1 == 0) {
- fail("Non-conformant standard timing (0 horiz)\n");
+ fail("Non-conformant standard timing (0 horiz).\n");
return;
}
@@ -927,18 +927,18 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
case 0x00: /* default gtf */
range_class = "GTF";
if (edid_minor >= 4 && !supports_continuous_freq)
- fail("GTF can't be combined with non-continuous frequencies\n");
+ fail("GTF can't be combined with non-continuous frequencies.\n");
supports_gtf = true;
break;
case 0x01: /* range limits only */
range_class = "Bare Limits";
if (edid_minor < 4)
- fail("'%s' is not allowed for EDID < 1.4\n", range_class.c_str());
+ fail("'%s' is not allowed for EDID < 1.4.\n", range_class.c_str());
break;
case 0x02: /* secondary gtf curve */
range_class = "Secondary GTF";
if (edid_minor >= 4 && !supports_continuous_freq)
- fail("GTF can't be combined with non-continuous frequencies\n");
+ fail("GTF can't be combined with non-continuous frequencies.\n");
supports_gtf = true;
has_sec_gtf = true;
break;
@@ -946,9 +946,9 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
range_class = "CVT";
is_cvt = 1;
if (edid_minor < 4)
- fail("'%s' is not allowed for EDID < 1.4\n", range_class.c_str());
+ fail("'%s' is not allowed for EDID < 1.4.\n", range_class.c_str());
else if (!supports_continuous_freq)
- fail("CVT can't be combined with non-continuous frequencies\n");
+ fail("CVT can't be combined with non-continuous frequencies.\n");
if (edid_minor >= 4) {
/* GTF is implied if CVT is signaled */
supports_gtf = true;
@@ -956,17 +956,17 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
}
break;
default: /* invalid */
- fail("Unknown range class (0x%02x)\n", x[10]);
+ fail("Unknown range class (0x%02x).\n", x[10]);
range_class = std::string("Unknown (") + utohex(x[10]) + ")";
break;
}
if (x[5] + v_min_offset > x[6] + v_max_offset)
- fail("Min vertical rate > max vertical rate\n");
+ fail("Min vertical rate > max vertical rate.\n");
min_display_vert_freq_hz = x[5] + v_min_offset;
max_display_vert_freq_hz = x[6] + v_max_offset;
if (x[7] + h_min_offset > x[8] + h_max_offset)
- fail("Min horizontal freq > max horizontal freq\n");
+ fail("Min horizontal freq > max horizontal freq.\n");
min_display_hor_freq_hz = (x[7] + h_min_offset) * 1000;
max_display_hor_freq_hz = (x[8] + h_max_offset) * 1000;
printf(" Monitor ranges (%s): %d-%d Hz V, %d-%d kHz H",
@@ -978,23 +978,23 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
printf(", max dotclock %d MHz\n", x[9] * 10);
} else {
if (edid_minor >= 4)
- fail("EDID 1.4 block does not set max dotclock\n");
+ fail("EDID 1.4 block does not set max dotclock.\n");
printf("\n");
}
if (has_sec_gtf) {
if (x[11])
- fail("Byte 11 is 0x%02x instead of 0x00\n", x[11]);
+ fail("Byte 11 is 0x%02x instead of 0x00.\n", x[11]);
printf(" GTF Secondary Curve Block\n");
printf(" Start frequency: %u kHz\n", x[12] * 2);
printf(" C: %f\n", x[13] / 2.0);
if (x[13] > 127)
- fail("Byte 13 is > 127\n");
+ fail("Byte 13 is > 127.\n");
printf(" M: %u\n", (x[15] << 8) | x[14]);
printf(" K: %u\n", x[16]);
printf(" J: %f\n", x[17] / 2.0);
if (x[17] > 127)
- fail("Byte 17 is > 127\n");
+ fail("Byte 17 is > 127.\n");
} else if (is_cvt) {
int max_h_pixels = 0;
@@ -1006,7 +1006,7 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
printf(" Real max dotclock: %.2f MHz\n",
(x[9] * 10) - (raw_offset * 0.25));
if (raw_offset >= 40)
- warn("CVT block corrects dotclock by more than 9.75 MHz\n");
+ warn("CVT block corrects dotclock by more than 9.75 MHz.\n");
}
max_h_pixels = x[12] & 0x03;
@@ -1023,7 +1023,7 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
x[14] & 0x10 ? "5:4" : "",
x[14] & 0x08 ? "15:9" : "");
if (x[14] & 0x07)
- fail("Reserved bits of byte 14 are non-zero\n");
+ fail("Reserved bits of byte 14 are non-zero.\n");
printf(" Preferred aspect ratio: ");
switch ((x[15] & 0xe0) >> 5) {
@@ -1044,7 +1044,7 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
break;
default:
printf("Unknown (0x%02x)", (x[15] & 0xe0) >> 5);
- fail("Invalid preferred aspect ratio 0x%02x\n",
+ fail("Invalid preferred aspect ratio 0x%02x.\n",
(x[15] & 0xe0) >> 5);
break;
}
@@ -1056,7 +1056,7 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
printf(" Supports CVT reduced blanking\n");
if (x[15] & 0x07)
- fail("Reserved bits of byte 15 are non-zero\n");
+ fail("Reserved bits of byte 15 are non-zero.\n");
if (x[16] & 0xf0) {
printf(" Supported display scaling:\n");
@@ -1071,18 +1071,18 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
}
if (x[16] & 0x0f)
- fail("Reserved bits of byte 16 are non-zero\n");
+ fail("Reserved bits of byte 16 are non-zero.\n");
if (x[17])
printf(" Preferred vertical refresh: %d Hz\n", x[17]);
else
- warn("CVT block does not set preferred refresh rate\n");
+ warn("CVT block does not set preferred refresh rate.\n");
} else {
if (x[11] != 0x0a)
- fail("Byte 11 is 0x%02x instead of 0x0a\n", x[11]);
+ fail("Byte 11 is 0x%02x instead of 0x0a.\n", x[11]);
for (unsigned i = 12; i <= 17; i++) {
if (x[i] != 0x20) {
- fail("Byte %u is 0x%02x instead of 0x20\n", i, x[i]);
+ fail("Byte %u is 0x%02x instead of 0x20.\n", i, x[i]);
break;
}
}
@@ -1098,17 +1098,17 @@ void edid_state::detailed_epi(const unsigned char *x)
printf(" Bits per pixel: %u\n", 18 + v * 6);
if (v > 2)
- fail("Invalid bits per pixel\n");
+ fail("Invalid bits per pixel.\n");
v = (x[5] & 0x18) >> 3;
printf(" Pixels per clock: %u\n", 1 << v);
if (v > 2)
- fail("Invalid pixels per clock\n");
+ fail("Invalid pixels per clock.\n");
v = (x[5] & 0x60) >> 5;
printf(" Data color mapping: %sconventional\n", v ? "non-" : "");
if (v > 1)
- fail("Unknown data color mapping (0x%02x)\n", v);
+ fail("Unknown data color mapping (0x%02x).\n", v);
if (x[5] & 0x80)
- fail("Non-zero reserved field in byte 5\n");
+ fail("Non-zero reserved field in byte 5.\n");
v = x[6] & 0x0f;
printf(" Interface type: ");
@@ -1121,7 +1121,7 @@ void edid_state::detailed_epi(const unsigned char *x)
case 0x05: printf("TMDS\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Invalid interface type 0x%02x\n", v);
+ fail("Invalid interface type 0x%02x.\n", v);
break;
}
printf(" DE polarity: DE %s active\n",
@@ -1129,14 +1129,14 @@ void edid_state::detailed_epi(const unsigned char *x)
printf(" FPSCLK polarity: FPSCLK %sinverted\n",
(x[6] & 0x20) ? "" : "not ");
if (x[6] & 0xc0)
- fail("Non-zero reserved field in byte 6\n");
+ fail("Non-zero reserved field in byte 6.\n");
printf(" Vertical display mode: %s\n",
(x[7] & 0x01) ? "Up/Down reverse mode" : "normal");
printf(" Horizontal display mode: %s\n",
(x[7] & 0x02) ? "Left/Right reverse mode" : "normal");
if (x[7] & 0xfc)
- fail("Non-zero reserved field in byte 7\n");
+ fail("Non-zero reserved field in byte 7.\n");
v = x[8] & 0x0f;
printf(" Total power on sequencing delay: ");
@@ -1178,12 +1178,12 @@ void edid_state::detailed_epi(const unsigned char *x)
printf(" Contrast voltable control: %u steps%s\n", v, s);
if (x[11] & 0x40)
- fail("Non-zero reserved field in byte 11\n");
+ fail("Non-zero reserved field in byte 11.\n");
printf(" Contrast control enable: %s\n",
(x[11] & 0x80) ? "enabled" : "disabled");
if (x[12] || x[13] || x[14] || x[15] || x[16])
- fail("Non-zero values in reserved bytes 12-16\n");
+ fail("Non-zero values in reserved bytes 12-16.\n");
printf(" EPI Version: %u.%u\n", (x[17] & 0xf0) >> 4, x[17] & 0x0f);
}
@@ -1196,7 +1196,7 @@ static void add_str(std::string &s, const std::string &add)
s = s + ", " + add;
}
-void edid_state::detailed_timings(const char *prefix, const unsigned char *x)
+timings edid_state::detailed_timings(const char *prefix, const unsigned char *x)
{
struct timings t = {};
unsigned hbl, vbl;
@@ -1207,11 +1207,11 @@ void edid_state::detailed_timings(const char *prefix, const unsigned char *x)
printf("%sDetailed mode: ", prefix);
hex_block("", x, 18, true, 18);
if (!t.pixclk_khz)
- fail("First two bytes are 0, invalid data\n");
+ fail("First two bytes are 0, invalid data.\n");
else
- fail("Pixelclock < 10 MHz, assuming invalid data 0x%02x 0x%02x\n",
+ fail("Pixelclock < 10 MHz, assuming invalid data 0x%02x 0x%02x.\n",
x[0], x[1]);
- return;
+ return t;
}
t.hact = (x[2] + ((x[4] & 0xf0) << 4));
@@ -1311,11 +1311,13 @@ void edid_state::detailed_timings(const char *prefix, const unsigned char *x)
t.hsize_mm = x[12] + ((x[14] & 0xf0) << 4);
t.vsize_mm = x[13] + ((x[14] & 0x0f) << 8);
+ calc_ratio(&t);
+
bool ok = print_detailed_timings(prefix, t, s_flags.c_str());
if ((max_display_width_mm && !t.hsize_mm) ||
(max_display_height_mm && !t.vsize_mm)) {
- fail("Mismatch of image size vs display size: image size is not set, but display size is\n");
+ fail("Mismatch of image size vs display size: image size is not set, but display size is.\n");
}
if (has_spwg && timing_descr_cnt == 2)
printf("SPWG Module Revision: %hhu\n", x[17]);
@@ -1325,6 +1327,7 @@ void edid_state::detailed_timings(const char *prefix, const unsigned char *x)
s += " ";
hex_block(s.c_str(), x, 18, true, 18);
}
+ return t;
}
void edid_state::detailed_block(const unsigned char *x)
@@ -1337,9 +1340,11 @@ void edid_state::detailed_block(const unsigned char *x)
timing_descr_cnt++;
if (x[0] || x[1]) {
data_block = "Detailed Timings #" + std::to_string(timing_descr_cnt);
- detailed_timings("", x);
+ timings t = detailed_timings("", x);
+ if (timing_descr_cnt == 1)
+ preferred_timings = t;
if (seen_non_detailed_descriptor)
- fail("Invalid detailed timing descriptor ordering\n");
+ fail("Invalid detailed timing descriptor ordering.\n");
return;
}
@@ -1347,21 +1352,21 @@ void edid_state::detailed_block(const unsigned char *x)
/* Monitor descriptor block, not detailed timing descriptor. */
if (x[2] != 0) {
/* 1.3, 3.10.3 */
- fail("Monitor descriptor block has byte 2 nonzero (0x%02x)\n", x[2]);
+ fail("Monitor descriptor block has byte 2 nonzero (0x%02x).\n", x[2]);
}
if ((edid_minor < 4 || x[3] != 0xfd) && x[4] != 0x00) {
/* 1.3, 3.10.3 */
- fail("Monitor descriptor block has byte 4 nonzero (0x%02x)\n", x[4]);
+ fail("Monitor descriptor block has byte 4 nonzero (0x%02x).\n", x[4]);
}
seen_non_detailed_descriptor = 1;
if (edid_minor == 0)
- fail("Has descriptor blocks other than detailed timings\n");
+ fail("Has descriptor blocks other than detailed timings.\n");
if (!memcmp(x, zero_descr, sizeof(zero_descr))) {
data_block = "Empty Descriptor";
printf("%s\n", data_block.c_str());
- fail("Use Dummy Descriptor instead of all zeroes\n");
+ fail("Use Dummy Descriptor instead of all zeroes.\n");
return;
}
@@ -1374,7 +1379,7 @@ void edid_state::detailed_block(const unsigned char *x)
printf("%s\n", data_block.c_str());
for (i = 5; i < 18; i++) {
if (x[i]) {
- fail("Dummy block filled with garbage\n");
+ fail("Dummy block filled with garbage.\n");
break;
}
}
@@ -1390,7 +1395,7 @@ void edid_state::detailed_block(const unsigned char *x)
data_block = "CVT 3 Byte Timing Codes";
printf("%s\n", data_block.c_str());
if (x[5] != 0x01) {
- fail("Invalid version number %u\n", x[5]);
+ fail("Invalid version number %u.\n", x[5]);
return;
}
for (i = 0; i < 4; i++)
@@ -1416,7 +1421,7 @@ void edid_state::detailed_block(const unsigned char *x)
print_standard_timing(" ", x[5 + i * 2], x[5 + i * 2 + 1]);
}
if (!cnt)
- warn("%s block without any timings\n", data_block.c_str());
+ warn("%s block without any timings.\n", data_block.c_str());
return;
case 0xfb: {
unsigned w_x, w_y;
@@ -1469,7 +1474,7 @@ void edid_state::detailed_block(const unsigned char *x)
data_block = "SPWG Descriptor #3";
memcpy(buf, x + 5, 5);
if (strlen(buf) != 5)
- fail("Invalid PC Maker P/N length\n");
+ fail("Invalid PC Maker P/N length.\n");
printf("SPWG PC Maker P/N: %s\n", buf);
printf("SPWG LCD Supplier EEDID Revision: %hhu\n", x[10]);
printf("SPWG Manufacturer P/N: %s\n", extract_string(x + 11, 7));
@@ -1481,7 +1486,7 @@ void edid_state::detailed_block(const unsigned char *x)
printf("LVDS Channels: %hhu\n", x[13]);
printf("Panel Self Test %sPresent\n", x[14] ? "" : "Not ");
if (x[15] != 0x0a || x[16] != 0x20 || x[17] != 0x20)
- fail("Invalid trailing data\n");
+ fail("Invalid trailing data.\n");
}
return;
case 0xff:
@@ -1495,7 +1500,7 @@ void edid_state::detailed_block(const unsigned char *x)
x[3] <= 0x0f ? "Manufacturer-Specified" : "Unknown", x[3]);
hex_block(" ", x + 2, 16);
if (x[3] > 0x0f)
- fail("Unknown Type 0x%02hhx\n", x[3]);
+ fail("Unknown Type 0x%02hhx.\n", x[3]);
return;
}
}
@@ -1513,11 +1518,11 @@ void edid_state::parse_base_block(const unsigned char *x)
if (x[0x12] == 1) {
edid_minor = x[0x13];
if (edid_minor > 4)
- warn("Unknown EDID minor version %u, assuming 1.4 conformance\n", edid_minor);
+ warn("Unknown EDID minor version %u, assuming 1.4 conformance.\n", edid_minor);
if (edid_minor < 3)
- warn("EDID 1.%u is deprecated, do not use\n", edid_minor);
+ warn("EDID 1.%u is deprecated, do not use.\n", edid_minor);
} else {
- fail("Unknown EDID major version\n");
+ fail("Unknown EDID major version.\n");
}
data_block = "Vendor & Product Identification";
@@ -1537,13 +1542,13 @@ void edid_state::parse_base_block(const unsigned char *x)
if (week) {
if (edid_minor <= 3 && week == 0xff)
- fail("EDID 1.3 does not support week 0xff\n");
+ fail("EDID 1.3 does not support week 0xff.\n");
// The max week is 53 in EDID 1.3 and 54 in EDID 1.4.
// No idea why there is a difference.
if (edid_minor <= 3 && week == 54)
- fail("EDID 1.3 does not support week 54\n");
+ fail("EDID 1.3 does not support week 54.\n");
if (week != 0xff && week > 54)
- fail("Invalid week %u of manufacture\n", week);
+ fail("Invalid week %u of manufacture.\n", week);
if (week != 0xff)
printf("Made in week %hhu of %d\n", week, year);
}
@@ -1552,7 +1557,7 @@ void edid_state::parse_base_block(const unsigned char *x)
else if (!week)
printf("Made in year %d\n", year);
if (year - 1 > ptm->tm_year + 1900)
- fail("The year %d is more than one year in the future\n", year);
+ fail("The year %d is more than one year in the future.\n", year);
/* display section */
@@ -1564,7 +1569,7 @@ void edid_state::parse_base_block(const unsigned char *x)
if ((x[0x14] & 0x70) == 0x00)
printf("Color depth is undefined\n");
else if ((x[0x14] & 0x70) == 0x70)
- fail("Color Bit Depth set to reserved value\n");
+ fail("Color Bit Depth set to reserved value.\n");
else
printf("%u bits per primary color channel\n",
((x[0x14] & 0x70) >> 3) + 4);
@@ -1578,7 +1583,7 @@ void edid_state::parse_base_block(const unsigned char *x)
case 0x05: printf("DisplayPort interface\n"); break;
default:
printf("Unknown (0x%02x) interface\n", x[0x14] & 0x0f);
- fail("Digital Video Interface Standard set to reserved value 0x%02x\n", x[0x14] & 0x0f);
+ fail("Digital Video Interface Standard set to reserved value 0x%02x.\n", x[0x14] & 0x0f);
break;
}
} else if (edid_minor >= 2) {
@@ -1586,9 +1591,9 @@ void edid_state::parse_base_block(const unsigned char *x)
printf("DFP 1.x compatible TMDS\n");
}
if (x[0x14] & 0x7e)
- fail("Digital Video Interface Standard set to reserved value 0x%02x\n", x[0x14] & 0x7e);
+ fail("Digital Video Interface Standard set to reserved value 0x%02x.\n", x[0x14] & 0x7e);
} else if (x[0x14] & 0x7f) {
- fail("Digital Video Interface Standard set to reserved value 0x%02x\n", x[0x14] & 0x7f);
+ fail("Digital Video Interface Standard set to reserved value 0x%02x.\n", x[0x14] & 0x7f);
}
} else {
unsigned voltage = (x[0x14] & 0x60) >> 5;
@@ -1627,10 +1632,10 @@ void edid_state::parse_base_block(const unsigned char *x)
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",
+ 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)
- warn("Dubious maximum image size (%ux%u is smaller than 10x10 cm)\n",
+ warn("Dubious maximum image size (%ux%u is smaller than 10x10 cm).\n",
max_display_width_mm, max_display_height_mm);
}
else if (edid_minor >= 4 && (x[0x15] || x[0x16])) {
@@ -1688,7 +1693,7 @@ void edid_state::parse_base_block(const unsigned char *x)
};
printf("Default (sRGB) color space is primary color space\n");
if (memcmp(x + 0x19, srgb_chromaticity, sizeof(srgb_chromaticity)))
- fail("sRGB is signaled, but the chromaticities do not match\n");
+ fail("sRGB is signaled, but the chromaticities do not match.\n");
}
if (x[0x18] & 0x02) {
if (edid_minor >= 4)
@@ -1769,7 +1774,7 @@ void edid_state::parse_base_block(const unsigned char *x)
/* 18 byte descriptors */
if (has_preferred_timing && !x[0x36] && !x[0x37])
- fail("Missing preferred timing\n");
+ fail("Missing preferred timing.\n");
/* Look for SPWG Noteboook Panel EDID data blocks */
if ((x[0x36] || x[0x37]) &&
@@ -1793,9 +1798,9 @@ void edid_state::parse_base_block(const unsigned char *x)
do_checksum("", x, EDID_PAGE_SIZE);
if (edid_minor >= 3) {
if (!has_name_descriptor)
- fail("Missing Display Product Name\n");
+ fail("Missing Display Product Name.\n");
if ((edid_minor == 3 || supports_continuous_freq) &&
!has_display_range_descriptor)
- fail("Missing Display Range Limits Descriptor\n");
+ fail("Missing Display Range Limits Descriptor.\n");
}
}
diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index 2736d91..ea37db0 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -372,20 +372,26 @@ void edid_state::cta_svd(const unsigned char *x, unsigned n, int for_ycbcr420)
break;
}
char suffix[16];
+ bool override_pref = i == 0 && first_svd_might_be_preferred &&
+ !match_timings(*t, preferred_timings);
sprintf(suffix, "VIC %3u%s", vic, native ? ", native" : "");
print_timings(" ", t, suffix);
+ if (override_pref) {
+ preferred_timings = *t;
+ warn("VIC %u is the preferred timing, overriding the first detailed timings. Is this intended?\n", vic);
+ }
} else {
printf(" Unknown (VIC %3u)\n", vic);
- fail("Unknown VIC %u\n", vic);
+ fail("Unknown VIC %u.\n", vic);
}
if (vic == 1 && !for_ycbcr420)
has_cta861_vic_1 = 1;
if (++vics[vic][for_ycbcr420] == 2)
- fail("Duplicate %sVIC %u\n", for_ycbcr420 ? "YCbCr 4:2:0 " : "", vic);
+ fail("Duplicate %sVIC %u.\n", for_ycbcr420 ? "YCbCr 4:2:0 " : "", vic);
if (for_ycbcr420 && preparsed_has_vic[0][vic])
- fail("YCbCr 4:2:0-only VIC %u is also a regular VIC\n", vic);
+ fail("YCbCr 4:2:0-only VIC %u is also a regular VIC.\n", vic);
}
}
@@ -402,7 +408,7 @@ void edid_state::print_vic_index(const char *prefix, unsigned idx, const char *s
if (t)
print_timings(prefix, t, buf);
- else
+ else
printf("%sUnknown (%s)\n", prefix, buf);
} else {
// Should not happen!
@@ -425,7 +431,7 @@ void edid_state::cta_y420cmdb(const unsigned char *x, unsigned length)
if (memchk(x, length)) {
printf(" Empty Capability Map\n");
- fail("Empty Capability Map\n");
+ fail("Empty Capability Map.\n");
return;
}
@@ -442,12 +448,12 @@ void edid_state::cta_y420cmdb(const unsigned char *x, unsigned length)
if (max_idx < preparsed_svds[0].size()) {
unsigned vic = preparsed_svds[0][max_idx];
if (preparsed_has_vic[1][vic])
- fail("VIC %u is also a YCbCr 4:2:0-only VIC\n", vic);
+ fail("VIC %u is also a YCbCr 4:2:0-only VIC.\n", vic);
}
}
}
if (max_idx >= preparsed_svds[0].size())
- fail("Max index %u > %u (#SVDs)\n",
+ fail("Max index %u > %u (#SVDs).\n",
max_idx + 1, preparsed_svds[0].size());
}
@@ -470,7 +476,7 @@ void edid_state::cta_vfpdb(const unsigned char *x, unsigned length)
print_timings(" ", t, suffix);
} else {
printf(" Unknown (VIC %3u)\n", vic);
- fail("Unknown VIC %u\n", vic);
+ fail("Unknown VIC %u.\n", vic);
}
} else if (svr > 128 && svr < 145) {
@@ -517,7 +523,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
printf(" Maximum TMDS clock: %u MHz\n", x[6] * 5);
if (x[6] * 5 > 340)
- fail("HDMI VSDB Max TMDS rate is > 340\n");
+ fail("HDMI VSDB Max TMDS rate is > 340.\n");
if (length < 8)
return;
@@ -601,7 +607,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
print_timings(" ", t, suffix.c_str());
} else {
printf(" Unknown (HDMI VIC %u)\n", vic);
- fail("Unknown HDMI VIC %u\n", vic);
+ fail("Unknown HDMI VIC %u.\n", vic);
}
}
@@ -654,7 +660,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
b += 2;
len_3d -= 2;
if (max_idx >= (int)preparsed_svds[0].size())
- fail("HDMI 3D VIC indices max index %d > %u (#SVDs)\n",
+ fail("HDMI 3D VIC indices max index %d > %u (#SVDs).\n",
max_idx + 1, preparsed_svds[0].size());
}
@@ -690,7 +696,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
case 0x01: s += ", horizontal"; break;
case 0x02: case 0x03: case 0x04: case 0x05:
s += ", not in use";
- fail("not-in-use 3D_Detail_X value 0x%02x\n",
+ fail("not-in-use 3D_Detail_X value 0x%02x.\n",
x[b + 1] >> 4);
break;
case 0x06: s += ", all quincunx combinations"; break;
@@ -700,7 +706,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
case 0x0a: s += ", quincunx even/left, even/right"; break;
default:
s += ", reserved";
- fail("reserved 3D_Detail_X value 0x%02x\n",
+ fail("reserved 3D_Detail_X value 0x%02x.\n",
x[b + 1] >> 4);
break;
}
@@ -708,7 +714,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
default:
s = "unknown (";
s += utohex(x[b] & 0x0f) + ")";
- fail("Unknown 3D_Structure_X value 0x%02x\n", x[b] & 0x0f);
+ fail("Unknown 3D_Structure_X value 0x%02x.\n", x[b] & 0x0f);
break;
}
print_vic_index(" ", idx, s.c_str());
@@ -717,7 +723,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
b++;
}
if (max_idx >= (int)preparsed_svds[0].size())
- fail("HDMI 2D VIC indices max index %d > %u (#SVDs)\n",
+ fail("HDMI 2D VIC indices max index %d > %u (#SVDs).\n",
max_idx + 1, preparsed_svds[0].size());
}
}
@@ -748,7 +754,7 @@ static void cta_hf_eeodb(const unsigned char *x, unsigned length)
{
printf(" EDID Extension Block Count: %u\n", x[0]);
if (length != 1 || x[0] == 0)
- fail("Block is too long or reports a 0 block count\n");
+ fail("Block is too long or reports a 0 block count.\n");
}
static void cta_hf_scdb(const unsigned char *x, unsigned length)
@@ -759,7 +765,7 @@ static void cta_hf_scdb(const unsigned char *x, unsigned length)
if (rate) {
printf(" Maximum TMDS Character Rate: %u MHz\n", rate);
if ((rate && rate <= 340) || rate > 600)
- fail("Max TMDS rate is > 0 and <= 340 or > 600\n");
+ fail("Max TMDS rate is > 0 and <= 340 or > 600.\n");
}
if (x[2] & 0x80)
printf(" SCDC Present\n");
@@ -783,12 +789,12 @@ static void cta_hf_scdb(const unsigned char *x, unsigned length)
printf("%s\n", max_frl_rates[max_frl_rate]);
} else {
printf("Unknown (0x%02x)\n", max_frl_rate);
- fail("Unknown Max Fixed Rate Link (0x%02x)\n", max_frl_rate);
+ fail("Unknown Max Fixed Rate Link (0x%02x).\n", max_frl_rate);
}
if (max_frl_rate == 1 && rate < 300)
- fail("Max Fixed Rate Link is 1, but Max TMDS rate < 300\n");
+ fail("Max Fixed Rate Link is 1, but Max TMDS rate < 300.\n");
else if (max_frl_rate >= 2 && rate < 600)
- fail("Max Fixed Rate Link is >= 2, but Max TMDS rate < 600\n");
+ fail("Max Fixed Rate Link is >= 2, but Max TMDS rate < 600.\n");
}
if (x[3] & 0x08)
printf(" Supports UHD VIC\n");
@@ -844,7 +850,7 @@ static void cta_hf_scdb(const unsigned char *x, unsigned length)
printf("%s\n", dsc_max_slices[max_slices]);
} else {
printf("Unknown (0x%02x)\n", max_slices);
- fail("Unknown DSC Max Slices (0x%02x)\n", max_slices);
+ fail("Unknown DSC Max Slices (0x%02x).\n", max_slices);
}
}
if (x[8] & 0xf0) {
@@ -855,7 +861,7 @@ static void cta_hf_scdb(const unsigned char *x, unsigned length)
printf("%s\n", max_frl_rates[max_frl_rate]);
} else {
printf("Unknown (0x%02x)\n", max_frl_rate);
- fail("Unknown DSC Max Fixed Rate Link (0x%02x)\n", max_frl_rate);
+ fail("Unknown DSC Max Fixed Rate Link (0x%02x).\n", max_frl_rate);
}
}
if (x[9] & 0x3f)
@@ -917,7 +923,7 @@ static void cta_sadb(const unsigned char *x, unsigned length)
static void cta_vesa_dtcdb(const unsigned char *x, unsigned length)
{
if (length != 7 && length != 15 && length != 31) {
- fail("Invalid length %u\n", length);
+ fail("Invalid length %u.\n", length);
return;
}
@@ -937,7 +943,7 @@ static void cta_vesa_dtcdb(const unsigned char *x, unsigned length)
static void cta_vesa_vdddb(const unsigned char *x, unsigned length)
{
if (length != 30) {
- fail("Invalid length %u\n", length);
+ fail("Invalid length %u.\n", length);
return;
}
@@ -1012,7 +1018,7 @@ static void cta_vesa_vdddb(const unsigned char *x, unsigned length)
case 0x01: printf("Fast Scan is on the Major (Long) Axis and Slow Scan is on the Minor Axis\n"); break;
case 0x02: printf("Fast Scan is on the Minor (Short) Axis and Slow Scan is on the Major Axis\n"); break;
case 0x03: printf("Reserved\n");
- fail("Scan Direction used the reserved value 0x03\n");
+ fail("Scan Direction used the reserved value 0x03.\n");
break;
}
printf(" Subpixel Information: ");
@@ -1122,7 +1128,7 @@ static void cta_rcdb(const unsigned char *x, unsigned length)
printf(" %s\n", speaker_map[i]);
}
if ((x[0] & 0xa0) == 0x80)
- fail("'Display' flag set, but not the 'SLD' flag\n");
+ fail("'Display' flag set, but not the 'SLD' flag.\n");
if ((x[0] & 0x20) && length >= 7) {
printf(" Xmax: %u dm\n", x[4]);
printf(" Ymax: %u dm\n", x[5]);
@@ -1283,7 +1289,7 @@ static void cta_hdr_static_metadata_block(const unsigned char *x, unsigned lengt
printf(" %s\n", eotf_map[i]);
} else {
printf(" Unknown (%u)\n", i);
- fail("Unknown EOTF (%u)\n", i);
+ fail("Unknown EOTF (%u).\n", i);
}
}
}
@@ -1486,7 +1492,7 @@ void edid_state::cta_ext_block(const unsigned char *x, unsigned length)
printf(" Data Block (extended tag 0x%02x, length %u)\n", x[0], length);
hex_block(" ", x + 1, length);
data_block.clear();
- warn("Unknown Extended CTA Data Block 0x%02x\n", x[0]);
+ warn("Unknown Extended CTA Data Block 0x%02x.\n", x[0]);
return;
}
@@ -1502,7 +1508,7 @@ void edid_state::cta_ext_block(const unsigned char *x, unsigned length)
printf("Vendor-Specific Video Data Block, OUI 0x%06x\n", oui);
hex_block(" ", x + 4, length - 3);
data_block.clear();
- warn("Unknown Extended Vendor-Specific Video Data Block, OUI 0x%06x\n", oui);
+ warn("Unknown Extended Vendor-Specific Video Data Block, OUI 0x%06x.\n", oui);
return;
}
data_block = std::string("Vendor-Specific Video Data Block (") + name + ")";
@@ -1527,13 +1533,13 @@ void edid_state::cta_ext_block(const unsigned char *x, unsigned length)
cta_hf_eeodb(x + 1, length);
// This must be the first CTA block
if (!first_block)
- fail("Block starts at a wrong offset\n");
+ fail("Block starts at a wrong offset.\n");
return;
case 0x79:
if (!last_block_was_hdmi_vsdb)
- fail("HDMI Forum SCDB did not immediately follow the HDMI VSDB\n");
+ fail("HDMI Forum SCDB did not immediately follow the HDMI VSDB.\n");
if (have_hf_scdb || have_hf_vsdb)
- fail("Duplicate HDMI Forum VSDB/SCDB\n");
+ fail("Duplicate HDMI Forum VSDB/SCDB.\n");
if (x[1] || x[2])
printf(" Non-zero SCDB reserved fields!\n");
cta_hf_scdb(x + 3, length - 2);
@@ -1568,7 +1574,7 @@ void edid_state::cta_block(const unsigned char *x)
printf(" Vendor-Specific Data Block, OUI 0x%06x\n", oui);
hex_block(" ", x + 4, length - 3);
data_block.clear();
- warn("Unknown Vendor-Specific Data Block, OUI 0x%06x\n", oui);
+ warn("Unknown Vendor-Specific Data Block, OUI 0x%06x.\n", oui);
return;
}
data_block = std::string("Vendor-Specific Data Block (") + name + ")";
@@ -1578,14 +1584,14 @@ void edid_state::cta_block(const unsigned char *x)
last_block_was_hdmi_vsdb = 1;
first_block = 0;
if (edid_minor != 3)
- fail("The HDMI Specification uses EDID 1.3, not 1.%u\n", edid_minor);
+ fail("The HDMI Specification uses EDID 1.3, not 1.%u.\n", edid_minor);
return;
}
if (oui == 0xc45dd8) {
if (!last_block_was_hdmi_vsdb)
- fail("HDMI Forum VSDB did not immediately follow the HDMI VSDB\n");
+ fail("HDMI Forum VSDB did not immediately follow the HDMI VSDB.\n");
if (have_hf_scdb || have_hf_vsdb)
- fail("Duplicate HDMI Forum VSDB/SCDB\n");
+ fail("Duplicate HDMI Forum VSDB/SCDB.\n");
cta_hf_scdb(x + 4, length - 3);
have_hf_vsdb = 1;
break;
@@ -1613,7 +1619,7 @@ void edid_state::cta_block(const unsigned char *x)
printf(" Unknown CTA tag 0x%02x, length %u\n", tag, length);
hex_block(" ", x + 1, length);
data_block.clear();
- warn("Unknown CTA Data Block %u\n", tag);
+ warn("Unknown CTA Data Block %u.\n", tag);
break;
}
}
@@ -1632,8 +1638,14 @@ void edid_state::preparse_cta_block(const unsigned char *x)
for (unsigned i = 4; i < offset; i += (x[i] & 0x1f) + 1) {
bool for_ycbcr420 = false;
+ unsigned oui;
switch ((x[i] & 0xe0) >> 5) {
+ case 0x03:
+ oui = (x[i + 3] << 16) + (x[i + 2] << 8) + x[i + 1];
+ if (oui == 0x000c03)
+ has_hdmi = true;
+ break;
case 0x07:
if (x[i + 1] != 0x0e)
continue;
@@ -1663,7 +1675,7 @@ void edid_state::parse_cta_block(const unsigned char *x)
if (version >= 1) do {
if (version == 1 && x[3] != 0)
- fail("Non-zero byte 3\n");
+ fail("Non-zero byte 3.\n");
if (offset < 4)
break;
@@ -1675,7 +1687,7 @@ void edid_state::parse_cta_block(const unsigned char *x)
}
}
- if (version >= 2) {
+ if (version >= 2) {
if (x[3] & 0x80)
printf("Underscans PC formats by default\n");
if (x[3] & 0x40)
@@ -1684,7 +1696,11 @@ void edid_state::parse_cta_block(const unsigned char *x)
printf("Supports YCbCr 4:4:4\n");
if (x[3] & 0x10)
printf("Supports YCbCr 4:2:2\n");
+ if ((x[3] & 0x30) && (x[3] & 0x30) != 0x30)
+ msg(!has_hdmi, "If YCbCr support is indicated, then both 4:2:2 and 4:4:4 %s be supported.\n", has_hdmi ? "shall" : "should");
printf("%u native detailed modes\n", x[3] & 0x0f);
+ if (!(x[3] & 0x0f))
+ first_svd_might_be_preferred = true;
}
if (version == 3) {
unsigned i;
@@ -1703,17 +1719,17 @@ void edid_state::parse_cta_block(const unsigned char *x)
}
if (!memchk(detailed, x + 0x7f - detailed)) {
data_block = "Padding";
- fail("CTA-861 padding contains non-zero bytes\n");
+ fail("CTA-861 padding contains non-zero bytes.\n");
}
} while (0);
data_block.clear();
if (has_serial_number && has_serial_string)
- fail("Both the serial number and the serial string are set\n");
+ fail("Both the serial number and the serial string are set.\n");
if (!has_cta861_vic_1 && !has_640x480p60_est_timing)
fail("Required 640x480p60 timings are missing in the established timings"
- " and the SVD list (VIC 1)\n");
+ " and the SVD list (VIC 1).\n");
if ((supported_hdmi_vic_vsb_codes & supported_hdmi_vic_codes) !=
supported_hdmi_vic_codes)
- fail("HDMI VIC Codes must have their CTA-861 VIC equivalents in the VSB\n");
+ fail("HDMI VIC Codes must have their CTA-861 VIC equivalents in the VSB.\n");
}
diff --git a/parse-di-ext-block.cpp b/parse-di-ext-block.cpp
index 4b8efad..b69494a 100644
--- a/parse-di-ext-block.cpp
+++ b/parse-di-ext-block.cpp
@@ -18,7 +18,7 @@ void edid_state::parse_digital_interface(const unsigned char *x)
case 0x00:
printf("Analog Video Input\n");
if (!memchk(x + 2, 12))
- fail("Bytes 0x02-0x0d should be 0\n");
+ fail("Bytes 0x02-0x0d should be 0.\n");
return;
case 0x01: printf("DVI\n"); break;
case 0x02: printf("DVI Single Link\n"); break;
@@ -32,37 +32,37 @@ void edid_state::parse_digital_interface(const unsigned char *x)
case 0x0a: printf("Open LDI - Consumer Electronics\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Unknown Digital Interface 0x%02x\n", v);
+ fail("Unknown Digital Interface 0x%02x.\n", v);
break;
}
switch ((x[3]) >> 6) {
case 0x00:
if (!memchk(x + 3, 4))
- fail("Bytes 0x03-0x06 should be 0\n");
+ fail("Bytes 0x03-0x06 should be 0.\n");
break;
case 0x01:
printf(" Version %u.%u Release %u.%u\n", x[3] & 0x3f, x[4], x[5], x[6]);
if (x[4] > 99)
- fail("Version number > 99\n");
+ fail("Version number > 99.\n");
if (x[6] > 99)
- fail("Release number > 99\n");
+ fail("Release number > 99.\n");
break;
case 0x02:
if (x[3] & 0x3f)
- fail("Bits 5-0 of byte 0x03 should be 0\n");
+ fail("Bits 5-0 of byte 0x03 should be 0.\n");
if (x[5] || x[6])
- fail("Bytes 0x05-0x06 should be 0\n");
+ fail("Bytes 0x05-0x06 should be 0.\n");
printf(" Letter Designation: %c\n", x[4]);
break;
case 0x03:
if (x[3] & 0x3f)
- fail("Bits 5-0 of byte 0x03 should be 0\n");
+ fail("Bits 5-0 of byte 0x03 should be 0.\n");
printf(" Date Code: Year %u Week %u Day %u\n", 1990 + x[4], x[5], x[6]);
if (!x[5] || x[5] > 12)
- fail("Bad month number\n");
+ fail("Bad month number.\n");
if (!x[6] || x[6] > 31)
- fail("Bad day number\n");
+ fail("Bad day number.\n");
break;
}
@@ -73,7 +73,7 @@ void edid_state::parse_digital_interface(const unsigned char *x)
printf(" Data Enable Signal %s\n",
(v & 0x40) ? "Low" : "High");
else if (v & 0x40)
- fail("Bit 6 of byte 0x07 should be 0\n");
+ fail("Bit 6 of byte 0x07 should be 0.\n");
printf(" Edge of Shift Clock: ");
switch ((v >> 4) & 0x03) {
case 0: printf("Not specified\n"); break;
@@ -86,7 +86,7 @@ void edid_state::parse_digital_interface(const unsigned char *x)
(v & 0x04) ? "" : "not ");
printf(" Packetized Digital Video is %ssupported\n", (v & 0x02) ? "" : "not ");
if (v & 0x01)
- fail("Bit 0 of byte 0x07 should be 0\n");
+ fail("Bit 0 of byte 0x07 should be 0.\n");
v = x[8];
printf(" Data Formats: ");
@@ -98,26 +98,26 @@ void edid_state::parse_digital_interface(const unsigned char *x)
case 0x49: printf("48-Bit MSB-Aligned RGB (Dual Link - High Color)\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Unknown Data Format 0x%02x\n", v);
+ fail("Unknown Data Format 0x%02x.\n", v);
break;
}
if (x[2] == 0x03 && v != 0x48)
- fail("Data Format should be 0x48, not 0x%02x\n", v);
+ fail("Data Format should be 0x48, not 0x%02x.\n", v);
if (x[2] == 0x04 && v != 0x49)
- fail("Data Format should be 0x49, not 0x%02x\n", v);
+ fail("Data Format should be 0x49, not 0x%02x.\n", v);
v = x[9];
if (v) {
printf(" Minimum Pixel Clock Frequency Per Link: %u MHz\n", v);
if (v == 0xff)
- fail("Invalid Min-PCF 0x%02x\n", v);
+ fail("Invalid Min-PCF 0x%02x.\n", v);
}
v = x[10] | (x[11] << 8);
if (v) {
printf(" Maximum Pixel Clock Frequency Per Link: %u MHz\n", v);
if (v == 0xffff)
- fail("Invalid Max-PCF 0x%04x\n", v);
+ fail("Invalid Max-PCF 0x%04x.\n", v);
}
v = x[12] | (x[13] << 8);
@@ -142,7 +142,7 @@ void edid_state::parse_display_device(const unsigned char *x)
case 0x04: printf("Quad Pixel - G at bottom right & top left\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Unknown Sub-Pixel Layout 0x%02x\n", v);
+ fail("Unknown Sub-Pixel Layout 0x%02x.\n", v);
break;
}
printf(" Sub-Pixel Configuration: ");
@@ -155,7 +155,7 @@ void edid_state::parse_display_device(const unsigned char *x)
case 0x04: printf("Quad Pixel\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Unknown Sub-Pixel Configuration 0x%02x\n", v);
+ fail("Unknown Sub-Pixel Configuration 0x%02x.\n", v);
break;
}
printf(" Sub-Pixel Shape: ");
@@ -169,7 +169,7 @@ void edid_state::parse_display_device(const unsigned char *x)
case 0x05: printf("Elliptical\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Unknown Sub-Pixel Shape 0x%02x\n", v);
+ fail("Unknown Sub-Pixel Shape 0x%02x.\n", v);
break;
}
if (x[0x11])
@@ -200,7 +200,7 @@ void edid_state::parse_display_device(const unsigned char *x)
printf(" Monitor/display does %ssupport DDC/CI\n",
(v & 0x02) ? "" : "not ");
if (v & 0x01)
- fail("Bit 0 of byte 0x13 should be 0\n");
+ fail("Bit 0 of byte 0x13 should be 0.\n");
}
void edid_state::parse_display_caps(const unsigned char *x)
@@ -220,7 +220,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
case 0x03: printf("auto-stereoscopic, line interleave\n"); break;
default:
printf("Unknown (0x%02x)\n", (v & 0x70) >> 4);
- fail("Unknown Stereo Video 0x%02x\n", (v & 0x70) >> 4);
+ fail("Unknown Stereo Video 0x%02x.\n", (v & 0x70) >> 4);
break;
}
printf(" Scaler On Board: %s\n", (v & 0x08) ? "Yes" : "No");
@@ -238,14 +238,14 @@ void edid_state::parse_display_caps(const unsigned char *x)
case 0x03: printf("Both Vertical & Horizontal are converted to single frequencies\n"); break;
}
if (v & 0x1f)
- fail("Bits 4-0 of byte 0x15 should be 0\n");
+ fail("Bits 4-0 of byte 0x15 should be 0.\n");
v = x[0x16] | (x[0x17] << 8);
printf(" Vertical Frequency: ");
if (!v) {
printf("Not available\n");
} else if (v == 0xffff) {
printf("Reserved\n");
- fail("Vertical Frequency uses 0xffff (reserved value)\n");
+ fail("Vertical Frequency uses 0xffff (reserved value).\n");
} else {
printf("%.2f kHz\n", v / 100.0);
}
@@ -255,7 +255,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf("Not available\n");
} else if (v == 0xffff) {
printf("Reserved\n");
- fail("Horizontal Frequency uses 0xffff (reserved value)\n");
+ fail("Horizontal Frequency uses 0xffff (reserved value).\n");
} else {
printf("%.2f kHz\n", v / 100.0);
}
@@ -284,7 +284,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
case 0x02: printf("Fast Scan is on the Minor (Short) Axis and Slow Scan is on the Major Axis\n"); break;
case 0x03:
printf("Reserved\n");
- fail("Scan Direction used the reserved value 0x03\n");
+ fail("Scan Direction used the reserved value 0x03.\n");
break;
}
printf(" Standalone Projector: %s\n",
@@ -310,7 +310,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
case 0x0e: printf("Monochrome\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Unknown Default Color/Luminance Decoding 0x%02x\n", v);
+ fail("Unknown Default Color/Luminance Decoding 0x%02x.\n", v);
break;
}
v = x[0x1c];
@@ -323,7 +323,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
case 0x04: printf("Monochrome\n"); break;
default:
printf("Unknown (0x%02x)\n", v);
- fail("Unknown Preferred Color/Luminance Decoding 0x%02x\n", v);
+ fail("Unknown Preferred Color/Luminance Decoding 0x%02x.\n", v);
break;
}
v = x[0x1d];
@@ -348,12 +348,12 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf(" Color/Luminance Decoding Capabilities: None\n");
}
if (v & 0x03)
- fail("Bits 1-0 of byte 0x1e should be 0\n");
+ fail("Bits 1-0 of byte 0x1e should be 0.\n");
v = x[0x1f];
printf(" Dithering: %s\n", (v & 0x80) ? "Yes" : "No");
if (v & 0x7f)
- fail("Bits 6-0 of byte 0x1f should be 0\n");
+ fail("Bits 6-0 of byte 0x1f should be 0.\n");
v = x[0x20];
printf(" Supported Color Bit-Depth of Sub-Channel 0 (Blue): ");
if (!v) {
@@ -362,7 +362,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf("%u\n", v);
} else {
printf("Reserved (0x%02x)\n", v);
- fail("Supported Color Bit-Depth of Sub-Channel Blue value is 0x%02x\n", v);
+ fail("Supported Color Bit-Depth of Sub-Channel Blue value is 0x%02x.\n", v);
}
v = x[0x21];
printf(" Supported Color Bit-Depth of Sub-Channel 1 (Green): ");
@@ -372,7 +372,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf("%u\n", v);
} else {
printf("Reserved (0x%02x)\n", v);
- fail("Supported Color Bit-Depth of Sub-Channel Green value is 0x%02x\n", v);
+ fail("Supported Color Bit-Depth of Sub-Channel Green value is 0x%02x.\n", v);
}
v = x[0x22];
printf(" Supported Color Bit-Depth of Sub-Channel 2 (Red): ");
@@ -382,7 +382,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf("%u\n", v);
} else {
printf("Reserved (0x%02x)\n", v);
- fail("Supported Color Bit-Depth of Sub-Channel Red value is 0x%02x\n", v);
+ fail("Supported Color Bit-Depth of Sub-Channel Red value is 0x%02x.\n", v);
}
v = x[0x23];
printf(" Supported Color Bit-Depth of Sub-Channel 0 (Cb/Pb): ");
@@ -392,7 +392,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf("%u\n", v);
} else {
printf("Reserved (0x%02x)\n", v);
- fail("Supported Color Bit-Depth of Sub-Channel Cb/Pb value is 0x%02x\n", v);
+ fail("Supported Color Bit-Depth of Sub-Channel Cb/Pb value is 0x%02x.\n", v);
}
v = x[0x24];
printf(" Supported Color Bit-Depth of Sub-Channel 1 (Y): ");
@@ -402,7 +402,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf("%u\n", v);
} else {
printf("Reserved (0x%02x)\n", v);
- fail("Supported Color Bit-Depth of Sub-Channel Y value is 0x%02x\n", v);
+ fail("Supported Color Bit-Depth of Sub-Channel Y value is 0x%02x.\n", v);
}
v = x[0x25];
printf(" Supported Color Bit-Depth of Sub-Channel 2 (Cr/Pr): ");
@@ -412,7 +412,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf("%u\n", v);
} else {
printf("Reserved (0x%02x)\n", v);
- fail("Supported Color Bit-Depth of Sub-Channel Cr/Pr value is 0x%02x\n", v);
+ fail("Supported Color Bit-Depth of Sub-Channel Cr/Pr value is 0x%02x.\n", v);
}
v = x[0x26];
@@ -426,7 +426,7 @@ void edid_state::parse_display_caps(const unsigned char *x)
printf(" Variable (Expand/Shrink) Mode: %s\n", (v & 0x10) ? "Yes" : "No");
}
if (v & 0x0f)
- fail("Bits 3-0 of byte 0x26 should be 0\n");
+ fail("Bits 3-0 of byte 0x26 should be 0.\n");
}
void edid_state::parse_display_xfer(const unsigned char *x)
@@ -441,10 +441,10 @@ void edid_state::parse_display_xfer(const unsigned char *x)
case 0x00:
printf(" No Display Transfer Characteristics\n");
if (!memchk(x + 0x51, 46))
- fail("Bytes 0x51-0x7e should be 0\n");
+ fail("Bytes 0x51-0x7e should be 0.\n");
return;
case 0x03:
- fail("Bits 7-6 of byte 0x51 cannot be 0x03\n");
+ fail("Bits 7-6 of byte 0x51 cannot be 0x03.\n");
return;
default:
break;
@@ -452,30 +452,30 @@ void edid_state::parse_display_xfer(const unsigned char *x)
if (((v & 0xc0) >> 6) == 0x01) {
if (!num_entries || num_entries > 45)
- fail("White Curve with %u entries\n", num_entries);
+ fail("White Curve with %u entries.\n", num_entries);
if (num_entries > 45)
num_entries = 45;
if (!memchk(x + 0x52 + num_entries, 45 - num_entries))
- fail("Bytes 0x%02x-0x7e should be 0\n", 0x52 + num_entries);
+ fail("Bytes 0x%02x-0x7e should be 0.\n", 0x52 + num_entries);
printf(" White Curve (%u entries):\n", num_entries);
hex_block(" ", x + 0x52, num_entries, false, 15);
} else {
if (!num_entries || num_entries > 15)
- fail("Sub-Channel Curve with %u entries\n", num_entries);
+ fail("Sub-Channel Curve with %u entries.\n", num_entries);
if (num_entries > 15)
num_entries = 15;
printf(" Sub-Channel 0 (Blue) Curve with %u entries:\n", num_entries);
hex_block(" ", x + 0x52, num_entries, false);
if (!memchk(x + 0x52 + num_entries, 15 - num_entries))
- fail("Bytes 0x%02x-0x7e should be 0\n", 0x52 + num_entries);
+ fail("Bytes 0x%02x-0x7e should be 0.\n", 0x52 + num_entries);
printf(" Sub-Channel 1 (Green) Curve with %u entries:\n", num_entries);
hex_block(" ", x + 0x52 + 15, num_entries, false);
if (!memchk(x + 0x52 + 15 + num_entries, 15 - num_entries))
- fail("Bytes 0x%02x-0x7e should be 0\n", 0x52 + 15 + num_entries);
+ fail("Bytes 0x%02x-0x7e should be 0.\n", 0x52 + 15 + num_entries);
printf(" Sub-Channel 2 (Red) Curve with %u entries:\n", num_entries);
hex_block(" ", x + 0x52 + 30, num_entries, false);
if (!memchk(x + 0x52 + 30 + num_entries, 15 - num_entries))
- fail("Bytes 0x%02x-0x7e should be 0\n", 0x52 + 30 + num_entries);
+ fail("Bytes 0x%02x-0x7e should be 0.\n", 0x52 + 30 + num_entries);
}
}
@@ -483,15 +483,15 @@ void edid_state::parse_di_ext_block(const unsigned char *x)
{
printf("%s Version %u\n", block.c_str(), x[1]);
if (!x[1])
- fail("Invalid version 0\n");
+ fail("Invalid version 0.\n");
parse_digital_interface(x);
parse_display_device(x);
parse_display_caps(x);
if (!memchk(x + 0x27, 16))
- fail("Bytes 0x27-0x36 should be 0\n");
+ fail("Bytes 0x27-0x36 should be 0.\n");
if (!memchk(x + 0x37, 17))
- fail("Bytes 0x37-0x47 should be 0\n");
+ fail("Bytes 0x37-0x47 should be 0.\n");
if (!memchk(x + 0x48, 9))
fail("Bytes 0x48-0x50 should be 0\n");
parse_display_xfer(x);
diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index 9f0ccb6..605d46a 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -46,7 +46,7 @@ static void check_displayid_datablock_revision(const unsigned char *x)
unsigned char revisionflags = x[1];
if (revisionflags)
- warn("Unexpected revision and flags (0x%02x != 0)\n", revisionflags);
+ warn("Unexpected revision and flags (0x%02x != 0).\n", revisionflags);
}
static bool check_displayid_datablock_length(const unsigned char *x,
@@ -57,11 +57,11 @@ static bool check_displayid_datablock_length(const unsigned char *x,
unsigned char len = x[2];
if (expectedlenmin == expectedlenmax && len != expectedlenmax)
- fail("DisplayID payload length is different than expected (%d != %d)\n", len, expectedlenmax);
+ fail("DisplayID payload length is different than expected (%d != %d).\n", len, expectedlenmax);
else if (len > expectedlenmax)
- fail("DisplayID payload length is greater than expected (%d > %d)\n", len, expectedlenmax);
+ fail("DisplayID payload length is greater than expected (%d > %d).\n", len, expectedlenmax);
else if (len < expectedlenmin)
- fail("DisplayID payload length is less than expected (%d < %d)\n", len, expectedlenmin);
+ fail("DisplayID payload length is less than expected (%d < %d).\n", len, expectedlenmin);
else
return true;
@@ -182,7 +182,7 @@ void edid_state::parse_displayid_color_characteristics(const unsigned char *x)
if (xfer_id) {
printf(" Associated with Transfer Characteristics Data Block with Identifier %u\n", xfer_id);
if (!(preparse_xfer_ids & (1 << xfer_id)))
- fail("Missing Transfer Characteristics Data Block with Identifier %u\n", xfer_id);
+ fail("Missing Transfer Characteristics Data Block with Identifier %u.\n", xfer_id);
}
if (!num_primaries) {
printf(" Uses color space %s\n",
@@ -258,7 +258,7 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x, bool ty
break;
default:
s += "undefined";
- fail("Unknown aspect 0x%02x\n", x[3] & 0xf);
+ fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
break;
}
switch ((x[3] >> 5) & 0x3) {
@@ -273,7 +273,7 @@ void edid_state::parse_displayid_type_1_7_timing(const unsigned char *x, bool ty
break;
case 3:
s += ", reserved";
- fail("Reserved stereo 0x03\n");
+ fail("Reserved stereo 0x03.\n");
break;
}
@@ -351,7 +351,7 @@ void edid_state::parse_displayid_type_2_timing(const unsigned char *x)
break;
case 3:
s += ", reserved";
- fail("Reserved stereo 0x03\n");
+ fail("Reserved stereo 0x03.\n");
break;
}
if (x[3] & 0x80)
@@ -409,7 +409,7 @@ void edid_state::parse_displayid_type_3_timing(const unsigned char *x)
break;
default:
s += "undefined";
- fail("Unknown aspect 0x%02x\n", x[3] & 0xf);
+ fail("Unknown aspect 0x%02x.\n", x[3] & 0xf);
break;
}
@@ -568,7 +568,7 @@ static void parse_displayid_display_device(const unsigned char *x)
case 0x01: printf("Fast Scan is on the Major (Long) Axis and Slow Scan is on the Minor Axis\n"); break;
case 0x02: printf("Fast Scan is on the Minor (Short) Axis and Slow Scan is on the Major Axis\n"); break;
case 0x03: printf("Reserved\n");
- fail("Scan Direction used the reserved value 0x03\n");
+ fail("Scan Direction used the reserved value 0x03.\n");
break;
}
printf(" Sub-pixel layout/configuration/shape: ");
@@ -626,7 +626,7 @@ void edid_state::parse_displayid_transfer_characteristics(const unsigned char *x
if (xfer_id) {
printf(" Transfer Characteristics Data Block Identifier: %u\n", xfer_id);
if (!(preparse_color_ids & (1 << xfer_id)))
- fail("Missing Color Characteristics Data Block using Identifier %u\n", xfer_id);
+ fail("Missing Color Characteristics Data Block using Identifier %u.\n", xfer_id);
}
if (first_is_white)
printf(" The first curve is the 'white' transfer characteristic\n");
@@ -857,7 +857,7 @@ void edid_state::parse_displayid_type_5_timing(const unsigned char *x)
break;
case 3:
s += ", reserved";
- fail("Reserved stereo 0x03\n");
+ fail("Reserved stereo 0x03.\n");
break;
}
if (x[0] & 0x10)
@@ -928,11 +928,11 @@ static void parse_displayid_tiled_display_topology(const unsigned char *x, bool
printf(" Left bevel size: %.1f pixels\n",
pix_mult * x[15] / 10.0);
} else {
- fail("No bevel information, but the pixel multiplier is non-zero\n");
+ fail("No bevel information, but the pixel multiplier is non-zero.\n");
}
printf(" Tile resolution: %ux%u\n", tile_width + 1, tile_height + 1);
} else if (pix_mult) {
- fail("No bevel information, but the pixel multiplier is non-zero\n");
+ fail("No bevel information, but the pixel multiplier is non-zero.\n");
}
if (is_v2)
printf(" Tiled Display Manufacturer/Vendor ID: %02X-%02X-%02X\n",
@@ -997,7 +997,7 @@ void edid_state::parse_displayid_type_6_timing(const unsigned char *x)
break;
case 3:
s += ", reserved";
- fail("Reserved stereo 0x03\n");
+ fail("Reserved stereo 0x03.\n");
break;
}
@@ -1120,7 +1120,7 @@ void edid_state::parse_displayid_type_9_timing(const unsigned char *x)
break;
case 3:
s += ", reserved";
- fail("Reserved stereo 0x03\n");
+ fail("Reserved stereo 0x03.\n");
break;
}
if (x[0] & 0x10)
@@ -1303,7 +1303,7 @@ static std::string product_type(unsigned version, unsigned char x, bool heading)
default: break;
}
}
- fail("Unknown %s 0x%02x\n", headingstr.c_str(), x);
+ fail("Unknown %s 0x%02x.\n", headingstr.c_str(), x);
return std::string("Unknown " + headingstr + " (") + utohex(x) + ")";
}
@@ -1359,13 +1359,13 @@ void edid_state::parse_displayid_block(const unsigned char *x)
length, ext_count);
if (ext_count > 0)
- warn("Non-0 DisplayID extension count %d\n", ext_count);
+ warn("Non-0 DisplayID extension count %d.\n", ext_count);
printf("%s: %s\n", product_type(version, prod_type, true).c_str(),
product_type(version, prod_type, false).c_str());
if (length > 121) {
- fail("DisplayID length %d is greater than 121\n", length);
+ fail("DisplayID length %d is greater than 121.\n", length);
length = 121;
}
@@ -1419,7 +1419,7 @@ void edid_state::parse_displayid_block(const unsigned char *x)
if (length < 3) {
// report a problem when the remaining bytes are not 0.
if (tag || x[offset + 1]) {
- fail("Not enough bytes remain (%d) for a DisplayID data block or the DisplayID filler is non-0\n", length);
+ fail("Not enough bytes remain (%d) for a DisplayID data block or the DisplayID filler is non-0.\n", length);
}
break;
}
@@ -1427,14 +1427,14 @@ void edid_state::parse_displayid_block(const unsigned char *x)
unsigned len = x[offset + 2];
if (length < len + 3) {
- fail("The length of this DisplayID data block (%d) exceeds the number of bytes remaining (%d)\n", len + 3, length);
+ fail("The length of this DisplayID data block (%d) exceeds the number of bytes remaining (%d).\n", len + 3, length);
break;
}
if (!tag && !len) {
// A Product Identification Data Block with no payload bytes is not valid - assume this is the end.
if (!memchk(x + offset, length)) {
- fail("Non-0 filler bytes in the DisplayID block\n");
+ fail("Non-0 filler bytes in the DisplayID block.\n");
}
break;
}
@@ -1535,6 +1535,6 @@ void edid_state::parse_displayid_block(const unsigned char *x)
if (!memchk(x + 1 + x[2] + 5, 0x7f - (1 + x[2] + 5))) {
data_block = "Padding";
- fail("DisplayID padding contains non-zero bytes\n");
+ fail("DisplayID padding contains non-zero bytes.\n");
}
}
diff --git a/parse-ls-ext-block.cpp b/parse-ls-ext-block.cpp
index 1776715..8c39f48 100644
--- a/parse-ls-ext-block.cpp
+++ b/parse-ls-ext-block.cpp
@@ -24,7 +24,7 @@ static void parse_string_table(const unsigned char *x)
case 2: printf("UTF 32BE\n"); break;
default:
printf("Unknown (0x%02x)\n", x[0] & 7);
- fail("Unknown UTF Type (0x%02x)\n", x[0] & 7);
+ fail("Unknown UTF Type (0x%02x).\n", x[0] & 7);
break;
}
printf(" Country Code ID (ISO 3166-3): %u\n", ((x[1] & 0x3f) << 8) | x[2]);
@@ -63,6 +63,6 @@ void edid_state::parse_ls_ext_block(const unsigned char *x)
}
if (!memchk(x, orig + 127 - x)) {
data_block.clear();
- fail("Non-zero values in unused space\n");
+ fail("Non-zero values in unused space.\n");
}
}
diff --git a/parse-vtb-ext-block.cpp b/parse-vtb-ext-block.cpp
index 9e2fa6d..55d7e81 100644
--- a/parse-vtb-ext-block.cpp
+++ b/parse-vtb-ext-block.cpp
@@ -11,7 +11,7 @@ void edid_state::parse_vtb_ext_block(const unsigned char *x)
{
printf("%s Version %u\n", block.c_str(), x[1]);
if (x[1] != 1)
- fail("Invalid version %u\n", x[1]);
+ fail("Invalid version %u.\n", x[1]);
unsigned num_dtb = x[2];
unsigned num_cvt = x[3];

Privacy Policy