Skip to content

Add high-level API for colorimetry

Pekka Paalanen requested to merge pq/libdisplay-info:mr/colorimetry into main

This series adds three (four) new high-level APIs to get the display colorimetry in a hopefully generic way, as much as we can know. The implementations already use both EDID and DisplayID as far as the low-level API exists, with EDID Color Point Descriptors excluded as those are not found in the wild.

The series is a draft, because I haven't made use of it in Weston yet.

As the low-level API expands, I expect at least di_info_get_default_color_primaries() and di_info_get_supported_signal_colorimetry() to gain more optional sources for their information, e.g. DisplayID.

Get HDR static metadata

di_info_get_hdr_static_metadata() returns the CTA-861-H HDR static metadata. I did not have good grounds to design a more generic structure, because I have no other examples, and the data is very much tied to CTA-861-H or later specifically anyway.

Get default RGB colorimetry parameters

di_info_get_default_color_primaries() and di_info_get_default_gamma() retrieve the primaries, white point and display gamma value that are supposed to apply at factory reset device state, when driven with the default RGB colorimetry. That is, when infoframe metadata does not tell otherwise to the display.

How much these are actually of use, I'm not sure. The primaries do not have to describe the physical (phosphor/filter) primaries but only the default RGB colorimetry primaries. E-EDID does refer to physical phosphor/filter primaries in passing, but CTA-861-H clarifies this applies only to default RGB colorimetry and seems to withdraw the hardware description aspect.

Therefore we cannot assume that these primaries would represent the hardware primaries that might be reachable with e.g. BT.2020 colorimetry.

Get supported signalling colorimetries

di_info_get_supported_signal_colorimetry() returns the few most interesting additional colorimetries (signal color encodings) that the display might support. Essentially this tells us what we can choose with the KMS "Colorspace" property. I left out the options that I don't see use for right now.

According to CTA-861-H, Table 6 in Section 5.3, the colorimetry and HDR static metadata EOTF together define the transfer characteristics and possibly even maximum luminance, and not only the encoding primaries and white point.

Edited by Pekka Paalanen

Merge request reports