Compare commits

..
360 Commits
Author SHA1 Message Date
Simon Ser f1b7531018 info: add support for standalone DisplayID v2 signal colorimetry
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser 1600ae8cc0 info: add support for standalone DisplayID v2 HDR static metadata
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser f73c1e1a35 test: add DisplayID support to di-print
This doesn't print much for now, because nothing is wired up in
info.c yet.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser 555e60951f test: split off di-print generation to separate script
We'll soon add support for standalone DisplayID blobs to the
di-print generation script.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser 14206f324f test: rename edid-decode-diff.sh to edid-decode-gen.sh
This function does more than generate a diff now, it also
generates reference files. Use a more generic name.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser 567d69434a test: rename di-edid-print to di-print
We'll add standalone DisplayID support to this test utility soon.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser 0ad2d2b191 di-edid-decode: add support for standalone DisplayID base section
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser 88ac664c57 info: add di_info_get_{displayid,displayid2}()
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser 22d1124a01 info: introduce di_info_parse_displayid()
Same as di_info_parse_edid(), but for DisplayID blobs.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-27 10:12:35 +00:00
Simon Ser f255306d9f build: bump version to 0.5.0-dev
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-23 18:15:17 +02:00
Simon Ser c67a3e9bed build: bump version to 0.4.0 2026-07-23 18:12:41 +02:00
Simon Ser 772d506015 build: disable most v4l-utils options by default
This speeds up the build when using v4l-utils as a subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-07-04 14:17:39 +02:00
Simon Ser d77a2e5c1a cta: switch error handling to negative error number away from errno
errno handling is error-prone, because it relies on a global
variable. It's easy to forget to set it in error codepaths,
intermediate calls can mutate it, and so on.

Instead, return a negative error number from functions which need
to distinguish between multiple error cases, as is done by many
other C projects.

Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/work_items/53
2026-06-25 11:35:30 +02:00
Leandro Ribeiro 8057b29930 edid: fix potential overflow in shift operation
This issue was caught by CI on the Clang build.

Shifting uint8_t/uint16_t without explicit casting to uint32_t may
cause overflow depending on the implicit promotion rule. Explicitly cast
to uint32_t before shifting to avoid this.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Leandro Ribeiro 99d8394f03 cta: add a few missing return on failures
In parse_video_block() and parse_ycbcr420_block() we log failures when
size is 0, but continue with the function. Instead, let's return a
non-fatal error so that parse_data_block() is able to skip the block.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Leandro Ribeiro c5d86fe91b cta: do not fail when there's a bad Data Block in a CTA extension
Instead of failing when we fail to parse a Data Block in
parse_data_block(), let's simply skip such block. We want to parse as
much as possible, so skipping a whole CTA extension because of a bad
Data Block is not desirable.

The test EDID added (for Lenovo T24s-28) would fail parsing without this
patch.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Leandro Ribeiro d18dd43244 cta: cosmetic changes to _di_cta_data_block_parse()
This removes a local variable and make use of
_di_cta_data_block_destroy() when skipping as well. This makes the next
commit easier to read.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Leandro Ribeiro 824bb14bca cta: document that _di_cta_data_block_destroy() accepts zeroed tag
This function can accept a data block with no tag. When we fail to fully
parse a data block this may happen. This adds a comment to document
this.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Leandro Ribeiro 636f24feda cta: set errno when we don't have a fatal failure
Many functions that parse_data_block() calls can fail with non-fatal
errors.

parse_data_block() needs to differentiate between:

- fatal errors (e.g. memory allocation failure), in which we fail
  parsing the whole CTA extension
- non-fatal errors (e.g. data block is malformed), in which we simply
  skip adding the block
- success, in which we add the block

So let's change the functions that parse_data_block() calls to set errno
to EINVAL or ENOTSUP when they fail with non-fatal errors. In the next
commit we adjust parse_data_block() to handle this properly.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Leandro Ribeiro fd3175264b displayid: make _di_displayid_parse_type_1_7_timing() return void
It always returns true, so there's no need to return a bool.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Qinglong Zhong c8f09c09cc cta: do not fail when HDMI Vendor Specific Data Block has error
We just skip parsing the remaining data when failing to parse
latency and HDMI VICs, don't fail the entire HDMI Vendor Specific
Data Block.

Signed-off-by: Qinglong Zhong <qingloz@amazon.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-06-09 19:45:29 -03:00
Derek Foreman cb5e3edcec vic: avoid out-of-bounds array access
VIC values range from 1 to 219, so _di_cta_vic_video_formats has len 220
(index 0 unused).

If we pass VIC 220 to di_cta_vic_video_format_from_vic(), it tries to
access _di_cta_vic_video_formats[220] (which is out-of-bounds).

This fixes the check to avoid out-of-bounds access.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2026-04-17 10:18:57 -03:00
correctmost baa0e5219c di-edid-decode: Avoid crash when printing unknown DMT code
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/work_items/56
Fixes: 2d98815 ("di-edid-decode: Move some timing printing to a shared file")
Signed-off-by: correctmost <cmlists@sent.com>
2026-04-12 06:39:48 -04:00
Sebastian Wick 70855b14c1 ci: Use gcc's static analyzer functionality in the build-gcc job
This caught a number of issues, so let's make sure we catch those things
before they make it into main.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-01-15 14:51:02 +01:00
Sebastian Wick c61b4b3d76 edid: Release all resources when parsing a display descriptor fails
We only ever free'd the struct di_edid_display_descriptor, but depending
on the type of descriptor and how for we got with parsing it, there
might be more resources hanging off of it that need to be released.

We actually already have a function which takes care of that:
destroy_display_descriptor. We only have to ensure that parsing
functions return a descriptor in a consistent state and the tag is set
correctly.

Fixes: 93b0fd1 ("edid: add support for standard timings descriptor")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-01-06 14:22:29 +01:00
Sebastian Wick 53b10095cf displayid: Handle failed allocations
Forgot that we try to handle allocation failure. Fix it up.

Fixes: e4e0986 ("displayid: Add support for type IV timings")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-01-06 14:22:29 +01:00
Sebastian Wick 84026a79d0 di-edid-decode: Initialize variables to zero to help analyzers
The switch below should be exhaustive and thus always initialize the
variable but apparently gcc is not smart enough to understand that, so
let's just initialize the variables.

Fixes: 4a8684d ("edid: add support for CVT timing code descriptors")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-01-06 14:22:29 +01:00
Sebastian Wick 76f133ae1a cta: Initialize speaker location coordinates to zero
Another field indicates if the coordinates are set, but we should not
leave them uninitialized either way.

Fixes: 75b2167 ("cta: add support for Speaker Location data blocks")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-01-06 14:22:29 +01:00
Simon Ser 73ec53d800 info: search CTA blocks in DisplayID v2 extensions
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:18:02 +01:00
Simon Ser 73ab82d62d info: don't use di_ prefix for static helpers
The di_ prefix is reserved for public API functions.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:18:02 +01:00
Simon Ser 6feabfe386 di-edid-decode: add support for DisplayID v2 CTA-861 data blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:18:02 +01:00
Simon Ser 80caacc0cd di-edid-decode: introduce print_cta_data_block()
This will be re-used by DisplayID v2.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:18:02 +01:00
Simon Ser 7324cca007 displayid2: add support for CTA-861 data blocks
Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:18:02 +01:00
Simon Ser 471350512d cta: expose _di_cta_data_block_{parse,destroy}
These will be re-used for DisplayID v2.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:18:02 +01:00
Simon Ser 34b3635507 cta: make di_cta.flags optional
These flags are not specified for CTA blocks embedded inside
DisplayID v2, for instance.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:18:01 +01:00
Simon Ser d535192adc cta: introduce struct di_cta
In the next commit, CTA parsing functions will be re-used for
DisplayID v2. However, DisplayID v2 doesn't embed a full EDID-style
CTA extension. Instead, it embeds a list of CTA blocks.

Stop passing around a struct di_edid_cta and instead pass a
struct di_cta with minimal state.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-06 14:16:58 +01:00
Sebastian Wick 91c3b83c65 di-edid-decode: Fix printing unknown DMT codes
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/55
Fixes: 2d98815 ("di-edid-decode: Move some timing printing to a shared file")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-01-05 20:50:14 +01:00
Sebastian Wick ccf012eb05 displayid: Fix double free of cta_vics
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/54
Fixes: e4e0986 ("displayid: Add support for type IV timings")
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2026-01-05 20:49:42 +01:00
Simon Ser d828f86afe cta-vic-table: re-generate from CTA-861-I
Same number of VICs as before. A few fixes in timing data because
we missed some footnote markers with the previous script.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-01 20:41:29 +01:00
Simon Ser 5a12f3ac7c tool/gen-cta-vic: update for CTA-861-I
The new standard combines two tables into one, and pdftotext is no
longer able to parse it. Use pdfplumber instead, which should also
be more future-proof.

Signed-off-by: Simon Ser <contact@emersion.fr>
2026-01-01 20:41:29 +01:00
Sebastian Wick e4e0986580 displayid: Add support for type IV timings
We currently have no support for HDMI VIC codes but CTA VIC and DMT
should get printed correctly.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-19 14:22:40 +01:00
Sebastian Wick d3b62b6fa2 displayid: Move checking for reserved header flags to own function
Some blocks actually make use of the flags but we still need to check
for the revision.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-18 14:14:54 +01:00
Sebastian Wick bca559d35e dmt: Wrap the uint8_t DMT code in struct for type safety
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-18 14:14:46 +01:00
Sebastian Wick 2d98815b45 di-edid-decode: Move some timing printing to a shared file
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-18 13:18:27 +01:00
Sebastian Wick 9ff243bd91 vic: Wrap the uint8_t HDMI and CTA vic codes in structs for type safety
It's easy to miss which VIC definition is being used. In fact, we lacked
documentation about this at some places and this commit fixes that as
well.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-16 19:59:33 +01:00
Sebastian Wick e5c6fc1112 timing: Add reverse lookup from timing definitions to codes
Compositors might want to use the EDID/DisplayID information to figure
out the capabilities of a mode they want to drive. The mode definition
is a timing definition and not a VIC, but some of the information in the
EDID/DisplayID about a mode is tied to the VIC. (Same for DMT)

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-16 19:43:55 +01:00
Sebastian Wick 0af6d1d69b edid: Return DMT codes for Established timings III
The DMT code is really what is encoded in the data, and as we do not
know if the caller actually needs the code or the timing data that can
be looked up from it, we should return the code and let the caller do
the lookup if wanted.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-16 19:39:09 +01:00
Sebastian Wick 0fd2b6b674 edid: Split out more DMT timing
Same rationale as the previous commit.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-16 19:36:42 +01:00
Sebastian Wick 78990410b7 cta: Split out HDMI and CTA VIC lookup
The VICs are not tied to the CTA, EDID or DisplayID, but are really just
a mapping between a code and a timing definition.

Given that they are being used in different specs and blocks, it makes
sense to have the VIC definitions and lookups separate and reference
them where needed.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-12-16 19:36:13 +01:00
Simon Ser 788c056e24 displayid2: decode data blocks structure
Parse data blocks length and tags, expose these in the public API.

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-10-09 16:42:00 +02:00
Simon Ser 0dee020f5f test: add asus-ux3405
This EDID contains various DisplayID v2 data blocks.

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-10-09 14:59:20 +02:00
Simon Ser 55b45d4d0d displayid: drop logger_add_failure()
d0c43cb795 ("edid: do not fail when extension block has invalid
checksum") has introduced _di_logger_add_failure(), which does the
same as logger_add_failure().

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-10-09 14:59:20 +02:00
Bernd Kuhls 84e8da3de9 cta: include sys/types.h
Fixes build error with uClibc-based toolchain and gcc 15.2.0 found by
Buildroot autobuilders[1]:

../cta.c: In function 'parse_vendor_hdmi_block':
../cta.c:168:15: error: unknown type name 'ssize_t'; did you mean 'size_t'?

[1] https://autobuild.buildroot.org/results/2d72feabdd0c9e1c9aa89e6d683d5f5ae0bb942d/

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
2025-10-09 12:55:21 +00:00
Simon Ser 4daae7dbff ci: disable require-allow-collaboration check
The GitLab API now returns an HTTP 403 error when checking for this.
As a result, CI is always failing for external contributors.

Since it's enabled by default, let's just drop the check.

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-10-09 14:53:22 +02:00
Simon Ser 69d12ffb8b build: bump version to 0.4.0-dev
Signed-off-by: Simon Ser <contact@emersion.fr>
2025-08-12 17:16:58 +02:00
Simon Ser 47a5590e9c build: bump version to 0.3.0
Signed-off-by: Simon Ser <contact@emersion.fr>
2025-08-12 16:57:36 +02:00
Qinglong ZhongandLeandro Ribeiro b34928b427 cta: decode HDMI Forum Sink Capability Data Block (HF-SCDB)
This data block content is decoded exactly like HDMI Forum Vendor
Specific Data Block (HF-VSDB).

Co-authored-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Qinglong Zhong <qingloz@amazon.com>
2025-08-07 16:07:18 -03:00
Leandro Ribeiro 88bf839952 cta: add struct di_cta_vendor_hdmi_scds
No behavior change. This is just preparation for the next commit.

Both HDMI Forum Vendor-Specific Data Block (HF-VSDB) and HDMI Forum Sink
Capability Data Block (HF-SCDB) are composed of a HDMI Sink Capability
Data Structure (SCDS). For now we only support HF-VSDB, but in the next
commit we add support for HF-SCDB.

This moves the fields representing a SCDS from struct
di_cta_vendor_hdmi_forum_block to a new struct di_cta_vendor_hdmi_scds.
It also renames a few structs encapsulated by the new SCDS.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-08-07 15:24:06 -03:00
Leandro Ribeiro 08d23e33ee test: add EDID for Vizio D40f-J09
This is important because it contains a HDMI Forum Sink Capability Data
Block (HF-SCDB), and the support for that is introduced in the following
commits.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-08-07 15:23:17 -03:00
Sebastian Wick fbf39ea327 cta: Fix stray comparision in HDMI Forum Block parsing
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-08-07 19:31:20 +02:00
b83911d130 cta: add support for HDMI Forum vendor-specific data block
Co-authored-by: Arnaud Vrac <avrac@freebox.fr>
Co-authored-by: Sebastian Wick <sebastian.wick@redhat.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
2025-08-06 22:59:01 +02:00
Simon Ser 9d5b5d369d test/data: add jdi-lpm135m467-edp
This EDID contains an embedded DisplayID 2 extension.

It originates from:
https://gitlab.freedesktop.org/drm/intel/-/issues/2711

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-07-24 13:48:16 +02:00
Simon Ser 79625ac6a6 displayid2: add basic support
Only decode the revision and primary product use-case.

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-07-24 13:48:16 +02:00
Leandro Ribeiro 99e1992a7c cta: also check second DTD byte before skipping
First byte being zeroed is valid, according to the spec. Only if the
first two first bytes are zeroed we should skip parsing the DTD.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-22 14:43:13 +00:00
Leandro Ribeiro f506082d76 cta: try to adjust last Data Block size and parse it
We have multiple Data Blocks followed by Detailed Time Definitions
(DTD). Currently if we encounter a block whose reported size overlaps
DTD, we stop parsing the blocks. Instead, let's assume that this is the
last Data Block and adjust its size to parse it, taking into account the
byte in which DTD starts.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-22 14:43:13 +00:00
Leandro Ribeiro 21afe82802 test: sort EDID by their names
To keep the lists more organized and make it easier when adding new
EDID.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-18 17:28:21 -03:00
Leandro Ribeiro 20169e77ac test: add Amazon Fire TV EDID
This EDID is feature-rich and contains a VSDB that is not present on
other EDID's that we have on the test suite: VSDB UHD Alliance, (OUI
1A-BB-FB).

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-18 17:19:53 -03:00
Qinglong ZhongandLeandro Ribeiro 1a2b4b37aa cta: Add support for HDMI Vendor Specific Data Block
This is not the Forum Vendor Specific Data Block. This is for HDMI 1.x.

Co-authored-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Qinglong Zhong <qingloz@amazon.com>
2025-07-09 21:34:20 -03:00
Leandro Ribeiro c21829b04c di-edid-decode: add util.c
Helper to add functions shared between di-edid-decode files. First one
added is compute_aspect_ratio(), which was part of edid.c, and next
should be used by cta.c as well.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-09 21:04:19 -03:00
Leandro Ribeiro d0c43cb795 edid: do not fail when extension block has invalid checksum
Unfortunately having an invalid checksum is a common issue in several
EDID extensions. Instead of failing to parsing when a bad checksum is
found, simply report the error.

This also fixes an error in which the checksum failure was being printed
in the base block.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-07-03 23:05:57 -03:00
Leandro Ribeiro e14d7b59cd test: add Goldstar 37LG5000 EDID
It contains an extension block with invalid checksum. This is important
for the next commit, in which we start accepting that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-06-27 17:13:49 -03:00
Leandro Ribeiro 7f242f14a1 cta: do not mess with the YCbCr 4:2:0 cap map
Currently when we find an invalid SVD (bad EDID) in a video block, we
simply avoid adding it to the SVD list. Also, the map between SVD's and
the YCbCr 4:2:0 caps is based on the indices of the SVD's. Combine that
and we have a problem: we mess with the mapping.

This adds a new field "index" to struct di_cta_svd, and we use that to
properly use the mapping from SVD to YCbCr 4:2:0 cap.

Note that this is not a permanent fix that would handle all misformed
EDID's. For instance, this fails if the last VIC in the block is not
valid, or if a video block is skipped. That would require more complex
solutions, but the decision was to not introduce complexity because of
malformed EDID's.

Reported-by: Qinglong Zhong <qingloz@amazon.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-06-24 16:42:01 -03:00
Leandro Ribeiro f3140deb0f test: add Lenovo T27p-10 EDID
This is important for next commit.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-06-24 16:40:36 -03:00
Sebastian Wick 171afae87d cta: Add support for the Dolby Vision Vendor Specific Video Block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2025-06-21 10:05:02 +02:00
Qinglong ZhongandLeandro Ribeiro b6013c0469 cta: Add support for the HDR10+ Vendor Specific Video Block
Co-authored-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Signed-off-by: Qinglong Zhong <qingloz@amazon.com>
2025-06-17 11:37:25 -03:00
Leandro Ribeiro d9a0b20143 test: add Samsung Odyssey G60SD EDID
It contains HDR10+ VSDB with valid peak luminance index, so it's useful
to test next commit.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2025-06-17 11:34:44 -03:00
Sebastian Wick 0cfed4cfbe cta: Add support for Vendor Specific Video Blocks
This will be used for Dolby Video in the next commit.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
Signed-off-by: Simon Ser <contact@emersion.fr>
2025-06-09 10:47:47 +02:00
Simon Ser e8dc08055b build: update edid-decode to new repository
edid-decode has moved to v4l-utils [1]. Ensure that we will be
able to easily upgrade as needed in the future by switching to the
new upstream.

[1]: https://git.linuxtv.org/edid-decode.git/commit/?id=cd4bba870bee3775d2bc811d1089fb3206437176

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-06-09 08:30:19 +00:00
Simon Ser 5ea3693833 edid: make EDID extension block checksum errors non-fatal
Some EDIDs might have a valid base block and an invalid extension
block. Skip the extension block in that case instead of failing the
whole EDID.

Signed-off-by: Simon Ser <contact@emersion.fr>
2025-01-05 14:24:33 +01:00
Sebastian Wick 211fa636a3 cta: Return a block struct for type vii timings
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick 9534dea0df cta: Return a block struct for video format preferences
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick 9ed2eeedee cta: Fix name of InfoFrame private base
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick d013195750 cta: Return a block struct for speaker locations
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick a274fed156 cta: Rename room_configuration struct
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick 84b48d58dc cta: Move detailed timing definitions over the CTA blocks
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick 9814d7dd96 cta: Rename ycbcr420_cap_map struct
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick a08ac0af14 cta: Rename transfer characteristics struct
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick f48bd08f26 cta: Return block structs instead of SVDs directly
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick e4c750fab0 cta: Rename dynamic metadata types
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick bf86fa80c7 cta: Rename static metadata types
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick 6689ef604e cta: Rename dddb to display_device_block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick db6f0a86ce cta: Return a block struct for audio blocks
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-08-06 12:41:17 +00:00
Sebastian Wick 8d04de834a gtf: Initialize variables which might not get initialized
If the gtf options contain a bad enum di_gtf_ip_param, some variables do
not get initialized to any value but will later be read.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-07-29 14:37:23 +02:00
Sebastian Wick 9cc806c512 readme: List the relevant specifications and where to get them
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-07-02 18:11:55 +02:00
Simon Ser 82f520583d build: bump version to 0.3.0-dev
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-06-20 18:40:01 +02:00
Simon Ser 66b802d05b build: bump version to 0.2.0
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-06-20 18:36:17 +02:00
Pekka Paalanen 12341a70b8 test: di_info_get_default_gamma()
Notifies us if the result ever changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:26:33 +03:00
Pekka Paalanen 5d2af9a882 info: add di_info_get_default_gamma()
Wayland compositors may be interested in this.

DI-EXT is ignored, because libdisplay-info does not parse it yet.

EDID Color Point Descriptors are ignored, because they have not been
found in shipped products.

https://github.com/linuxhw/EDID.git database contains 373 samples for
which edid-decode complains:
  Basic Display Parameters & Features: sRGB is signaled, but the gamma != 2.2.

Therefore I assume that the sRGB flag is more correct when set.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:26:33 +03:00
Pekka Paalanen 0de6fd5f10 test: di_info_get_supported_signal_colorimetry()
Notifies us if the result ever changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:26:33 +03:00
Pekka Paalanen af7d091dc9 info: add di_info_get_supported_signal_colorimetry()
Add a high-level function to get the supported additional signal
colorimetries. This is only an interesting sub-set of the CTA-861-H
defined colorimetries, for driving WCG and HDR displays.

Wayland compositors will be interested in this.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:26:33 +03:00
Pekka Paalanen 6bc398e6db test: di_info_get_hdr_static_metadata()
Makes sure the results won't change unnoticed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:26:33 +03:00
Pekka Paalanen f2c1b01bd2 info: add di_info_get_hdr_static_metadata()
The low-level struct di_cta_hdr_static_metadata_block is essentially
duplicated in struct di_hdr_static_metadata to make the high-level API
independent of low-level API headers. It's also simpler in form, while
new fields can still be added in the end while maintaining ABI backward
compatibility.

If new sources for HDR static metadata appear, they can be parsed into
this same structure in the future when compatible.

Wayland compositors will be interested in this.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:26:33 +03:00
Pekka Paalanen ef69f6276c test: di_info_get_default_color_primaries()
Notifies us if the result ever changes.

The 3 decimal precision is taken from E-EDID 1.4 spec which says that
the numbers have that precision.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:26:33 +03:00
Pekka Paalanen 85043a07d5 info: add di_info_get_default_color_primaries()
Add a high-level function to retrieve color primaries. Wayland
compositors will be interested in this.

A high-level function may later be extended to support stand-alone
DisplayID and other sources.

The high-level data is derived from low-level API calls in
di_info_parse_edid(). As we stash the results in struct di_info to avoid
requiring the callers to explicitly free the high-level structures, this
allows keeping struct di_info deeply const in high-level API
implementation. We also avoid some dynamic allocations.

https://github.com/linuxhw/EDID.git database contains 20399 samples for
which edid-decode complains:
  Basic Display Parameters & Features: sRGB is signaled, but the chromaticities do not match.

Therefore I assume that the sRGB flag is more correct when set.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-12 16:25:44 +03:00
Pekka Paalanen 7b4d87b2d2 info: drop unused includes
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-06-11 15:33:38 +03:00
Sebastian Wick fbd0022272 build: build edid-decode as subproject
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-06-07 17:05:47 +02:00
Sebastian Wick c0c0c8acc5 cta: HDMI Audio: Add a failure when NonMixed is supported without MS
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-06-06 10:58:48 +02:00
Sebastian Wick 08a4d543c8 cta: Add support for the HDMI Audio Data Block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-05-29 11:29:37 +02:00
Sebastian Wick 5741163901 edid: Record failures instead of aborting parsing
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-05-08 12:43:20 +02:00
Simon Ser f48cc61166 edid: ignore malformed CTA extension blocks
Same as previous commit, but for CTA instead of DisplayID.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-05-08 09:10:58 +02:00
Simon Ser 204576ecff edid: ignore unsupported/malformed DisplayID extension blocks
Some EDIDs have DisplayID 2 extension blocks which we don't support
at the moment. Skip the extension block in that case. While at it,
also skip malformed DisplayID blocks.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/42
2024-04-29 11:12:44 +02:00
Simon Ser 7067ab6ad1 displayid: add support for type III timings
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-03-21 17:15:27 +01:00
Simon Ser 245207e5ef displayid: extract timing_aspect_ratio_is_valid()
This will be used by the type III timing parsing logic in the next
commit.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-03-21 17:12:08 +01:00
Simon Ser 179f481c8f displayid: rename enum di_displayid_type_i_ii_vii_timing_aspect_ratio
This is also used by type III timings, and there is no other
competing aspect ratio enum in the DisplayID standard.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-03-21 17:09:18 +01:00
Sebastian Wick 8f4b0f768f edid: Change error messages and di-edid-decode printing
Following the changes in edid-decode.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-21 15:47:34 +01:00
Sebastian Wick dda7c12642 test: Bump edid-decode to newer version
It has updated the calculation of the PQ level for Dolby Video.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-21 15:44:53 +01:00
Sebastian Wick 2d48bf1d54 di-edid-decode/displayid: Print Type II Detailed Timings
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-20 14:00:59 +01:00
Sebastian Wick 4f1a7ca5a0 displayid: Add support for Type II Detailed Timing Data Block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-20 14:00:59 +01:00
Sebastian Wick bedd81f1b6 displayid: Handle Type II timings in di_displayid_type_i_ii_vii_timing
Type II timings are exactly the same as Type I except more tightly
packed and no information on the aspect ratio. As such, they fit neatly
into the Type I and Type VII structure.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-19 18:02:47 +01:00
Sebastian Wick 0eb10bda9e cta: Parse DisplayID Type VII Video Timing Data Block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-19 17:13:30 +01:00
Sebastian Wick f36771f732 di-edid-decode/displayid: Make print_displayid_type_i_vii_timing generic
Instead of hardcoding the type of timing to DTD let the caller decide.
Also lets the caller set the level of indentation.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-19 17:11:50 +01:00
Sebastian Wick f96aa28c9b displayid: Make parsing type I & VII timings available for CTA
The CTA block contains a single type VII descriptor.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-19 17:11:47 +01:00
Sebastian Wick adc25656c2 displayid: Use a single struct for Type I and Type VII timings
They only have a different resolution for the pixel clock which we can
represent by just using a type in the struct which fits the higher
resolution.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-19 16:52:28 +01:00
Simon Ser 8d221c1d3d di-edid-decode: don't print manufacture week if unspecified
Fixes philips-ftv-2017.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-02-15 14:12:18 +01:00
Sebastian Wick 1388f16e71 cta: add support for Video Format Preference
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-02-15 11:02:47 +01:00
Sebastian Wick 75b21671d0 cta: add support for Speaker Location data blocks
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-02-14 20:56:17 +01:00
Sebastian Wick 3edb81e68d cta: add support for Room Configuration data blocks
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-02-14 20:56:17 +01:00
Sebastian Wick 63b483cd46 cta: Pull out speaker allocation struct
The speaker allocation format is reused in multiple CTA data blocks.
This commit pulls it into its own struct so it can be embedded into
other data block structs.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-02-14 17:27:28 +01:00
Christian Meissl ebee35935d di-edid-decode: fix rgb quantization output
the output accidentally used the ycc range for
testing support of rgb quantization

Signed-off-by: Christian Meissl <meissl.christian@gmail.com>
2023-12-03 16:23:10 +01:00
Simon Ser ae6cb5242e ci: upgrade to Alpine 3.18
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-11-05 11:31:18 +01:00
Simon Ser 0e1235a908 ci: halt on UBSan error
By default, UBSan prints the error to stderr and does nothing else.
Halt the program so that CI fails and we notice the mistake.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-11-05 10:12:47 +00:00
Simon Ser 8aa57fbed9 edid: turn range limits max pixel clock into an int64_t
An int32_t is not large enough:
MAX_UINT8 * 10 * 1000 * 1000 > MAX_INT32.

We already use int64_t for di_cta_video_format.pixel_clock.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/38
2023-11-05 10:12:47 +00:00
Simon Ser 924f59f6dc test: add QEMU EDID
Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/38
2023-11-05 10:12:47 +00:00
Simon Ser 303484081d test: add ayaneo-wxga
Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/36
2023-10-31 12:43:55 +01:00
Sebastian Wick 5142866ee7 cta: be more lenient about data block parsing
If the data block sizes start overlapping the DTD we cannot continue
parsing this or further data blocks but the ones we parsed already
should be valid.

Similarily if we fail parsing a specific data block the previous ones
should still be valid and the next ones might be as well.

Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/36
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/37
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-10-31 12:43:37 +01:00
Jani Nikula 8829bab67a tool: fix redirect bashism in dump-i2c.sh
In POSIX sh, &> is undefined, and will lead to confusing errors on
e.g. dash.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2023-06-28 12:12:04 +03:00
Simon Ser 41027f9cc6 ci: use detached CI pipelines
See [1], required to allow contributors to trigger CI pipelines
for MRs. Example failure can be found at [2].

[1]: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/540#what-it-means-for-me-a-maintainer-of-a-project-part-of-gitlabfreedesktoporg
[2]: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/jobs/44443608

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-06-26 16:23:15 +02:00
Simon Ser 49af17a3e6 editorconfig: bump max line length to 100 chars
Increase the maximum line length to 100 characters, following the
kernel policy change [1]. It's still a good idea to split long
lines, but not if that degrades readability and is only a few
characters over the limit.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-05-11 08:58:10 +00:00
Sebastian Wick 8781d1d7a9 tool: add a tool for dumping EDID/DisplayID from I2C
Dumps the content of every I2C address which might contain an EDID or
DisplayID blob for every connector which has an I2C bus.

This can be useful to discover DisplayID blobs which are not nested
inside an EDID blob.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-05-08 19:49:45 +00:00
Bernd Kuhls 5c9801a75f displayid.c: Include sys/types.h
Fixes build error
../displayid.c:377:10: error: ‘ssize_t’ undeclared (first use in this function); did you mean ‘size_t’?

seen with:
arc-linux-gcc.br_real (Buildroot 2021.11-4428-g6b6741b) 10.2.0

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2023-05-07 14:23:26 +02:00
Simon Ser 598bde5846 edid: fix missing color point descriptor cleanup
This wasn't caught by ASan in CI because we don't have a blob with
color point descriptors.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-04-14 13:00:50 +02:00
Consolatis 480f72510a displayid.c: prevent int promotion warning
Fixes following warning

```
../displayid.c: In function ‘parse_tiled_topo_block’:
../displayid.c:298:29: error: conversion from ‘int’ to ‘uint16_t’ {aka ‘short unsigned int’} may change value [-Werror=conversion]
  298 |  tiled_topo->product_code = data[0x13] | (uint16_t)(data[0x14] << 8);
      |                             ^~~~
```

Signed-off-by: Consolatis <40171-Consolatis@users.noreply.gitlab.freedesktop.org>
2023-03-26 10:26:53 +02:00
Simon Ser 147d6611a6 readme: update test suite instructions
Since eed3e1e0f8 ("test: remove edid-decode as a test
dependency"), edid-decode is no longer required to run the test
suite. It's only required to re-generate the test data.

Expand a bit on how to setup edid-decode to re-generate the test
data.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-03-02 19:43:44 +01:00
Simon Ser 83ae3f5515 ci: remove unnecessary "Testing checks" stage
Merge the stage into "Build and test". The next stages don't depend
on this stage, so we can parallelize, no need to block the next
stages because of the testing-check step.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-27 11:56:27 +00:00
Simon Ser af7af6090a info: ignore empty model/serial descriptors
Some EDIDs (e.g. goldstar-e2441) contain string descriptors for
model/serial which happen to be empty. Skip them.

Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3599
2023-02-27 10:32:12 +01:00
Simon Ser 5e7bb09937 test/data: add goldstar-e2441
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-27 10:31:58 +01:00
Sebastian Wick eed3e1e0f8 test: remove edid-decode as a test dependency
by storing the reference edid-decode output in the repository. It is now
only a dependency for the gen-test-data target. The CI checks that the
reference output in the repository matches the one generated from a
specific checkout of edid-decode.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-02-23 20:50:13 +01:00
Sebastian Wick 0ec8330345 ci: adjust testing check script to 'set -e'
With 'set -e' any failing command will terminate the script but we want
to print a message before exiting. Checking the exit code of a previous
failing command does not work. Print the message in the same command
instead.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-02-23 20:48:56 +01:00
Sebastian Wick 8ec4aa2c84 ci: create new stage for checking the testing data
We will add more checks in the next commit which require an image which
can run meson and ninja.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-02-22 22:23:03 +01:00
Simon Ser 5a4a28e226 readme: add IRC channel
The #wayland channel seems like the most popular choice.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/34
2023-02-15 11:20:36 +00:00
Simon Ser 29271352cf build: fix invalid library version
Fixes the following error:

    meson.build:52:0: ERROR: Invalid Shared library version "0.2.0-dev". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-15 10:33:08 +01:00
Simon Ser a9528b0c26 build: bump version to 0.2.0-dev
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-15 10:27:41 +01:00
Simon Ser 92b031749c build: bump version to 0.1.1
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-15 10:11:30 +01:00
Simon Ser 015bddc1a6 build: set pkg-config name and URL
For informational purposes.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-13 19:53:00 +01:00
Simon Ser d0ad02c640 build: fix pkg-config filebase
We want users to find the library with "libdisplay-info", not
"display-info".

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-13 19:50:14 +01:00
Simon Ser 1871aabb25 build: bump version to 0.1.0
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-13 17:18:58 +01:00
Sebastian Wick 10bece89b2 release: Add release instructions and script
Stolen from wayland and weston. Adjusted slightly to fit our needs.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-02-10 17:06:13 +01:00
Sebastian Wick c88cd24e97 build: Set the library version and SOVERSION
We use semantic versioning but will still have ABI breaks in the 0.x.x
series so we will just bump the SONAME every new minor release.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-02-10 15:46:56 +01:00
Sebastian Wick 506925a66b cta: add support for InfoFrame Data Block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-31 14:58:50 +01:00
Sebastian Wick 23be3830c0 test: Bump edid-decode to newer version
The InfoFrame printing has changed and is compared against in the next
commit.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-31 14:50:49 +01:00
Sebastian Wick d299c4716a edid: Sync On Green Signal only is set if the bit is 0 and not 1
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-30 17:10:40 +01:00
Sebastian Wick 4698004913 cta: Add new data blocks from CTA-861.6
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-30 16:53:47 +01:00
Sebastian Wick ddb32dafdb cdi-edid-decode/cta: Take interlacing into account when printing VICs
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-30 15:04:06 +01:00
Sebastian Wick 883f469577 test: Document where each EDID blob is from
Also make sure we don't add new blobs without documenting the source
with a check in the CI.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-20 18:25:55 +01:00
Simon Ser 0154eaa29c readme: document versioning and stability expectations
References: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/13
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-17 11:48:41 +01:00
Simon Ser 6cdebd2046 readme: move URL to references list
Makes the plain-text more readable.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-17 11:41:33 +01:00
Sebastian Wick 05f9450913 di-edid-decode/cta: align VIC aspect ratio names
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-13 18:57:38 +01:00
Simon Ser 94f4cd406c readme: fix executable path in fuzzing instructions
di-edid-decode was split into multiple files, so the binary
location has changed.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-13 14:22:31 +01:00
Simon Ser 1f3913f76d di-edid-decode/cta: print detailed info for VICs
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-13 02:37:01 +01:00
Simon Ser b439985324 cta: add VIC table
Add a small Python tool to extract VIC information from the spec.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-13 02:37:01 +01:00
Sebastian Wick 5c2255047b cta: add support for YCbCr 4:2:0 Capability Map
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-11 22:02:20 +00:00
Sebastian Wick f7bd527557 cta: add support for YCbCr 4:2:0 Video
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-11 21:21:27 +01:00
Simon Ser 2ebc104594 cta: add support for speaker allocation data block
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-11 21:04:48 +01:00
Sebastian Wick a55e759f7c cta: parse HDR Dynamic Metadata Data Block
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-11 19:11:37 +00:00
Sebastian Wick 6c8d466c03 ci: always build documentation
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-10 15:44:52 +01:00
Sebastian Wick c32df33fe7 cta: include stddef.h for size_t
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-01-10 15:12:09 +01:00
Simon Ser 67b5d67a64 cta: add support for VESA DDDB
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-10 12:23:38 +00:00
Simon Ser fc13fb4d53 displayid: add support for tiled display topology data block
Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-09 22:49:01 +00:00
Simon Ser 3b83980dde Add code coverage configuration file
Exclude build/ from code coverage, otherwise build/pnp-id-table.c
is included in the stats. Also add subprojects/ which is added by
default by Meson unless there is a custom config file.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-01-07 13:47:28 +01:00
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
Simon Ser f7160730cc Introduce di_cvt_compute()
Same as di_gtf_compute(), but for CVT.

Code imported from edid-decode, fixed up [1] [2], edited for
code style and extended to return all output parameters.

Will help with CVT timing code descriptors in EDID [3].

[1]: https://lore.kernel.org/linux-media/20221005121221.14882-1-contact@emersion.fr/T/#u
[2]: https://lore.kernel.org/linux-media/20221028142405.81894-1-contact@emersion.fr/T/#u
[3]: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/merge_requests/93

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-12-16 15:37:38 +01:00
Sebastian WickandSimon Ser 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
Joshua Ashton c995305a69 info: Use memory_stream_cleanup in di_info_get_serial
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-11-25 12:15:14 +00:00
Joshua Ashton 12923cc3bc info: Use memory-stream API for di_info_parse_edid
Avoids a bunch of duplicated code here.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-11-25 12:15:14 +00:00
Joshua Ashton c63ca40ef7 memory-stream: Add memory_stream_cleanup helper
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-11-25 12:15:14 +00:00
Joshua Ashton a10c478558 memory-stream: Factor out memory-stream related code to a new file
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-11-25 12:15:14 +00:00
Simon Ser b21fdb3a0d ci: pin Alpine version
This prevents the Alpine image from being upgraded to a new major
version when re-generated. ci-templates defaults FDO_BASE_IMAGE to
alpine:latest.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-24 10:27:13 +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 7d5003c5ac dmt: add reduced_blanking field
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 7289c6ea59 ci: upgrade to Alpine 3.17
This gives us the hwdata package.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-23 14:23:59 +00: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 a001cab480 build: split off di-edid-decode into separate file
Avoids repeating the directory name.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-21 15:41:07 +01:00
Simon Ser 448046519e build: override dependency for subproject usage
Makes it easier to use libdisplay-info as a Meson subproject.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-11-21 14:10:21 +00: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
https://github.com/golightlyb/PNP-ID/blob/10945c4ed8fcb86cccdb0913a18777ab0dc84c57/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 3c675db02f ci: install hwdata
This is needed for the following patch to find pnp.ids.

This is not available in the Alpine release we are using right now.

That --disable-blacklist works around the error:
install: unrecognized option: T
BusyBox v1.35.0 (2022-08-01 15:14:44 UTC) multi-call binary.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-11-09 14:18:24 +02:00
Pekka Paalanen 89f8eecc11 editorconfig: add python rules
This seems to be what the existing python file uses, and trying to write
python when your editor is constantly resetting its settings according
to the previous "incorrect" editorconfig was infuriating.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-11-09 14:18:24 +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
Pekka Paalanen b3231b85dd info: add getters for make, model and serial
The functionality of these new high-level functions as implemented here
follows what Weston 11.0's ad hoc EDID parser extracted. There are
differences to Weston though:
- get_model() falls back to the numeric model field
- unusual characters are escaped as hex rather than replaced with dash

The documentation of the new functions allows to change the behavior of
get_model and get_make to e.g. convert PNP ID to a company name. The
notes about UTF-8 allow us to make use of UTF-8 fields if such appear
useful in the future.

Weston's ad hoc parser shall be replaced with this. After another API
addition, the high-level API semantics will match what Weston expects.

The memory_stream stuff is for convenience and will see more complex
use in the future.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-11-09 14:14:27 +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 add5d0bd76 info: drop di_info_get_product_name()
This was used as an example of what a high-level API function would
look like, but is too opinionated to be useful across many
compositors.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-15 19:01:08 +02:00
Pekka Paalanen cda99a0913 readme: add Using section
I believe this is what we intended, and it is what I want.

It could lead to duplicating low-level API in high-level API at first,
but once we start seeing DisplayID in the wild, the high-level functions
need to start looking into both EDID and DisplayID APIs to deliver the
desired information.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-10-14 13:26:40 +03:00
Pekka Paalanen 6d7ce6dbd8 readme: mention edid-decode version
I was scratching my head for a good while, why does the test suite fail
straight out of upstream on one EDID file. Turns out I was using a
different version of edid-decode than CI, which caused the recorded diff
patch to fail to apply. I was missing

41507c0b5f "ci: update edid-decode"

Make an explicit note about this dependency.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-10-14 13:26:37 +03:00
Pekka Paalanen 50ce9c73f5 Get size_t definition for info.h
VScode told me that this header wasn't self-contained. Fix it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-10-14 13:26:30 +03:00
Pekka Paalanen 56be915e27 edid: fix uint16_t conversion warning
../../git/weston/subprojects/display-info/edid.c: In function ‘decode_chromaticity_coord’:
../../git/weston/subprojects/display-info/edid.c:250:8: warning: conversion from ‘int’ to ‘uint16_t’ {aka ‘short unsigned int’} may change value [-Wconversion]
  250 |  raw = (uint16_t) (hi << 2) | lo;
      |        ^

Apparently the cast applies to (hi << 2), then bitwise-or implicitly
promotes to signed int, and that gets assigned to uint16_t raw. At least
gcc 10.2.1 from Debian seems to think so.

Fix it by forcing the cast on the complete result.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-10-13 13:03:16 +03:00
Simon Ser 619fc30c7b ci: update edid-decode
Contains a fix for DsiplayID tiled display topology and for CVT
RBv3.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-11 11:48:29 +00:00
Simon Ser 41d3278807 readme: link to latest code coverage report
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-07 07:20:18 +02:00
Simon Ser 97a8f16d1f di-edid-decode: split into multiple files
di-edid-decode.c is getting bit and messy.

Use one file per spec.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-07 05:05:27 +00:00
Simon Ser f2d6819f04 displayid: add missing includes in public header
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-07 05:05:27 +00:00
Simon Ser 2ec42b3bd2 readme: add link to website
The website hosts the documentation.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-05 10:47:44 +00:00
Simon Ser ec2521e4e0 Generate HTML documentation
Leverages gyosu [1] to generate HTML documentation from the header
files.

[1]: https://sr.ht/~emersion/gyosu/

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-10-04 16:21:46 +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
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
Sebastian Wick 78b4f0eb68 edid: use the correct definition for maximum standard timings
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2022-09-28 02:44:35 +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 3b8816ba3f displayid: add logging helpers
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-27 07:56:09 +00:00
Simon Ser 186e78c128 displayid: validate checksum
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 106947ac1f displayid: parse section size
The section size might be smaller than the provided buffer size,
because the buffer might have padding at the end.

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 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 ad4c9b467c dmt: add public header
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-17 06:53:39 +00:00
Simon Ser 4ead11c64b dmt: add more timing info
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 a382b96645 cta: add missing <stdint.h> include in public header
cta.h:246 uses uint8_t but we never include <stdint.h>.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-14 12:03:36 +00:00
Simon Ser 6f7dc0bcf7 Add safety assertions when inserting into array
Make sure we didn't mess up the array size. Abort instead of
corrupting memory.

Found the array insert operations via:

    git grep '++]'

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-12 06:21:12 +00:00
Simon Ser fbec9839fa cta: add EDID_CTA_MAX_DATA_BLOCKS
Use a constant for the max number of data blocks, with a comment
explaining the reasoning.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-12 06:21:12 +00:00
Simon Ser 2fc4aedee7 ci: simplify ci-templates include
Turns out we can include multiple files with an array instead of
repeating ourselves.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-08 12:19:50 +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
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 0cc784971b dmt: introduce generated table for DMT data
The Display Monitor Timing specification is a PDF with data tables.
A small Python script can be used to extract its contents in a
machine-readable form.

For now only extract a few fields. This can be extended later.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-08-01 14:35:33 +00:00
Simon Ser 676984a737 edid: report parsing errors with new helpers
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-07-27 17:15:00 +02:00
Simon Ser a1f97e89fe Add failure message reporting functions
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-29 12:25:48 +02: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 3d0f36c528 test/data: add samsung-s27a950d-dp
This EDID contains DTDs with the stereo flag set, and audio blocks
in the CTA extension.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-17 11:17:48 +02:00
Simon Ser 119a95844d edid: switch to sized integers for DTD
This makes it clearer what the range of the value can be: we no
longer need to deal with 16-bit integers.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-17 10:12:10 +02:00
Simon Ser 9da7803e4a edid: ignore aspect ratio stored in DTD mm size
The spec allows manufacturers to store the aspect ratio in these
fields. Instead of exposing bogus values to the user, mark the
size in mm as undefined.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-17 10:12:10 +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 4a4ee90888 ci: disable parallel jobs for coverage reports
Running in parallel results in spurious failures:
https://gitlab.freedesktop.org/emersion/libdisplay-info/-/jobs/24101687

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-16 11:12:06 +00:00
Simon Ser 999a4d4c57 ci: build with both GCC and Clang
These two compilers may have different warnings. Make sure we
don't miss any.

The Clang build also supports ASan + UBSan.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-16 11:12:06 +00: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 ffb81c9bef ci: mention how to force a container rebuild when pushing
This should remove the risk to merge a patch with the
FDO_FORCE_REBUILD line uncommented. Mentionning the command in the
manifest makes it easier to remember.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-14 12:03:10 +00:00
Simon Ser a4d2bbf95f build: set symbol visibility
A simple version script is used because it allows us to consistently
expose all symbols starting with "di_", removing the risk to forget
to mark a symbol as public.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-14 11:40:07 +00:00
Simon Ser c383417629 edid: prefix private functions with "_di_"
The extra underscore indicates that it's not a function which is
part of our public API. This will allow the next commit to setup the
linker to export functions based on their name.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-14 11:40:07 +00:00
Simon Ser c7a2edb74c edid: re-order display descriptor declarations in public header
These appear after the basic display parameters and features in
the EDID structure, so it makes sense to put them below in the
header.

I got confused while during a rebase.

While at it, move the declaration for struct di_edid_display_descriptor
before the one for di_edid_get_display_descriptors(), because the
latter uses the former.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 16:42:29 +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 0b6970ed70 readme: document fuzzing setup
These are just the standard AFL instructions, adapted to Meson.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 14:08:57 +00:00
Simon Ser ac8ecd781a readme: add building section
Basic instructions to build the library.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 14:08:57 +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
Simon Ser 65dbc3fbbf test: add panasonic-mei96a2-dp EDID
This adds coverage for two untested code-paths:

- Unset "Serial Number"
- "Model year" instead of "Made in"

This EDID blob comes from Digital/Panasonic/MEI96A2/7CA47BE65E1E [1]
in the linuxhw EDID repository.

[1]: https://github.com/linuxhw/EDID/blob/master/Digital/Panasonic/MEI96A2/7CA47BE65E1E

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 14:05:12 +02:00
Simon Ser 742697cb98 di-edid-decode: only print serial number if non-zero
Upstream edid-decode hides the serial number in this case.

The spec says that it's optional, and set to zero when unused.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 14:04:48 +02:00
Simon Ser 10435a83e8 edid: parse other feature support flags
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser 0473e12c54 edid: parse supported color encoding formats
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser 039a2a15f7 edid: parse supported DPMS states
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser 83396e28e3 edid: parse basic gamma
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser 5b156d8370 edid: parse screen size
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser b1bce19f03 edid: parse digital video input definition
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser 18527df178 edid: introduce get_bit_range
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser d680d73a3a edid: introduce has_bit
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-10 11:49:20 +00:00
Simon Ser c9d9bf4dd5 build: error out on -Wimplicit
These warnings are easy to miss during development:

    ../edid.c: In function ‘_di_edid_parse’:
    ../edid.c:254:25: warning: implicit declaration of function ‘di_edid_destroy’? [-Wimplicit-function-declaration]
      254 |                         di_edid_destroy(edid);
          |                         ^~~~~~~~~~~~~~~

And when missed, the code still compiles. Which means one needs to clean-build
to show them again.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-09 15:05:04 +02:00
Simon Ser 7a31791343 edid: add support for product serial, name and data strings
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-09 07:28:16 +00:00
Simon Ser 2f8f41ea48 edid: add basic support for display descriptors
Expose an API to list display descriptors. Detailed timing
descriptors are not parsed.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-09 07:28:16 +00:00
Simon Ser c05fbc875b ci: generate coverage information
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-08 10:49:37 +02:00
Simon Ser 24b2ea134f ci: enable meson --fatal-meson-warnings
This allows us to catch issues such as unknown build options and
newer Meson features used without a bump in meson.build's project().

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-08 08:29:16 +00:00
Simon Ser 6ae12d067e ci: add junit report for tests
Allows GitLab to get structured test results.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-06 15:37:16 +02:00
Simon Ser 225ec04a54 di-edid-decode: print block checksum
While this isn't particularly interesting to print, this reduces
the diff between di-edid-decode and edid-decode.

This is not exposed via the low-level EDID library because callers
wouldn't have a use for it.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-06 11:01:55 +00:00
Simon Ser 6cbaf27c91 edid: switch to a statically allocated extension array
The spec defines an upper bound for the extension block count,
which means we don't need to dynamically allocate the array. This
simplifies our logic a bit by removing an allocation error codepath.

The array is NULL-terminated, so EDID_MAX_BLOCK_COUNT is suitable
since it's the max number of extension blocks including the base
block, and the array doesn't include the base block.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-02 10:24:28 +02:00
Simon Ser 6238439643 di-edid-decode: print extension block count
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-01 12:51:26 +00:00
Simon Ser 350e557c3f edid: check extension block count field
The ensures the EDID hasn't been truncated.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-06-01 12:51:26 +00:00
Simon Ser 64d148d2b2 edid: document where extension block tags are defined
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-25 11:33:00 +02:00
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 b479e68220 ci: always upload Meson logs as artifacts
Previously, the artifacts weren't uploaded on failure.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-25 11:26:55 +02:00
Simon Ser 3d7a9bb77c ci: fix tests with outdated edid-decode
It sounds like the CI container was shipping an outdated version
of edid-decode which doesn't match the commit recorded in
.gitlab-ci.yml.

Update the diffs in the test data, and bump the CI container tag
again to make sure it's up-to-date with the manifest.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-24 17:58:09 +02:00
Pekka Paalanen 9b86c06206 tests/data: add HP Pavilion 27 Quantum Dot
This is my HDR monitor. The EDID offers some fields that only HDR
monitors have.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-05-24 11:26:05 +03: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 a8e78208a5 Add edid-decode testing infrastructure
Add two small shell utilities to generate and compare diffs between
edid-decode and di-edid-decode. Store the diffs in-tree and add tests
to ensure they don't regress. Run the tests in CI with a pinned
installation of edid-decode.

One EDID blob is added to the test collection: dell-2408wfp-dp. It's
extracted [1] from the edid-decode repository.

[1]: https://git.linuxtv.org/edid-decode.git/tree/data/dell-2408wfp-dp

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/issues/5
2022-05-12 11:35:58 +02: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 321d5dbcba Add di_info_get_product_name
This high-level function leverages the low-level
di_edid_get_vendor_product function to build a string describing
the display device product.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-09 14:33:58 +02:00
Simon Ser c22e47162e build: enable POSIX.1-2008
Turns on functions like strdup.

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 8c017e37ac Add di-edid-decode utility
This utility displays low-level EDID information. It uses the same
format as the official edid-decode CLI tool from linuxtv.org. It
will be helpful for testing.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-09 14:33:49 +02:00
Simon Ser 40b7b46a5c Add di_info_get_edid
Returns a low-level struct di_edid from a high-level struct di_info.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-06 10:30:33 +02:00
Simon Ser c01982bdb1 Add skeleton for high-level API
This exposes a new di_info opaque struct from which high-level
information will be able to be queried by the user. A new
di_info_parse_edid function creates a di_info from an EDID blob.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-05-06 10:26:28 +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
Simon Ser 73b763d6b4 ci: fix build stage not run in MRs
See https://docs.gitlab.com/ee/ci/yaml/#rules

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-04-04 21:57:50 +02:00
Simon Ser 74b0cbc41d build: turn on -Wconversion
This warns when implicit conversions may alter a value. It's easy
to miss implicit conversions from signed to unsigned, from real to
integer, or to smaller types. This warning forces such conversions
to be explicit.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-04-04 19:21:35 +00:00
Simon Ser 38a8028c69 readme: add goals
Explain our goals for the library.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-04-04 19:21:02 +00:00
Simon Ser a47a411617 build: tweak C warning options
Enable a few extra warning options, including -Walloca because it's
error-prone. Enable -Wdeclaration-after-statement to enforce the code
style. Disable -Wunused-parameter and -Wmissing-field-initializers
because these are pointless and don't catch bugs.

Inspired from the Weston and wlroots options.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-03-25 12:21:59 +01:00
Simon Ser 79fbb1ec39 build: add Meson boilerplate
Add a minimal Meson build file, and wire it up to CI.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-03-24 02:32:58 +01:00
Simon Ser 7e5903d8b3 ci: add .gitlab-ci.yml
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-03-24 02:16:08 +01:00
Simon Ser 114fa16d44 Add .editorconfig
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-03-24 01:49:12 +01:00
Simon Ser f4b94b9261 Initial commit
Signed-off-by: Simon Ser <contact@emersion.fr>
2022-03-24 01:49:00 +01:00

Diff Content Not Available