Commit graph

75 commits

Author SHA1 Message Date
Sebastian Wick
4a8684d1b0 edid: add support for CVT timing code descriptors
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-04 02:12:22 +01:00
Sebastian Wick
8fbc366c7c cta: parse short audio descriptors
Co-authored-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2022-12-14 15:19:27 +01:00
Simon Ser
4e0fd2c979 di-edid-decode: print DMT reduced blanking flag
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-23 15:30:33 +01:00
Simon Ser
671c8d78d3 di-edid-decode: print full established timings III
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-23 15:30:33 +01:00
Simon Ser
5b81e0b578 di-edid-decode: add special case for 16:10 aspect ratio
The mathematical aspect ratio is 8:5 but people use 16:10.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-23 15:30:33 +01:00
Simon Ser
6b8bdb5b3b ci: upgrade edid-decode
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-23 15:30:28 +01:00
Simon Ser
85d6a3a1db test: fix default path for di-edid-decode
Since a001cab480 ("build: split off di-edid-decode into separate
file"), di-edid-decode is located in a subdirectory.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-23 11:12:24 +01:00
Simon Ser
e19ee5d1bc build: add gen-test-data run target
This makes it easier to re-generate the test diffs. The build system
will properly set DI_EDID_DECODE/DI_EDID_PRINT (and will rebuild
these tools if they are out-of-date).

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-17 22:10:08 +01:00
Pekka Paalanen
ac857e8985 info: use PNP ID database for manufacturer names
The three character PNP ID is a key to manufacturer name database. It
may be desirable to report the manufacturer's real name than just PNP ID
which can be misleading, e.g. MSI refers to Microstep and not MSI GmbH.

This builds the PNP ID database into libdisplay-info to avoid having to
find and parse files at runtime.

tool/gen-search-table.py started as a copy of Wayland 1.21.0's
src/embed.py and took influence from
10945c4ed8/conv.py
However, our script parses the text file shipped in hwdata package in
Debian (and presumably other distributions) rather than the original
CSV.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-11-11 13:09:18 +02:00
Pekka Paalanen
00b446d5db test: make edid-decode-diff.sh easier to run
Having to define just DI_EDID_DECODE was tolerable when REF_EDID_DECODE
does not need setting, but now that there are two built tools, it is
getting inconvenient.

Change the defaults to match the build directory structure and add a new
overridable for the build directory.

Now I only need to set BUILDDIR for this to work. My build dirs are
completely elsewhere, but if someone uses the usual 'meson build'
incantation, the default value for BUILDDIR should be fine.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-11-09 14:18:04 +02:00
Pekka Paalanen
f70fa58441 test: add high-level API test
This new test exercises all existing high-level API to make sure the
output does not change unexpectedly.

Unlike with edid-decode tests, these new print tests do not have an
externally defined groundtruth. They are only to detect changes and
exercise code paths.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-11-09 14:18:04 +02:00
Simon Ser
4af5b96140 di-edid-decode/cta: round VESA transfer characteristics
Fixes the differences with edid-decode.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-20 08:07:22 +00:00
Simon Ser
b7d0793a03 edid-decode/cta: align data block names with edid-decode
We were diverging here.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-20 08:07:22 +00:00
Simon Ser
c930f13457 test: add custom-uncommon-cta-vesa
This is a hand-crafted EDID taken from edid-decode (test/cta-vesa.test).
It contains uncommon blocks: VESA Display Transfer Characteristics Data
Block and VESA Video Display Device Data Block in the CTA-861 extension.

While it's not as good as a real-world EDID, it can still improve our
test coverage and ensure we behave like edid-decode.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-20 08:07:22 +00: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
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
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
b89910ef4e test/data: add goldstar-ite6604-hdmi
It contains established timings III.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-17 09:09: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
29dd7c1e17 test/data: add acer-p1276
We don't have any analog display EDID in our tests. Increase our
test coverage by including one.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-17 09:07:05 +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
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
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
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
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
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
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
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
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
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
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
e047d89f94 cta: add support for enumerating data blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-01 16:41:59 +02:00