aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-09-16 10:27:03 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-09-16 10:27:03 +0200
commit40690d6d283d1870abb9b2596565fc14c55da3db (patch)
treeedd49acb42a8541eb20245aef11bf2a28dd084cc
parent827d51f1812a34fdd55b9cf33f02fe1365cd3f9b (diff)
edid-decode: warn if sRGB and gamma != 2.2
If the sRGB bit is set, but the gamma is not 2.2, then warn about that. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--parse-base-block.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index eacbd81..174af51 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -1456,7 +1456,7 @@ void edid_state::parse_base_block(const unsigned char *x)
if (x[0x17] == 0xff)
printf(" Gamma is defined in an extension block\n");
else
- printf(" Gamma: %.2f\n", ((x[0x17] + 100.0) / 100.0));
+ printf(" Gamma: %.2f\n", (x[0x17] + 100.0) / 100.0);
if (x[0x18] & 0xe0) {
printf(" DPMS levels:");
@@ -1487,6 +1487,8 @@ 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");
+ if (x[0x17] != 120)
+ warn("sRGB is signaled, but the gamma != 2.2.\n");
} else if (!memcmp(x + 0x19, srgb_chromaticity, sizeof(srgb_chromaticity))) {
fail("The chromaticities match sRGB, but sRGB is not signaled.\n");
}

Privacy Policy