Commit graph

122 commits

Author SHA1 Message Date
Simon Ser
1f416f554a ci: add FreeBSD
The libc there is a bit different, so it's nice to make sure we
don't break it.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-08 12:28:52 +02:00
Simon Ser
3e60b02037 ci: generalize prepare/build steps
Extract common step settings and use `extends` to inherit them.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-08 12:09:38 +02:00
Simon Ser
8b9c8e01f5 ci: include image name in build steps
We'll add non-Alpine build steps soon.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-08 11:53:51 +02:00
Simon Ser
c637a9daf8 edid: parse timing data from CVT range limit descriptor
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-06 09:27:32 +02:00
Simon Ser
7c8bcb09eb edid: parse timing data from secondary GTF range limit descriptor
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-06 09:26:32 +02:00
Simon Ser
df9e7eedaa edid: check padding in range limits descriptor
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-06 09:26:00 +02:00
Simon Ser
7e0b8c1af9 test/data: add viewsonic-vp2768-dp
It contains a CVT range limits descriptor.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-06 09:25:57 +02:00
Simon Ser
da89d95268 test/data: add msi-mag321curv-dp
It contains a GTF secondary range limit descriptor.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-06 09:25:12 +02:00
Simon Ser
407b309904 cta: add support for video capability data block
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-05 18:11:56 +00:00
Simon Ser
edb952756d cta: rename di_edid_cta_flags.underscan to it_underscan
Make it clear this is only about IT video formats.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-05 18:11:56 +00:00
Simon Ser
7a6d694b1a Add basic support for DisplayID in EDID extension blocks
Establish the new headers and structs, and just parse the
version/revision for now.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-02 06:42:06 +00:00
Simon Ser
789a927569 test/data: add apple-xdr-dp
Contains DisplayID extension blocks.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-02 06:42:06 +00:00
Simon Ser
0c8673af02 cta: add support for video data blocks
Report the SVDs inside the video data block.

We'll need to add additional APIs to get detailed SVD mode info
in the future (with a SVD table).

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-31 13:18:34 +00:00
Sebastian Wick
9806eb214e cta: make HDR eotfs and descriptors directly accessible from the block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2022-08-30 15:17:57 +02:00
Sebastian Wick
44e1810f2b edid: split the detailed timing signal union into separate structs
Nested structs makes it impossible to extend the nested struct after
extending the base struct. The union acts as a single struct in this
case but the nesting is still an issue. Use pointers to those structs instead
to keep all of them extensible. Only the struct which is applicable for the
signal type is not a null pointer to make sure only valid data is accessed.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2022-08-30 12:24:46 +02:00
Simon Ser
4e5df43659 test: rename EDID files with .edid filename extension
This makes it easier to perform an operation on all EDID files at
once, e.g. "test/edid-decode-diff.sh test/data/*.edid" to update all
diffs at once.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 15:23:41 +02:00
Simon Ser
37a6186445 test/edid-decode-diff: do not fail if .diff doesn't exist
Call rm with the -f flag to ignore non-existing .diff files.
The .diff file doesn't exist if there is no difference in the
edid-decode output.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 13:59:52 +02:00
Simon Ser
93b0fd18de edid: add support for standard timings descriptor
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 11:54:48 +00:00
Simon Ser
1911c0be81 edid: refactor parse_standard_timing() with an output param
To parse standard timing descriptors, we'll need to re-use that
function and store the result elsewhere.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 11:54:48 +00:00
Simon Ser
355a3aca80 cta: parse HDR static metadata blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 13:52:50 +02:00
Simon Ser
f5f8371965 edid: add prefix to range limits failure messages
Upstream edid-decode uses a global variable to store the current
EDID section name and prefix failure messages.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 10:19:48 +00:00
Andrea Pappacoda
2d889cead4
build: stop using meson's implicit setup command
It will be deprecated in the next release, 0.64.0. See
https://github.com/mesonbuild/meson/pull/10701

Signed-off-by: Andrea Pappacoda <andrea@pappacoda.it>
2022-08-23 23:14:31 +02:00
Adarsh G M
f0c3ed08b9 di-edid-decode: help message for the executable
Signed-off-by: Adarsh G M <adarsh.g.m@intel.com>
Signed-off-by: Naveen Kumar <naveen1.kumar@intel.com>
2022-08-18 11:59:09 +00:00
Simon Ser
41507c0b5f ci: update edid-decode
This new version contains a fix for a bogus failure message.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-15 14:58:59 +02:00
Simon Ser
92c0933b44 edid: parse analog video input params
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-09 09:07:17 +00:00
Simon Ser
febb8b56f9 edid: parse digital video input flags for EDID 1.3-
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-09 09:05:44 +00:00
Simon Ser
c784d978fb cta: parse detailed timing definitions
After the data blocks, the CTA extension contains a list of DTDs.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-08 18:41:18 +02:00
Simon Ser
7275f65131 edid: expose _di_edid_parse_detailed_timing_def
This is a private function which parses DTDs. This will be useful
in the next commit to parse DTDs from the CTA extension.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-08 18:37:52 +02:00
Simon Ser
501c20f854 edid: parse established timings I and II
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-08 16:33:14 +00:00
Simon Ser
0e271c53f5 edid: check first byte descriptor is a DTD
EDID 1.2- allow the first byte descriptor to contain a display
descriptor. EDID 1.3+ require the first byte descriptor to contain
a detailed timing definition describing the display's preferred
(ie, optimal) mode.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-08 16:32:12 +00:00
Simon Ser
9198ef48a3 edid: fix typo in di_edid_get_standard_timings() doc comment
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-08 16:29:43 +00:00
Simon Ser
06a05c83c0 cta: log failures
Use the newly-introduced di_logger to report CTA failures.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-04 08:40:36 +02:00
Simon Ser
7834b6ba22 info: introduce di_logger
This can be used by parsers (EDID, CTA, DisplayID, etc) to report
errors.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-04 08:40:36 +02:00
Simon Ser
8e7308358e edid: parse analog and digital flags in DTDs
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-03 18:49:00 +00:00
Simon Ser
f11ec2b9ab edid: parse DTD signal type
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-03 18:49:00 +00:00
Simon Ser
0e3f4cedbf edid: fix product year < 2006 in EDID 1.3
EDID 1.4 forbids years < 2006, but EDID 1.3 allows them.

Error out when an EDID uses a reserved value. Correctly parse the
year on older EDID revisions.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-03 18:49:00 +00:00
Simon Ser
21f7fe66a0 test/data: add sun-gh19ps-dvi
It contains unusual DTD flags, a manufacture year we don't parse
correctly yet, and GTF support.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-03 18:49:00 +00:00
Simon Ser
fc10923200 edid: drop unnecessary ENOTSUP checks
These functions now only return false on fatal failures
(e.g. out of memory). They no longer return false for unsupported
block types.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-03 09:32:12 +02:00
Simon Ser
051d25a406 edid: drop return value for parse_chromaticity_coords()
We always return true now that we report non-fatal failures.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-03 06:57:46 +00:00
Simon Ser
ad15d6ac6d edid: drop return value for parse_basic_params_features()
We always return true now that we report non-fatal failures.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-03 06:57:46 +00:00
Simon Ser
44963edc4c cta: parse colorimetry data blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 22:21:19 +02:00
Simon Ser
1a1a025de8 edid: fix negative errno
errno holds positive values.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 19:51:23 +00:00
Simon Ser
1ce9128701 di-edid-decode: exit with non-zero code on conformance failure
Upstream edid-decode does the same.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 21:48:52 +02:00
Simon Ser
3b64049622 di-edid-decode: print failure message
Mirror upstream edid-decode.

samsung-s27a950d-dp and hp-5dq99aa-hdmi are missing some failures
about features we haven't implemented yet. panasonic-mei96a2-dp
has a bogus "Missing Display Product Name" failure, see [1].

[1]: https://lore.kernel.org/linux-media/20220802093219.30599-1-contact@emersion.fr/T/#u

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 21:48:01 +02:00
Simon Ser
79e0ac2dd4 test: include edid-decode failure messages in diffs
This will allow us to check that we find the same failures as
upstream edid-decode.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 21:47:35 +02:00
Simon Ser
4f4aa025cf edid: add display range limits type
This is a bit messy because the values depend on various misc flags
defined earlier in the spec, and the meaning changes between EDID 1.3
and 1.4. On top of that edid-decode prints something confusing in the
EDID 1.3 case.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 20:07:08 +02:00
Simon Ser
cf66667ac3 edid: stop setting errno in parse_display_range_limits
The only caller skips any descriptor with errors, it doesn't surface
back the errno to the library user.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 20:05:41 +02:00
Simon Ser
e047d89f94 cta: add support for enumerating data blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-01 16:41:59 +02:00
Simon Ser
67af3033ee cta: add support for misc flags
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-01 16:41:59 +02:00
Simon Ser
a29c533b66 Extract bit helpers into shared header
This will allow us to use the helpers from cta.c.

The functions are marked "static inline" to avoid warnings about
unused functions.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-01 16:41:58 +02:00