diff options
| author | UjinT34 <41110182+UjinT34@users.noreply.github.com> | 2025-12-03 04:30:43 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-03 01:30:43 +0000 |
| commit | 3cf0280b11f370c11e6839275e547779a33f4a19 (patch) | |
| tree | bcb428c72419fc1cee35d2922a434a34517f79ef /src/Compositor.cpp | |
| parent | 2cadc8ababb56331c110b7584e09fe0f9352672d (diff) | |
renderer: add quirks:prefer_hdr to fix HDR activation for some clients (#12436)
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index c8bd45fe..643aad1b 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2899,6 +2899,27 @@ SImageDescription CCompositor::getPreferredImageDescription() { return m_monitors.size() == 1 ? m_monitors[0]->m_imageDescription : SImageDescription{.primaries = NColorPrimaries::BT709}; } +SImageDescription CCompositor::getHDRImageDescription() { + if (!PROTO::colorManagement) { + Debug::log(ERR, "FIXME: color management protocol is not enabled, returning empty image description"); + return SImageDescription{}; + } + + return m_monitors.size() == 1 && m_monitors[0]->m_output && m_monitors[0]->m_output->parsedEDID.hdrMetadata.has_value() ? + SImageDescription{.transferFunction = NColorManagement::CM_TRANSFER_FUNCTION_ST2084_PQ, + .primariesNameSet = true, + .primariesNamed = NColorManagement::CM_PRIMARIES_BT2020, + .primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_BT2020), + .luminances = {.min = m_monitors[0]->m_output->parsedEDID.hdrMetadata->desiredContentMinLuminance, + .max = m_monitors[0]->m_output->parsedEDID.hdrMetadata->desiredContentMaxLuminance, + .reference = m_monitors[0]->m_output->parsedEDID.hdrMetadata->desiredMaxFrameAverageLuminance}} : + SImageDescription{.transferFunction = NColorManagement::CM_TRANSFER_FUNCTION_ST2084_PQ, + .primariesNameSet = true, + .primariesNamed = NColorManagement::CM_PRIMARIES_BT2020, + .primaries = NColorManagement::getPrimaries(NColorManagement::CM_PRIMARIES_BT2020), + .luminances = {.min = 0, .max = 10000, .reference = 203}}; +} + bool CCompositor::shouldChangePreferredImageDescription() { Debug::log(WARN, "FIXME: color management protocol is enabled and outputs changed, check preferred image description changes"); return false; |
