File 0001-backends-drm-disable-drm-color-pipelines-on-AMD.patch of Package kwin6

From bc2efa2f0e848ff0a621377cfe1141294c91b1bf Mon Sep 17 00:00:00 2001
From: Xaver Hugl <xaver.hugl@kde.org>
Date: Fri, 20 Mar 2026 17:38:43 +0100
Subject: [PATCH] backends/drm: disable drm color pipelines on AMD

Many users report severe banding issues when the shaper LUT of the 3D LUT gets
used on AMD, and there are a few driver bugs as well that still need fixing.
The color pipeline will be used again in Plasma 6.7, where KWin has a better
algorithm for programming color pipelines, and likel most of the driver issues
will be fixed until it's released.

For testing purposes, KWIN_DRM_USE_COLOR_PIPELINE=1 can be used to re-enable
color pipelines (or disable them on other vendors).

CCBUG: 517556
---
 src/backends/drm/drm_gpu.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp
index 7d6a58460a..2302077b18 100644
--- a/src/backends/drm/drm_gpu.cpp
+++ b/src/backends/drm/drm_gpu.cpp
@@ -57,6 +57,7 @@ namespace KWin
 {
 
 static const std::optional<bool> s_modifiersEnv = environmentVariableBoolValue("KWIN_DRM_USE_MODIFIERS");
+static const std::optional<bool> s_colorPipelineEnv = environmentVariableBoolValue("KWIN_DRM_USE_COLOR_PIPELINE");
 
 DrmGpu::DrmGpu(DrmBackend *backend, int fd, std::unique_ptr<DrmDevice> &&device)
     : m_fd(fd)
@@ -119,7 +120,7 @@ DrmGpu::DrmGpu(DrmBackend *backend, int fd, std::unique_ptr<DrmDevice> &&device)
         m_asyncPageflipSupported = drmGetCap(fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP, &capability) == 0 && capability == 1;
     }
 
-    m_colorPipelineSupported = drmSetClientCap(fd, DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE, 1) == 0;
+    m_colorPipelineSupported = s_colorPipelineEnv.value_or(!m_isAmdgpu) && drmSetClientCap(fd, DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE, 1) == 0;
 
     m_delayedModesetTimer.setInterval(0);
     m_delayedModesetTimer.setSingleShot(true);
-- 
2.53.0

openSUSE Build Service is sponsored by