From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 31EB0138335 for ; Wed, 20 Jun 2018 15:29:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 12F66E0A04; Wed, 20 Jun 2018 15:29:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C6915E0A04 for ; Wed, 20 Jun 2018 15:29:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 031C7335CF5 for ; Wed, 20 Jun 2018 15:29:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 166AE2E5 for ; Wed, 20 Jun 2018 15:29:07 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1529505049.938edc9a6b2179e4aabcf5ab340ebd64d90a77d1.asturm@gentoo> Subject: [gentoo-commits] proj/qt:master commit in: dev-qt/qtwebengine/, dev-qt/qtwebengine/files/ X-VCS-Repository: proj/qt X-VCS-Files: dev-qt/qtwebengine/files/qtwebengine-5.11.1-eglGetProcAddress-fallback-lookup.patch dev-qt/qtwebengine/files/qtwebengine-5.11.1-nouveau-disable-gpu.patch dev-qt/qtwebengine/qtwebengine-5.11.1.ebuild X-VCS-Directories: dev-qt/qtwebengine/files/ dev-qt/qtwebengine/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: 938edc9a6b2179e4aabcf5ab340ebd64d90a77d1 X-VCS-Branch: master Date: Wed, 20 Jun 2018 15:29:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 5ae86c1b-40c5-4f6c-a391-1f4c89fed2f9 X-Archives-Hash: 068c45a9ccbed4ca1bfc81afdbef6db6 commit: 938edc9a6b2179e4aabcf5ab340ebd64d90a77d1 Author: Andreas Sturmlechner gentoo org> AuthorDate: Mon Jun 18 21:05:49 2018 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Wed Jun 20 14:30:49 2018 +0000 URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=938edc9a dev-qt/qtwebengine: Disable GPU when using nouveau One upstream backport, the other one kindly borrowed from opensuse (disable-gpu-when-using-nouveau-boo-1005323.diff). Bug: https://bugs.gentoo.org/609752 Package-Manager: Portage-2.3.40, Repoman-2.3.9 ...-5.11.1-eglGetProcAddress-fallback-lookup.patch | 68 +++++++++++++++ .../qtwebengine-5.11.1-nouveau-disable-gpu.patch | 98 ++++++++++++++++++++++ dev-qt/qtwebengine/qtwebengine-5.11.1.ebuild | 2 + 3 files changed, 168 insertions(+) diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.11.1-eglGetProcAddress-fallback-lookup.patch b/dev-qt/qtwebengine/files/qtwebengine-5.11.1-eglGetProcAddress-fallback-lookup.patch new file mode 100644 index 00000000..4b2676fa --- /dev/null +++ b/dev-qt/qtwebengine/files/qtwebengine-5.11.1-eglGetProcAddress-fallback-lookup.patch @@ -0,0 +1,68 @@ +From a66d4cd82972996d76edff52d17464c150dec6a6 Mon Sep 17 00:00:00 2001 +From: Samuli Piippo +Date: Mon, 11 Jun 2018 16:16:55 +0300 +Subject: Add fallback lookup for eglGetProcAddress + +Use the GLContext to find address for eglGetProcAddress symbol, if it's +not found with dlopen. + +Change-Id: I3f5330c21ecc9b66e5e376d50d3fc6965b227f85 +Reviewed-by: Michal Klocek +--- + src/core/gl_context_qt.cpp | 11 +++++++++++ + src/core/gl_context_qt.h | 1 + + src/core/gl_surface_qt.cpp | 4 ++++ + 3 files changed, 16 insertions(+) + +diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp +index 9ed1db8b..95491709 100644 +--- a/src/core/gl_context_qt.cpp ++++ b/src/core/gl_context_qt.cpp +@@ -155,6 +155,17 @@ QFunctionPointer GLContextHelper::getGlXGetProcAddress() + return get_proc_address; + } + ++QFunctionPointer GLContextHelper::getEglGetProcAddress() ++{ ++ QFunctionPointer get_proc_address = nullptr; ++#ifndef QT_NO_OPENGL ++ if (QOpenGLContext *context = qt_gl_global_share_context()) { ++ get_proc_address = context->getProcAddress("eglGetProcAddress"); ++ } ++#endif ++ return get_proc_address; ++} ++ + QT_END_NAMESPACE + + #if defined(USE_OZONE) || defined(OS_WIN) +diff --git a/src/core/gl_context_qt.h b/src/core/gl_context_qt.h +index 8ffdad58..cecceabc 100644 +--- a/src/core/gl_context_qt.h ++++ b/src/core/gl_context_qt.h +@@ -63,6 +63,7 @@ public: + static void* getXDisplay(); + static void* getNativeDisplay(); + static QFunctionPointer getGlXGetProcAddress(); ++ static QFunctionPointer getEglGetProcAddress(); + private: + Q_INVOKABLE bool initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface, gl::GLContextAttribs attribs); + +diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp +index 7e579246..4d38d7c2 100644 +--- a/src/core/gl_surface_qt.cpp ++++ b/src/core/gl_surface_qt.cpp +@@ -227,6 +227,10 @@ bool InitializeStaticGLBindings(GLImplementation implementation) { + base::GetFunctionPointerFromNativeLibrary(library, + "eglGetProcAddress")); + if (!get_proc_address) { ++ QFunctionPointer address = GLContextHelper::getEglGetProcAddress(); ++ get_proc_address = reinterpret_cast(address); ++ } ++ if (!get_proc_address) { + LOG(ERROR) << "eglGetProcAddress not found."; + base::UnloadNativeLibrary(library); + return false; +-- +cgit v1.1-6-g87c4 + diff --git a/dev-qt/qtwebengine/files/qtwebengine-5.11.1-nouveau-disable-gpu.patch b/dev-qt/qtwebengine/files/qtwebengine-5.11.1-nouveau-disable-gpu.patch new file mode 100644 index 00000000..aaf3aae4 --- /dev/null +++ b/dev-qt/qtwebengine/files/qtwebengine-5.11.1-nouveau-disable-gpu.patch @@ -0,0 +1,98 @@ +From: Antonio Larrosa +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.11.0/src/core/web_engine_context.cpp +=================================================================== +--- qtwebengine-everywhere-src-5.11.0.orig/src/core/web_engine_context.cpp ++++ qtwebengine-everywhere-src-5.11.0/src/core/web_engine_context.cpp +@@ -100,6 +100,7 @@ + #include + #ifndef QT_NO_OPENGL + # include ++# include + #endif + #include + #include +@@ -178,6 +179,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 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; ++} ++#endif ++ + } // namespace + + namespace QtWebEngineCore { +@@ -414,6 +448,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() +@@ -424,7 +479,7 @@ WebEngineContext::WebEngineContext() + || enableWebGLSoftwareRendering + #endif + ) +- && !usingQtQuick2DRenderer(); ++ && !usingQtQuick2DRenderer() && !disableGpu; + + if (tryGL) { + if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) { diff --git a/dev-qt/qtwebengine/qtwebengine-5.11.1.ebuild b/dev-qt/qtwebengine/qtwebengine-5.11.1.ebuild index 9c54aa9e..05007972 100644 --- a/dev-qt/qtwebengine/qtwebengine-5.11.1.ebuild +++ b/dev-qt/qtwebengine/qtwebengine-5.11.1.ebuild @@ -82,6 +82,8 @@ DEPEND="${RDEPEND} PATCHES+=( "${FILESDIR}/${P}-libxml2-disable-catalogs.patch" # bug 653078 "${FILESDIR}/${P}-ffmpeg4.patch" + "${FILESDIR}/${P}-eglGetProcAddress-fallback-lookup.patch" # 5.11 branch + "${FILESDIR}/${P}-nouveau-disable-gpu.patch" # bug 609752 ) src_prepare() {