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

Antonio Rojas arojas at archlinux.org
Thu Jun 14 15:51:36 UTC 2018


    Date: Thursday, June 14, 2018 @ 15:51:36
  Author: arojas
Revision: 326970

Fix GPU rendering on Wayland

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

--------------------------+
 PKGBUILD                 |   15 ++++--
 qtwebengine-no-gpu.patch |   99 ---------------------------------------------
 2 files changed, 9 insertions(+), 105 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-06-14 12:53:25 UTC (rev 326969)
+++ PKGBUILD	2018-06-14 15:51:36 UTC (rev 326970)
@@ -5,7 +5,7 @@
 pkgname=qt5-webengine
 _qtver=5.11.0
 pkgver=${_qtver/-/}
-pkgrel=2
+pkgrel=3
 arch=('x86_64')
 url='http://qt-project.org/'
 license=('LGPL3' 'LGPL2.1' 'BSD')
@@ -18,13 +18,15 @@
 source=("http://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz"
          qtwebengine-harmony.patch qtwebengine-gcc8.patch qtwebengine-ffmpeg4.patch
          falkon-copy-menu.patch::"http://code.qt.io/cgit/qt/qtwebengine.git/patch/?id=af0c47b1"
-         qtwebengine-no-gpu.patch)
+         qtwebengine-wayland1.patch::"http://code.qt.io/cgit/qt/qtwebengine.git/patch/?id=9397251b"
+         qtwebengine-wayland2.patch::"http://code.qt.io/cgit/qt/qtwebengine.git/patch/?id=a66d4cd8")
 sha256sums=('5dd754d603c66d36e93b96b4f7c24a6e6269ae6a1682a524b8baa664d5c44b45'
             'feca54ab09ac0fc9d0626770a6b899a6ac5a12173c7d0c1005bc3964ec83e7b3'
             '7f84891ef1ac9b7943ac5b92f2df8caf0c24c3695bdc6296926b581a87c0e856'
             '4a831d89fb0d6a6ced23115ced71e60513ce279fba4bd493178842647948f510'
             'b5b3d873c51ed2ad05b2ffe1f3d14cd95a732f0e1288c04a502d65576e316f5d'
-            '6cd70c37f3b3aea926f1ee20c1f59354f2a02d240dbf344c6dc0a75f8aa8e07b')
+            '6a31607401f63eb6aec5e131c5f7a4723af21615a2df720d148e253ca301894a'
+            '6baeb241165a1fd94ada95b27924ba55f74761b1b9d406d73ebcce4b139abf60')
 
 prepare() {
   mkdir -p build
@@ -38,9 +40,10 @@
   # FreeType 2.8.1
   patch -Np1 -i ../qtwebengine-harmony.patch
   # Fix copy context menu
-  patch -p1 -i "$srcdir"/falkon-copy-menu.patch
-  # Disable GPU rendering on Wayland https://bugreports.qt.io/browse/QTBUG-68479
-  patch -p1 -i "$srcdir"/qtwebengine-no-gpu.patch
+  patch -p1 -i ../falkon-copy-menu.patch
+  # Fix openGL detection on Wayland
+  patch -p1 -i ../qtwebengine-wayland1.patch
+  patch -p1 -i ../qtwebengine-wayland2.patch
   # Fix build with gcc8 (Fedora)
   cd src/3rdparty/chromium
   patch -p1 -i "$srcdir"/qtwebengine-gcc8.patch

Deleted: qtwebengine-no-gpu.patch
===================================================================
--- qtwebengine-no-gpu.patch	2018-06-14 12:53:25 UTC (rev 326969)
+++ qtwebengine-no-gpu.patch	2018-06-14 15:51:36 UTC (rev 326970)
@@ -1,99 +0,0 @@
-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