Commit graph

6 commits

Author SHA1 Message Date
Simon Ser
ef4661147e edid: validate extension block tag
Skip any extension block with an unsupported tag to make sure we don't
return a bogus enum value to the user.

Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/merge_requests/16#note_1396993
2022-05-25 11:32:59 +02:00
Simon Ser
a20fda18dd edid: check that the blob size is divisible by the block size
This is something edid-decode does, and this ensures we don't miss
any byte when parsing the blob.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-24 06:14:20 +00:00
Simon Ser
ad8038fdec edid: use hex offsets
This is what the specification uses. Makes it easier to compare the
code to the spec.

No functional change, this is purely a cosmetic change.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-20 09:21:49 +00:00
Simon Ser
1c0f7497f5 edid: add low-level API to enumerate extension blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-09 14:33:58 +02:00
Simon Ser
882d34cebb edid: add vendor and product identification data
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-09 14:33:58 +02:00
Simon Ser
ad1e3f4167 Add very basic EDID functions
Introduce an opaque struct di_edid to host EDID structures. Add
a function to create a di_edid (with basic size, header and
checksum validation). Add functions to fetch the EDID version and
revision.

This doesn't do much, but hopefully can be used as a fundation.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-05 16:42:10 +02:00