From bdc62b3516c5dfd9027205a529685e8fd9928314 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 8 Nov 2023 16:48:31 +0100 Subject: [PATCH] backends/drm: ensure icc profiles aren't applied with HDR ICC profiles don't support HDR yet, and they don't make a lot of sense with how unpredictable displays behave with BT2020 and/or PQ inputs --- src/backends/drm/drm_output.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index b1ff8e97ea..1867470279 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -349,7 +349,12 @@ void DrmOutput::applyQueuedChanges(const std::shared_ptr &props if (props->iccProfilePath) { next.iccProfilePath = *props->iccProfilePath; next.iccProfile = IccProfile::load(*props->iccProfilePath); + } + if (!next.highDynamicRange && !next.wideColorGamut) { m_pipeline->setIccProfile(next.iccProfile); + } else { + // ICC profiles don't support HDR (yet) + m_pipeline->setIccProfile(nullptr); } if (m_state.highDynamicRange != next.highDynamicRange || m_state.sdrBrightness != next.sdrBrightness || m_state.wideColorGamut != next.wideColorGamut || m_state.iccProfile != next.iccProfile) { m_renderLoop->scheduleRepaint();