Commit graph

12 commits

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