aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_internal_parse_edid.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-07 19:41:58 +0100
committerMattias Andrée <maandree@kth.se>2021-03-07 19:41:58 +0100
commit6b52a03b6fea132a6a994a6acc2801eb804e8d87 (patch)
tree2e4e662dc0313a205a936f9eb120849d8e4ea477 /libgamma_internal_parse_edid.c
parentAdd chroma and white point support from EDID, add version support to methods caps and CRTC info, support EDID 1.4, and support EDID with extensions (diff)
downloadlibgamma-6b52a03b6fea132a6a994a6acc2801eb804e8d87.tar.gz
libgamma-6b52a03b6fea132a6a994a6acc2801eb804e8d87.tar.bz2
libgamma-6b52a03b6fea132a6a994a6acc2801eb804e8d87.tar.xz
Assume all EDID 1.x are compatible
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libgamma_internal_parse_edid.c')
-rw-r--r--libgamma_internal_parse_edid.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/libgamma_internal_parse_edid.c b/libgamma_internal_parse_edid.c
index 32641c1..6041556 100644
--- a/libgamma_internal_parse_edid.c
+++ b/libgamma_internal_parse_edid.c
@@ -26,8 +26,6 @@
int
libgamma_internal_parse_edid(libgamma_crtc_information_t *restrict this, unsigned long long fields)
{
-#define __test_version(edid, major, minor_min, minor_max)\
- ((edid)[18] == (major) && (minor_min) <= (edid)[19] && (edid)[19] <= (minor_max))
#define __m(value)\
(this->edid[index++] != (value))
@@ -44,14 +42,10 @@ libgamma_internal_parse_edid(libgamma_crtc_information_t *restrict this, unsigne
/* Check that the magic number of that of the EDID structure */
else if (__m(0x00) || __m(0xFF) || __m(0xFF) || __m(0xFF) || __m(0xFF) || __m(0xFF) || __m(0xFF) || __m(0x00))
error = LIBGAMMA_EDID_WRONG_MAGIC_NUMBER;
- /* Check that EDID structure revision 1.1–1.4 is used, those are the only
- * version we support. EDID structure revisions 1.3 and 1.4 is also by far
- * the most commonly use revision and it is currently the newest revisions.
- * We know that parsing works for revisions 1.1, 1.3, and 1.4, because of
- * this we assume it is also correct for revision 1.2. However, we are not
- * assuming this for revision 1.0 which appeared in August 1994 and was
- * replaced by revision 1.1 in April 1996. */
- else if (!__test_version(this->edid, 1, 1, 4))
+ /* Check that EDID structure revision 1.x is used. We only know that we
+ * support revisions 1.1, 1.3, and 1.4, and since they are all comptible,
+ * we assume that all 1.x are compatible. */
+ else if (this->edid[18] != 1)
error = LIBGAMMA_EDID_REVISION_UNSUPPORTED;
/* If we have encountered an error, report it for the fields that require
@@ -127,5 +121,4 @@ libgamma_internal_parse_edid(libgamma_crtc_information_t *restrict this, unsigne
return error | this->gamma_error;
#undef __m
-#undef __test_version
}