Commit graph

32 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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