From 2e3eb5402bea554573cdde4d97e93c418ed670c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 22 Nov 2013 15:44:37 +0100 Subject: [PATCH] Fallback to XRender if scene-graph uses GUI thread for OpenGL rendering This is a workaround fo QTBUG-34898 and affects the VirtualBox driver and SandyBridge Mobile. OpenGL compositing is just not possible and crashes as soon as there is anything rendered with QtQuick. This change should be reverted once the Qt bug is fixed. To nevertheless use OpenGL one can as always use the KWIN_COMPOSE env variable, though this will result in crashes. An alternative is to set QT_OPENGL_NO_SANITY_CHECK which forces Qt into using the threaded rendering. At least for Sandybridge this seems to be a workable solution as it's only causing flickering in fullscreen and KWin doesn't use any fullscreen QtQuick elements. --- libkwineffects/kwinglplatform.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libkwineffects/kwinglplatform.cpp b/libkwineffects/kwinglplatform.cpp index 8955612095..ba9600fcd1 100644 --- a/libkwineffects/kwinglplatform.cpp +++ b/libkwineffects/kwinglplatform.cpp @@ -753,6 +753,11 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) m_driverVersion = parseVersionString(versionTokens.at(index + 1)); else m_driverVersion = 0; + + if (qgetenv("QT_OPENGL_NO_SANITY_CHECK").isNull()) { + // workaround for QTBUG-34898 + m_recommendedCompositor = XRenderCompositing; + } } @@ -825,6 +830,10 @@ void GLPlatform::detect(OpenGLPlatformInterface platformInterface) } else { m_recommendedCompositor = OpenGL2Compositing; } + if (m_chipClass == SandyBridge && m_renderer.contains("Mobile") && qgetenv("QT_OPENGL_NO_SANITY_CHECK").isNull()) { + // workaround for QTBUG-34898 + m_recommendedCompositor = XRenderCompositing; + } } if (isMesaDriver() && platformInterface == EglPlatformInterface) {