Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: gui-libs/egl-wayland/files/, gui-libs/egl-wayland/
Date: Tue, 28 Jun 2022 17:27:52
Message-Id: 1656437146.37e44543dc58bb084aa4519214c39775151cc848.ionen@gentoo
1 commit: 37e44543dc58bb084aa4519214c39775151cc848
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 28 15:57:08 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 28 17:25:46 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37e44543
7
8 gui-libs/egl-wayland: revbump with a reverted commit
9
10 Unsure if 100% proper given doesn't revert cleanly, but choices are
11 either stick with 1.1.9 with broken vulkan, use 1.1.10 with broken
12 resizing, or try this.
13
14 Keeping -r0 for now in case testing is needed.
15
16 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
17
18 gui-libs/egl-wayland/egl-wayland-1.1.10-r1.ebuild | 44 ++++++++++
19 .../egl-wayland-1.1.10-revert-defer-resizes.patch | 96 ++++++++++++++++++++++
20 2 files changed, 140 insertions(+)
21
22 diff --git a/gui-libs/egl-wayland/egl-wayland-1.1.10-r1.ebuild b/gui-libs/egl-wayland/egl-wayland-1.1.10-r1.ebuild
23 new file mode 100644
24 index 000000000000..d3d107c293bf
25 --- /dev/null
26 +++ b/gui-libs/egl-wayland/egl-wayland-1.1.10-r1.ebuild
27 @@ -0,0 +1,44 @@
28 +# Copyright 1999-2022 Gentoo Authors
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +EAPI=8
32 +
33 +inherit meson
34 +
35 +DESCRIPTION="EGLStream-based Wayland external platform"
36 +HOMEPAGE="https://github.com/NVIDIA/egl-wayland"
37 +SRC_URI="https://github.com/NVIDIA/egl-wayland/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
38 +
39 +LICENSE="MIT"
40 +SLOT="0"
41 +KEYWORDS="~amd64 ~arm64"
42 +
43 +RDEPEND="
44 + dev-libs/wayland
45 + !<x11-drivers/nvidia-drivers-470.57.02[wayland(-)]"
46 +DEPEND="
47 + ${RDEPEND}
48 + dev-libs/wayland-protocols
49 + gui-libs/eglexternalplatform
50 + >=media-libs/libglvnd-1.3.4
51 + x11-libs/libdrm"
52 +BDEPEND="dev-util/wayland-scanner"
53 +
54 +PATCHES=(
55 + "${FILESDIR}"/${PN}-1.1.6-remove-werror.patch
56 + "${FILESDIR}"/${P}-revert-defer-resizes.patch
57 +)
58 +
59 +src_install() {
60 + meson_src_install
61 +
62 + insinto /usr/share/egl/egl_external_platform.d
63 + doins "${FILESDIR}"/10_nvidia_wayland.json
64 +}
65 +
66 +pkg_postinst() {
67 + if has_version "<x11-drivers/nvidia-drivers-391"; then
68 + ewarn "<=nvidia-drivers-390.xx may not work properly with this version of"
69 + ewarn "egl-wayland, it is recommended to use nouveau drivers for wayland."
70 + fi
71 +}
72
73 diff --git a/gui-libs/egl-wayland/files/egl-wayland-1.1.10-revert-defer-resizes.patch b/gui-libs/egl-wayland/files/egl-wayland-1.1.10-revert-defer-resizes.patch
74 new file mode 100644
75 index 000000000000..bb54ad8d1a0c
76 --- /dev/null
77 +++ b/gui-libs/egl-wayland/files/egl-wayland-1.1.10-revert-defer-resizes.patch
78 @@ -0,0 +1,96 @@
79 +1.1.10 is needed for >=515.57 for working vulkan on wayland but
80 +carries a major regression that can make applications half-displayed
81 +and unusable after a resize.
82 +
83 +Official drivers seem to do something similar, they ship a modified
84 +1.1.9 with vulkan fixes rather than 1.1.10.
85 +
86 +https://github.com/NVIDIA/egl-wayland/issues/57
87 +Revert of https://github.com/NVIDIA/egl-wayland/commit/ddaa272
88 +--- a/src/wayland-eglsurface.c
89 ++++ b/src/wayland-eglsurface.c
90 +@@ -1612,17 +1612,30 @@
91 + }
92 +
93 +-void
94 +-wlEglResizeSurfaceIfRequired(WlEglDisplay *display, WlEglPlatformData *pData, WlEglSurface *surface)
95 ++static void
96 ++resize_callback(struct wl_egl_window *window, void *data)
97 + {
98 ++ WlEglDisplay *display = NULL;
99 ++ WlEglPlatformData *pData = NULL;
100 ++ WlEglSurface *surface = (WlEglSurface *)data;
101 + EGLint err = EGL_SUCCESS;
102 +
103 +- if (!surface) {
104 ++ if (!window || !surface) {
105 ++ return;
106 ++ }
107 ++
108 ++ display = surface->wlEglDpy;
109 ++ if (!wlEglIsWaylandDisplay(display->nativeDpy) ||
110 ++ !wlEglIsWaylandWindowValid(surface->wlEglWin)) {
111 + return;
112 + }
113 ++ pData = display->data;
114 +
115 + pthread_mutex_lock(&surface->mutexLock);
116 +
117 + /* Resize stream only if window geometry has changed */
118 +- if (surface->isResized) {
119 ++ if ((surface->width != window->width) ||
120 ++ (surface->height != window->height) ||
121 ++ (surface->dx != window->dx) ||
122 ++ (surface->dy != window->dy)) {
123 + // If a damage thread is in use, wait for it to finish processing all
124 + // pending frames
125 +@@ -1630,5 +1643,4 @@
126 +
127 + discard_surface_context(surface);
128 +- surface->isResized = EGL_FALSE;
129 + surface->ctx.wlStreamResource = NULL;
130 + surface->ctx.isAttached = EGL_FALSE;
131 +@@ -1655,34 +1667,4 @@
132 + pthread_mutex_unlock(&surface->mutexLock);
133 + }
134 +-
135 +-static void
136 +-resize_callback(struct wl_egl_window *window, void *data)
137 +-{
138 +- WlEglDisplay *display = NULL;
139 +- WlEglSurface *surface = (WlEglSurface *)data;
140 +-
141 +- if (!window || !surface) {
142 +- return;
143 +- }
144 +-
145 +- display = surface->wlEglDpy;
146 +- if (!wlEglIsWaylandDisplay(display->nativeDpy) ||
147 +- !wlEglIsWaylandWindowValid(surface->wlEglWin)) {
148 +- return;
149 +- }
150 +-
151 +- pthread_mutex_lock(&surface->mutexLock);
152 +-
153 +- /* Resize stream only if window geometry has changed */
154 +- if ((surface->width != window->width) ||
155 +- (surface->height != window->height) ||
156 +- (surface->dx != window->dx) ||
157 +- (surface->dy != window->dy)) {
158 +- surface->isResized = EGL_TRUE;
159 +- wl_surface_commit(surface->wlSurface);
160 +- }
161 +-
162 +- pthread_mutex_unlock(&surface->mutexLock);
163 +-}
164 +
165 + static EGLBoolean validateSurfaceAttrib(EGLAttrib attrib, EGLAttrib value)
166 +--- a/src/wayland-eglswap.c
167 ++++ b/src/wayland-eglswap.c
168 +@@ -65,6 +65,4 @@
169 + surface = eglSurface;
170 +
171 +- wlEglResizeSurfaceIfRequired(display, data, surface);
172 +-
173 + if (surface->pendingSwapIntervalUpdate == EGL_TRUE) {
174 + /* Send request from client to override swapinterval value based on