From 742268bfa1b096a11ace040483022253b775505f Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Thu, 15 Feb 2024 20:08:40 +0100 Subject: [PATCH] backends/drm: don't advertise support for wide color gamut on Intel i915 doesn't implement the Colorspace property correctly, so exposing this feature makes it look like our HDR implementation is broken. This hides the HDR checkbox in system settings until Intel fixes their driver For testing purposes, users can still opt into this with the environment variable KWIN_DRM_ALLOW_INTEL_COLORSPACE. --- src/backends/drm/drm_output.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index 2b1b45cf8d..bd3447c147 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -35,6 +35,8 @@ namespace KWin { +static const bool s_allowColorspaceIntel = qEnvironmentVariableIntValue("KWIN_DRM_ALLOW_INTEL_COLORSPACE") == 1; + DrmOutput::DrmOutput(const std::shared_ptr &conn) : DrmAbstractOutput(conn->gpu()) , m_pipeline(conn->pipeline()) @@ -64,7 +66,9 @@ DrmOutput::DrmOutput(const std::shared_ptr &conn) capabilities |= Capability::HighDynamicRange; } if (m_connector->colorspace.isValid() && m_connector->colorspace.hasEnum(DrmConnector::Colorspace::BT2020_RGB) && m_connector->edid()->supportsBT2020()) { - capabilities |= Capability::WideColorGamut; + if (!m_gpu->isI915() || s_allowColorspaceIntel) { + capabilities |= Capability::WideColorGamut; + } } if (conn->isInternal()) { // TODO only set this if an orientation sensor is available?