backends/drm: work around amdgpu bugs with DCC modifiers
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/10875 for details. The workaround can be disabled again with the KWIN_DRM_NO_DCC_WORKAROUND=1 environment variable
This commit is contained in:
parent
445567f54e
commit
20d5f9bc6e
1 changed files with 9 additions and 1 deletions
|
@ -132,7 +132,15 @@ std::optional<OutputLayerBeginFrameInfo> EglGbmLayerSurface::startRendering(cons
|
||||||
if (requireAlpha && info->alphaBits == 0) {
|
if (requireAlpha && info->alphaBits == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m_surface->shadowSwapchain = EglSwapchain::create(m_eglBackend->drmDevice()->allocator(), m_eglBackend->openglContext(), m_surface->gbmSwapchain->size(), it.key(), it.value());
|
auto mods = it.value();
|
||||||
|
if (m_eglBackend->gpu()->isAmdgpu() && qEnvironmentVariableIntValue("KWIN_DRM_NO_DCC_WORKAROUND") == 0) {
|
||||||
|
// using modifiers with DCC here causes glitches on amdgpu: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10875
|
||||||
|
if (!mods.contains(DRM_FORMAT_MOD_LINEAR)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
mods = {DRM_FORMAT_MOD_LINEAR};
|
||||||
|
}
|
||||||
|
m_surface->shadowSwapchain = EglSwapchain::create(m_eglBackend->drmDevice()->allocator(), m_eglBackend->openglContext(), m_surface->gbmSwapchain->size(), it.key(), mods);
|
||||||
if (m_surface->shadowSwapchain) {
|
if (m_surface->shadowSwapchain) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue