aboutsummaryrefslogtreecommitdiffstats
path: root/parse-base-block.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-02-13 12:17:52 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-02-13 12:17:52 +0100
commit2e016dd4a44771184a13ebd55d5b3f294b99751b (patch)
tree0d1eba1f452e08e3e8485051b6d8c66e54c318f0 /parse-base-block.cpp
parentff5eb4659d6c6717c350108dd5bcd552c3d9ee0b (diff)
edid-decode: improve GTF Secondary Curve handling
1) Add units where applicable for the sec. curve params. 2) Show only one decimal for C and J 3) Remove check if x[13] or x[17] > 127: this is wrong since x[13] is C / 2, not C. 4) Add check if the sec curve block is all 0, even though support for the sec curve is signaled in the EDID. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-base-block.cpp')
-rw-r--r--parse-base-block.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 604bd1e..9dbde81 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -1019,16 +1019,16 @@ void edid_state::detailed_display_range_limits(const unsigned char *x)
if (has_sec_gtf) {
if (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");
- 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");
+ if (memchk(x + 12, 6)) {
+ fail("Zeroed Secondary Curve Block.\n");
+ } else {
+ printf(" GTF Secondary Curve Block:\n");
+ printf(" Start frequency: %u kHz\n", x[12] * 2);
+ printf(" C: %.1f%%\n", x[13] / 2.0);
+ printf(" M: %u%%/kHz\n", (x[15] << 8) | x[14]);
+ printf(" K: %u\n", x[16]);
+ printf(" J: %.1f%%\n", x[17] / 2.0);
+ }
} else if (is_cvt) {
int max_h_pixels = 0;

Privacy Policy