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