From 6e05314739282c03815c66682c819eaacc3cc449 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Fri, 6 Oct 2023 22:59:52 +0200 Subject: [PATCH] backends/drm: disable the hardware cursor with color management Blending needs to happen in linear space, which is not the case if the inverse EOTF and VCGT are applied before blending --- src/backends/drm/drm_egl_cursor_layer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backends/drm/drm_egl_cursor_layer.cpp b/src/backends/drm/drm_egl_cursor_layer.cpp index 6e58bf9092..1bb580877a 100644 --- a/src/backends/drm/drm_egl_cursor_layer.cpp +++ b/src/backends/drm/drm_egl_cursor_layer.cpp @@ -47,6 +47,10 @@ EglGbmCursorLayer::EglGbmCursorLayer(EglGbmBackend *eglBackend, DrmPipeline *pip std::optional EglGbmCursorLayer::beginFrame() { + if (m_pipeline->output()->needsColormanagement()) { + // TODO for hardware cursors to work with color management, KWin needs to offload post-blending color management steps to KMS + return std::nullopt; + } return m_surface.startRendering(m_pipeline->gpu()->cursorSize(), drmToTextureRotation(m_pipeline) | TextureTransform::MirrorY, m_pipeline->cursorFormats(), m_pipeline->colorDescription(), m_pipeline->output()->channelFactors(), m_pipeline->output()->needsColormanagement()); }