From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtgui/files/, dev-qt/qtgui/
Date: Thu, 22 Feb 2018 20:09:22 +0000 (UTC) [thread overview]
Message-ID: <1519330122.037aded72a13031ce659eaaf6a40c43d2e5e3380.asturm@gentoo> (raw)
commit: 037aded72a13031ce659eaaf6a40c43d2e5e3380
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 22 09:37:12 2018 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Feb 22 20:08:42 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=037aded7
dev-qt/qtgui: Bail if cached shader fails to load
Qt-Bug: https://bugreports.qt.io/browse/QTBUG-66420
See also: https://codereview.qt-project.org/#/c/221098
Package-Manager: Portage-2.3.24, Repoman-2.3.6
dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch | 87 ++++++++++++++
dev-qt/qtgui/qtgui-5.9.4-r3.ebuild | 175 ++++++++++++++++++++++++++++
2 files changed, 262 insertions(+)
diff --git a/dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch b/dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch
new file mode 100644
index 00000000000..2a447414c21
--- /dev/null
+++ b/dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch
@@ -0,0 +1,87 @@
+From b63aeba4a88088c7de61c1664a510c02d38ade84 Mon Sep 17 00:00:00 2001
+From: Antonio Larrosa <alarrosa@suse.com>
+Date: Fri, 16 Feb 2018 13:18:42 +0100
+Subject: [PATCH] opengl: Bail if cached shader fails to load
+
+QOpenGLProgramBinaryCache::setProgramBinary() should check
+GL_LINK_STATUS after glProgramBinary(), but doesn't.
+
+In practice, this means that SDDM is a white screen, and KDE is just
+a gray task bar.
+
+So far, Qt tries to check this using its internal ::link() function.
+But in case the cached binary fails to load, Qt currently attempts to
+link the inexistent program, resulting in a zero-length, fixed
+pipeline shader.
+
+Checking this already in ::setProgramBinary() makes the call to
+::link() superfluous, so we remove that as well.
+
+Done-with: Max Staudt <mstaudt@suse.com>
+Done-with: Michal Srb <msrb@suse.com>
+Done-with: Fabian Vogt <fvogt@suse.de>
+Task-number: QTBUG-66420
+Change-Id: Iabb51d0eb2c0c16bde696efff623e57d15f28d82
+Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
+Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
+(cherry picked from commit fa091640134b3ff99a9eb92df8286d15203122bf)
+---
+ src/gui/opengl/qopenglprogrambinarycache.cpp | 20 ++++++++++++++++++--
+ src/gui/opengl/qopenglshaderprogram.cpp | 8 +-------
+ 2 files changed, 19 insertions(+), 9 deletions(-)
+
+diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp
+index 06373e1..d16173d 100644
+--- a/src/gui/opengl/qopenglprogrambinarycache.cpp
++++ b/src/gui/opengl/qopenglprogrambinarycache.cpp
+@@ -161,10 +161,26 @@ bool QOpenGLProgramBinaryCache::setProgramBinary(uint programId, uint blobFormat
+ QOpenGLExtraFunctions *funcs = QOpenGLContext::currentContext()->extraFunctions();
+ while (funcs->glGetError() != GL_NO_ERROR) { }
+ funcs->glProgramBinary(programId, blobFormat, p, blobSize);
+- int err = funcs->glGetError();
++
++ GLenum err = funcs->glGetError();
++ if (err != GL_NO_ERROR) {
++ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
++ "format 0x%x, err = 0x%x",
++ programId, blobSize, blobFormat, err);
++ return false;
++ }
++ GLint linkStatus = 0;
++ funcs->glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus);
++ if (linkStatus != GL_TRUE) {
++ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
++ "format 0x%x, linkStatus = 0x%x, err = 0x%x",
++ programId, blobSize, blobFormat, linkStatus, err);
++ return false;
++ }
++
+ qCDebug(DBG_SHADER_CACHE, "Program binary set for program %u, size %d, format 0x%x, err = 0x%x",
+ programId, blobSize, blobFormat, err);
+- return err == 0;
++ return true;
+ }
+
+ #ifdef Q_OS_UNIX
+diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
+index cc8af16..3b82bac 100644
+--- a/src/gui/opengl/qopenglshaderprogram.cpp
++++ b/src/gui/opengl/qopenglshaderprogram.cpp
+@@ -3824,13 +3824,7 @@ bool QOpenGLShaderProgramPrivate::linkBinary()
+ bool needsCompile = true;
+ if (binCache.load(cacheKey, q->programId())) {
+ qCDebug(DBG_SHADER_CACHE, "Program binary received from cache");
+- linkBinaryRecursion = true;
+- bool ok = q->link();
+- linkBinaryRecursion = false;
+- if (ok)
+- needsCompile = false;
+- else
+- qCDebug(DBG_SHADER_CACHE, "Link failed after glProgramBinary");
++ needsCompile = false;
+ }
+
+ bool needsSave = false;
+--
+2.7.4
+
diff --git a/dev-qt/qtgui/qtgui-5.9.4-r3.ebuild b/dev-qt/qtgui/qtgui-5.9.4-r3.ebuild
new file mode 100644
index 00000000000..91c5ac088c3
--- /dev/null
+++ b/dev-qt/qtgui/qtgui-5.9.4-r3.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+QT5_MODULE="qtbase"
+inherit qt5-build
+
+DESCRIPTION="The GUI module and platform plugins for the Qt5 framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
+fi
+
+# TODO: linuxfb
+
+IUSE="accessibility dbus egl eglfs evdev +gif gles2 ibus
+ jpeg +libinput +png tslib tuio +udev vnc +xcb"
+REQUIRED_USE="
+ || ( eglfs xcb )
+ accessibility? ( dbus xcb )
+ eglfs? ( egl )
+ ibus? ( dbus )
+ libinput? ( udev )
+ xcb? ( gles2? ( egl ) )
+"
+
+RDEPEND="
+ dev-libs/glib:2
+ ~dev-qt/qtcore-${PV}
+ media-libs/fontconfig
+ >=media-libs/freetype-2.6.1:2
+ >=media-libs/harfbuzz-1.0.6:=
+ >=sys-libs/zlib-1.2.5
+ virtual/opengl
+ dbus? ( ~dev-qt/qtdbus-${PV} )
+ egl? ( media-libs/mesa[egl] )
+ eglfs? (
+ media-libs/mesa[gbm]
+ x11-libs/libdrm
+ )
+ evdev? ( sys-libs/mtdev )
+ gles2? ( media-libs/mesa[gles2] )
+ jpeg? ( virtual/jpeg:0 )
+ libinput? (
+ dev-libs/libinput:=
+ x11-libs/libxkbcommon
+ )
+ png? ( media-libs/libpng:0= )
+ tslib? ( x11-libs/tslib )
+ tuio? ( ~dev-qt/qtnetwork-${PV} )
+ udev? ( virtual/libudev:= )
+ vnc? ( ~dev-qt/qtnetwork-${PV} )
+ xcb? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libX11
+ >=x11-libs/libXi-1.7.5
+ >=x11-libs/libxcb-1.10:=[xkb]
+ >=x11-libs/libxkbcommon-0.4.1[X]
+ x11-libs/xcb-util-image
+ x11-libs/xcb-util-keysyms
+ x11-libs/xcb-util-renderutil
+ x11-libs/xcb-util-wm
+ )
+"
+DEPEND="${RDEPEND}
+ evdev? ( sys-kernel/linux-headers )
+ udev? ( sys-kernel/linux-headers )
+"
+PDEPEND="
+ ibus? ( app-i18n/ibus )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-qsimpledrag.patch" # QTBUG-66103
+ "${FILESDIR}/${P}-libinput-pixeldelta.patch" # QTBUG-59261
+ "${FILESDIR}/${P}-opengl.patch" # QTBUG-66420
+)
+
+QT5_TARGET_SUBDIRS=(
+ src/gui
+ src/openglextensions
+ src/platformheaders
+ src/platformsupport
+ src/plugins/generic
+ src/plugins/imageformats
+ src/plugins/platforms
+ src/plugins/platforminputcontexts
+)
+
+QT5_GENTOO_CONFIG=(
+ accessibility:accessibility-atspi-bridge
+ egl
+ eglfs
+ eglfs:eglfs_egldevice:
+ eglfs:eglfs_gbm:
+ evdev
+ evdev:mtdev:
+ :fontconfig
+ :system-freetype:FREETYPE
+ !:no-freetype:
+ !gif:no-gif:
+ gles2::OPENGL_ES
+ gles2:opengles2:OPENGL_ES_2
+ !:no-gui:
+ :system-harfbuzz:HARFBUZZ
+ !:no-harfbuzz:
+ jpeg:system-jpeg:IMAGEFORMAT_JPEG
+ !jpeg:no-jpeg:
+ libinput
+ libinput:xkbcommon-evdev:
+ :opengl
+ png:png:
+ png:system-png:IMAGEFORMAT_PNG
+ !png:no-png:
+ tslib
+ udev:libudev:
+ xcb:xcb:
+ xcb:xcb-glx:
+ xcb:xcb-plugin:
+ xcb:xcb-render:
+ xcb:xcb-sm:
+ xcb:xcb-xlib:
+ xcb:xinput2:
+ xcb::XKB
+)
+
+QT5_GENTOO_PRIVATE_CONFIG=(
+ :gui
+)
+
+src_prepare() {
+ # egl_x11 is activated when both egl and xcb are enabled
+ use egl && QT5_GENTOO_CONFIG+=(xcb:egl_x11) || QT5_GENTOO_CONFIG+=(egl:egl_x11)
+
+ qt_use_disable_config dbus dbus \
+ src/platformsupport/themes/genericunix/genericunix.pri
+
+ qt_use_disable_config tuio udpsocket src/plugins/generic/generic.pro
+
+ qt_use_disable_mod ibus dbus \
+ src/plugins/platforminputcontexts/platforminputcontexts.pro
+
+ use vnc || sed -i -e '/SUBDIRS += vnc/d' \
+ src/plugins/platforms/platforms.pro || die
+
+ qt5-build_src_prepare
+}
+
+src_configure() {
+ local myconf=(
+ $(usex dbus -dbus-linked '')
+ $(qt_use egl)
+ $(qt_use eglfs)
+ $(usex eglfs '-gbm -kms' '')
+ $(qt_use evdev)
+ $(qt_use evdev mtdev)
+ -fontconfig
+ -system-freetype
+ $(usex gif '' -no-gif)
+ -gui
+ -system-harfbuzz
+ $(qt_use jpeg libjpeg system)
+ $(qt_use libinput)
+ $(qt_use libinput xkbcommon-evdev)
+ -opengl $(usex gles2 es2 desktop)
+ $(qt_use png libpng system)
+ $(qt_use tslib)
+ $(qt_use udev libudev)
+ $(qt_use xcb xcb system)
+ $(qt_use xcb xkbcommon-x11 system)
+ $(usex xcb '-xcb-xlib -xinput2 -xkb' '')
+ )
+ qt5-build_src_configure
+}
next reply other threads:[~2018-02-22 20:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 20:09 Andreas Sturmlechner [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-02-15 15:25 [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtgui/files/, dev-qt/qtgui/ Andreas Sturmlechner
2023-10-24 10:26 Andreas Sturmlechner
2023-10-09 23:03 Ionen Wolkens
2022-12-10 12:25 Andreas Sturmlechner
2022-08-15 14:10 Andreas Sturmlechner
2021-01-02 1:23 Andreas Sturmlechner
2020-10-04 16:07 Andreas Sturmlechner
2020-08-22 18:52 Andreas Sturmlechner
2019-03-02 4:44 Mike Gilbert
2018-10-30 17:46 Andreas Sturmlechner
2018-02-08 0:10 Andreas Sturmlechner
2017-06-10 6:01 Andreas Sturmlechner
2016-02-14 16:29 Michael Palimaka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1519330122.037aded72a13031ce659eaaf6a40c43d2e5e3380.asturm@gentoo \
--to=asturm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox