diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index 34704d1fae..8016069fd3 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -314,7 +314,13 @@ bool DrmPipeline::prepareAtomicModeset(DrmAtomicCommit *commit) // TODO migrate this env var to a proper setting static bool ok = false; static const int preferred = qEnvironmentVariableIntValue("KWIN_DRM_PREFER_COLOR_DEPTH", &ok); - commit->addProperty(m_connector->maxBpc, ok && preferred == 24 ? 8 : 10); + // docks very often have problems with higher than 8 bits per color + // see https://gitlab.freedesktop.org/drm/amd/-/issues/2598 for example + uint32_t bpc = m_connector->mstPath().isEmpty() ? 10 : 8; + if (ok) { + bpc = preferred / 3; + } + commit->addProperty(m_connector->maxBpc, std::clamp(bpc, m_connector->maxBpc.minValue(), m_connector->maxBpc.maxValue())); } if (m_connector->hdrMetadata.isValid()) { commit->addBlob(m_connector->hdrMetadata, createHdrMetadata(m_pending.colorDescription.transferFunction()));