Hello community,

here is the log from the commit of package libqt5-qtwebengine for 
openSUSE:Factory checked in at 2016-10-31 11:08:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libqt5-qtwebengine (Old)
 and      /work/SRC/openSUSE:Factory/.libqt5-qtwebengine.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libqt5-qtwebengine"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libqt5-qtwebengine/libqt5-qtwebengine.changes    
2016-10-06 16:46:30.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.libqt5-qtwebengine.new/libqt5-qtwebengine.changes   
    2016-10-31 11:08:30.000000000 +0100
@@ -1,0 +2,12 @@
+Tue Oct 25 13:40:49 UTC 2016 - alarr...@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).
+
+-------------------------------------------------------------------

New:
----
  disable-gpu-when-using-nouveau-boo-1005323.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libqt5-qtwebengine.spec ++++++
--- /var/tmp/diff_new_pack.Dnctp2/_old  2016-10-31 11:08:34.000000000 +0100
+++ /var/tmp/diff_new_pack.Dnctp2/_new  2016-10-31 11:08:34.000000000 +0100
@@ -41,6 +41,8 @@
 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 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %package devel
 Summary:        Qt Development Kit

++++++ disable-gpu-when-using-nouveau-boo-1005323.diff ++++++
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 <QFileInfo>
 #include <QGuiApplication>
 #include <QOpenGLContext>
+#include <QOpenGLFunctions>
+#include <QOffscreenSurface>
 #include <QStringList>
 #include <QVector>
 #include <qpa/qplatformnativeinterface.h>
@@ -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<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;
+}
+
 } // 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;

Reply via email to