Commit graph

64 commits

Author SHA1 Message Date
Simon Ser
823afd5c94 edid: fix interlaced timing printing in DTDs
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-07 07:06:36 +02:00
Simon Ser
eea7215002 di-edid-decode: print preferred flag for type I timing
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-03 14:14:45 +02:00
Simon Ser
cad7de92c7 displayid: add support for display parameters data block
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-03 08:56:03 +02:00
Simon Ser
d7144ad9b9 displayid: parse type I timings
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-03 06:32:38 +00:00
Simon Ser
87e264f7fb Introduce di_gtf_compute()
This is a function to compute a timing according to GTF.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-29 11:50:09 +00:00
Sebastian Wick
11f48480d8 cta: add support for VESA Display Transfer Characteristic data block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2022-09-28 23:56:46 +02:00
Simon Ser
40d8018a7e displayid: parse data blocks
Just parse the tag for now.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-27 07:56:09 +00:00
Simon Ser
ceabc884fd displayid: parse product type
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-27 07:56:09 +00:00
Sebastian Wick
ef67125056 edid: add support for Color Management Data descriptors
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2022-09-26 21:51:58 +02:00
Simon Ser
28beee232c edid: parse established timings III
This display descriptor contains a bitfield indicating support for
DMT timings.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-26 09:18:59 +02:00
Simon Ser
df676bef3a di-edid-decode: fix inverted text for analog video setup
The texts and cases are inverted here.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-17 09:07:20 +02:00
Simon Ser
047e8bb305 edid: expose struct di_dmt_timing
This allows callers to access the detailed DMT data.

di-edid-decode is updated to print the missing fields.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-17 06:53:39 +00:00
Sebastian Wick
cc7597d9cc edid: add support for color point descriptors
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2022-09-15 16:26:03 +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
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
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
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
355a3aca80 cta: parse HDR static metadata blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-29 13:52:50 +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
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
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
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
44963edc4c cta: parse colorimetry data blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-02 22:21:19 +02: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
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
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
afdacff9f8 cta: introduce new API for CTA-861
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-01 16:41:33 +02:00
Simon Ser
b22dcc8af8 edid: add di_edid_standard_timing_get_dmt_id
This returns the DMT ID of an EDID standard timing, if any.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-01 14:35:33 +00:00
Simon Ser
fed3a18b64 edid: add support for chromaticity coordinates
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-21 16:14:52 +02:00
Simon Ser
2b6f3804a0 edid: parse standard timings
The edid-decode output uses data from the DMT, so we're not able
to replicate it yet.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-21 16:07:52 +02:00
Simon Ser
669bdac3c8 edid: parse display color type
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-21 12:48:49 +00:00
Simon Ser
197c5f5ee1 edid: parse interlaced/stereo flags from DTDs
The analog/digital flags are left for a future patch.

A join_str() function is introduced in di-edid-decode: upstream
edid-decode uses a comma-separated list with a handful of other
flags.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-17 11:22:09 +02:00
Simon Ser
d40a89262d edid: document that DTD size in mm can be unset
According to table 3.21 note 17, these fields should be set to zero
for some sinks, e.g. front projectors.

edid-decode hides the size from its output if both fields are zero.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-17 10:11:20 +02:00
Simon Ser
adddd56680 di-edid-decode: remove default cases for enum switches
The motivation is two-fold:

- These were added back when we exposed values outside of the enum
  entries. We no longer do that, so these can't be hit.
- The compiler now warns when we are missing an entry from the switch.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-16 11:12:06 +00:00
Simon Ser
37711a44ed di-edid-decode: add missing DI_EDID_EXT_DPVL name
This is missing from the switch.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-16 11:12:06 +00:00
Simon Ser
c8b9b8f42d edid: parse display range limits descriptor
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-15 17:29:33 +02:00
Simon Ser
58b10d9048 di-edid-decode: compute DTD aspect ratio
Upstream edid-decode computes the aspect ratio for detailed
timing definitions.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-15 11:43:23 +02:00
Simon Ser
13a9287e40 edid: add support for detailed timing definitions
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-14 16:37:57 +02:00
Simon Ser
c14569af01 di-edid-decode: add optional arg to specify input filename
This makes it easier to e.g. run the tool inside gdb, and is
consistent with upstream edid-decode.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 14:12:02 +00:00
Simon Ser
51ad14e5e9 di-edid-decode: fix hang with a 32 KiB file
The first fread call fills our 32 KiB buffer, and then we enter a busy
loop calling fread with zero.

Found via fuzzing with AFL.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 14:19:40 +02:00