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>
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>
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>
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>
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>
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>
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>
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>
../../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>
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>
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>
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>
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>