backends/drm: use max frame average brightness instead of max brightness in HDR metadata

Using the peak maximum brightness can cause displays to do more agressive tone mapping, which
overall darkens the image without any reason. Instead, send the max fame average brightness,
which the display can always do over the whole screen
This commit is contained in:
Xaver Hugl 2023-05-28 20:10:27 +02:00
parent e6d2607fe3
commit 10c1e7892e

View file

@ -757,11 +757,11 @@ std::shared_ptr<DrmBlob> DrmPipeline::createHdrMetadata(NamedTransferFunction tr
},
.white_point = {to16Bit(colorimetry.white.x()), to16Bit(colorimetry.white.y())},
// in nits
.max_display_mastering_luminance = uint16_t(std::round(metadata.desiredContentMaxLuminance)),
.max_display_mastering_luminance = uint16_t(std::round(metadata.desiredMaxFrameAverageLuminance)),
// in 0.0001 nits
.min_display_mastering_luminance = uint16_t(std::round(metadata.desiredContentMinLuminance * 10000)),
// in nits
.max_cll = uint16_t(std::round(metadata.desiredContentMaxLuminance)),
.max_cll = uint16_t(std::round(metadata.desiredMaxFrameAverageLuminance)),
.max_fall = uint16_t(std::round(metadata.desiredMaxFrameAverageLuminance)),
},
};