[arch-commits] Commit in qt5-webengine/trunk (PKGBUILD qtwebengine-no-gpu.patch)

Antonio Rojas arojas at archlinux.org
Wed Jan 17 17:50:56 UTC 2018


    Date: Wednesday, January 17, 2018 @ 17:50:55
  Author: arojas
Revision: 315018

Disable GPU rendering on Wayland and nouveau since it crashes (FS#57018)

Added:
  qt5-webengine/trunk/qtwebengine-no-gpu.patch
Modified:
  qt5-webengine/trunk/PKGBUILD

--------------------------+
 PKGBUILD                 |   10 +++-
 qtwebengine-no-gpu.patch |   99 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-01-17 17:29:39 UTC (rev 315017)
+++ PKGBUILD	2018-01-17 17:50:55 UTC (rev 315018)
@@ -5,7 +5,7 @@
 pkgname=qt5-webengine
 _qtver=5.10.0
 pkgver=${_qtver/-/}
-pkgrel=2
+pkgrel=3
 arch=('x86_64')
 url='http://qt-project.org/'
 license=('LGPL3' 'LGPL2.1' 'BSD')
@@ -16,9 +16,11 @@
 groups=('qt' 'qt5')
 _pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}"
 source=("http://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz"
-         qtwebengine-harmony.patch)
+         qtwebengine-harmony.patch
+         qtwebengine-no-gpu.patch)
 sha256sums=('a8bf5989ef847a249bbc1f391743a36971825b896747d073e30dbcdefc9567f9'
-            'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3')
+            'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3'
+            '6cd70c37f3b3aea926f1ee20c1f59354f2a02d240dbf344c6dc0a75f8aa8e07b')
 
 prepare() {
   mkdir -p build
@@ -31,6 +33,8 @@
 
   # FreeType 2.8.1
   patch -Np1 -i ../qtwebengine-harmony.patch
+  # Disable GPU rendering on nouveau and wayland (openSUSE) https://bugreports.qt.io/browse/QTBUG-65682
+  patch -p1 -i ../qtwebengine-no-gpu.patch
 }
 
 build() {

Added: qtwebengine-no-gpu.patch
===================================================================
--- qtwebengine-no-gpu.patch	                        (rev 0)
+++ qtwebengine-no-gpu.patch	2018-01-17 17:50:55 UTC (rev 315018)
@@ -0,0 +1,99 @@
+From: Antonio Larrosa <alarrosa at suse.com>
+Subject: Disable GPU when using nouveau or running on wayland
+References: boo#1005323, boo#1060990
+
+Qt WebEngine uses multi-threaded OpenGL, which nouveau does not support.
+It also crashes when running on wayland, the cause is not yet known.
+Work around these issues by not doing GPU-accelerated rendering in such
+cases.
+
+Index: qtwebengine-everywhere-src-5.10.0/src/core/web_engine_context.cpp
+===================================================================
+--- qtwebengine-everywhere-src-5.10.0.orig/src/core/web_engine_context.cpp
++++ qtwebengine-everywhere-src-5.10.0/src/core/web_engine_context.cpp
+@@ -93,6 +93,7 @@
+ #include <QOffscreenSurface>
+ #ifndef QT_NO_OPENGL
+ # include <QOpenGLContext>
++# include <QOpenGLFunctions>
+ #endif
+ #include <QQuickWindow>
+ #include <QStringList>
+@@ -167,6 +168,39 @@ void dummyGetPluginCallback(const std::v
+ }
+ #endif
+ 
++#ifndef QT_NO_OPENGL
++QString openGLVendor()
++{
++    QString vendor;
++
++    QOpenGLContext *oldContext = QOpenGLContext::currentContext();
++    QSurface *oldSurface = 0;
++    if (oldContext)
++        oldSurface = oldContext->surface();
++
++    QScopedPointer<QOffscreenSurface> 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<const char *>(p));
++    }
++
++    context.doneCurrent();
++    if (oldContext && oldSurface)
++        oldContext->makeCurrent(oldSurface);
++
++    return vendor;
++}
++#endif
++
+ } // namespace
+ 
+ namespace QtWebEngineCore {
+@@ -379,6 +413,27 @@ WebEngineContext::WebEngineContext()
+     const char *glType = 0;
+ #ifndef QT_NO_OPENGL
+ 
++    bool disableGpu = qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_GPU");
++
++    if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND") && platform.startsWith("wayland", Qt::CaseInsensitive))
++    {
++        qWarning() << "Running on wayland. Qt WebEngine will disable usage of the GPU.\n"
++                      "Note: you can set the QT_WEBENGINE_DISABLE_WAYLAND_WORKAROUND\n"
++                      "environment variable before running this application, but this is \n"
++                      "not recommended since this usually causes applications to crash.";
++        disableGpu = true;
++    }
++
++    if (!qEnvironmentVariableIsSet("QT_WEBENGINE_DISABLE_NOUVEAU_WORKAROUND") && openGLVendor() == QStringLiteral("nouveau"))
++    {
++        qWarning() << "Nouveau openGL driver detected. Qt WebEngine will disable usage of the GPU.\n"
++                      "Note: 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;
++    }
++
+     bool tryGL =
+             !usingANGLE()
+             && (!usingSoftwareDynamicGL()
+@@ -389,7 +444,7 @@ WebEngineContext::WebEngineContext()
+                 || enableWebGLSoftwareRendering
+ #endif
+                 )
+-            && !usingQtQuick2DRenderer();
++            && !usingQtQuick2DRenderer() && !disableGpu;
+ 
+     if (tryGL) {
+         if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) {
+



More information about the arch-commits mailing list