diff --git a/disable-gpu-when-using-nouveau-boo-1005323.diff b/disable-gpu-when-using-nouveau-boo-1005323.diff new file mode 100644 index 0000000..8b5e156 --- /dev/null +++ b/disable-gpu-when-using-nouveau-boo-1005323.diff @@ -0,0 +1,73 @@ +Index: qtwebengine-opensource-src-5.7.1/src/core/web_engine_context.cpp +=================================================================== +--- qtwebengine-opensource-src-5.7.1.orig/src/core/web_engine_context.cpp ++++ qtwebengine-opensource-src-5.7.1/src/core/web_engine_context.cpp +@@ -87,6 +87,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -158,6 +160,37 @@ void dummyGetPluginCallback(const std::v + } + #endif + ++QString openGLVendor() ++{ ++ QString vendor; ++ ++ QOpenGLContext *oldContext = QOpenGLContext::currentContext(); ++ QSurface *oldSurface = 0; ++ if (oldContext) ++ oldSurface = oldContext->surface(); ++ ++ QScopedPointer surface( new QOffscreenSurface ); ++ surface->create(); ++ QOpenGLContext context; ++ if (!context.create()) { ++ qDebug() << "Error creating openGL context"; ++ } ++ else if (!context.makeCurrent(surface.data())) { ++ qDebug() << "Error making openGL context current context"; ++ } else { ++ const GLubyte *p; ++ QOpenGLFunctions *f = context.functions(); ++ if ((p = f->glGetString(GL_VENDOR))) ++ vendor = QString::fromLatin1(reinterpret_cast(p)); ++ } ++ ++ context.doneCurrent(); ++ if (oldContext && oldSurface) ++ oldContext->makeCurrent(oldSurface); ++ ++ return vendor; ++} ++ + } // namespace + + namespace QtWebEngineCore { +@@ -294,7 +327,20 @@ WebEngineContext::WebEngineContext() + + GLContextHelper::initialize(); + +- if (usingANGLE() || usingSoftwareDynamicGL() || usingQtQuick2DRenderer()) { ++ bool disableGpu = qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_GPU"); ++ ++ if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND") && openGLVendor() == QStringLiteral("nouveau")) ++ { ++ qWarning() << "Nouveau openGL driver detected. Qt WebEngine will disable usage of the GPU.\n" ++ "Please consider using the propietary NVIDIA drivers.\n\n" ++ "Alternatively, you can set the QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND\n" ++ "environment variable before running this application, but this is \n" ++ "not recommended since this usually causes applications to crash as\n" ++ "Nouveau openGL drivers don't support multithreaded rendering"; ++ disableGpu = true; ++ } ++ ++ if (usingANGLE() || usingSoftwareDynamicGL() || usingQtQuick2DRenderer() || disableGpu) { + parsedCommandLine->AppendSwitch(switches::kDisableGpu); + } else { + const char *glType = 0; diff --git a/libqt5-qtwebengine.changes b/libqt5-qtwebengine.changes index b6475b4..905f62a 100644 --- a/libqt5-qtwebengine.changes +++ b/libqt5-qtwebengine.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Oct 25 13:40:49 UTC 2016 - alarrosa@suse.com + +- Add disable-gpu-when-using-nouveau-boo-1005323.diff. Disables the + use of the gpu by webengine when the nouveau opengl driver is + detected since nouveau doesn't support rendering from different + threads. Also, allows to use two environment variables + QT_WEBENGINE_DISABLE_GPU to force the disabling of the gpu and + QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND to disable the detection + of nouveau, just in case someone wants to try with newer nouveau + releases (boo#1005323, boo#997171). + ------------------------------------------------------------------- Thu Oct 6 09:26:52 UTC 2016 - hrvoje.senjan@gmail.com diff --git a/libqt5-qtwebengine.spec b/libqt5-qtwebengine.spec index 69f9eda..f53f915 100644 --- a/libqt5-qtwebengine.spec +++ b/libqt5-qtwebengine.spec @@ -41,6 +41,8 @@ Patch2: armv6-ffmpeg-no-thumb.patch Patch3: webrtc-build-with-neon.patch # PATCH-FIX-UPSTREAM Do-not-depend-on-Linux-4.5.patch Patch4: Do-not-depend-on-Linux-4.5.patch +# PATCH-FIX-UPSTREAM disable-gpu-when-using-nouveau-boo-1005323.diff -- Detect nouveau opengl drivers and disable gpu usage to work around nouveau crashing +Patch5: disable-gpu-when-using-nouveau-boo-1005323.diff # http://www.chromium.org/blink not ported to PowerPC ExcludeArch: ppc ppc64 ppc64le s390 s390x # Try to fix i586 MemoryErrors with rpmlint @@ -152,6 +154,7 @@ sed -i 's|$(STRIP)|strip|g' src/core/core_module.pro %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %package devel Summary: Qt Development Kit