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