diff --git a/.gitignore b/.gitignore index ce45fdf..afeb57f 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /egl-wayland-247335d.tar.gz /egl-wayland-1.1.10.tar.gz /egl-wayland-d0febee.tar.gz +/egl-wayland-53b6a87.tar.gz diff --git a/egl-wayland-1.1.10-revert-defer-resizes.patch b/egl-wayland-1.1.10-revert-defer-resizes.patch new file mode 100644 index 0000000..bb54ad8 --- /dev/null +++ b/egl-wayland-1.1.10-revert-defer-resizes.patch @@ -0,0 +1,96 @@ +1.1.10 is needed for >=515.57 for working vulkan on wayland but +carries a major regression that can make applications half-displayed +and unusable after a resize. + +Official drivers seem to do something similar, they ship a modified +1.1.9 with vulkan fixes rather than 1.1.10. + +https://github.com/NVIDIA/egl-wayland/issues/57 +Revert of https://github.com/NVIDIA/egl-wayland/commit/ddaa272 +--- a/src/wayland-eglsurface.c ++++ b/src/wayland-eglsurface.c +@@ -1612,17 +1612,30 @@ + } + +-void +-wlEglResizeSurfaceIfRequired(WlEglDisplay *display, WlEglPlatformData *pData, WlEglSurface *surface) ++static void ++resize_callback(struct wl_egl_window *window, void *data) + { ++ WlEglDisplay *display = NULL; ++ WlEglPlatformData *pData = NULL; ++ WlEglSurface *surface = (WlEglSurface *)data; + EGLint err = EGL_SUCCESS; + +- if (!surface) { ++ if (!window || !surface) { ++ return; ++ } ++ ++ display = surface->wlEglDpy; ++ if (!wlEglIsWaylandDisplay(display->nativeDpy) || ++ !wlEglIsWaylandWindowValid(surface->wlEglWin)) { + return; + } ++ pData = display->data; + + pthread_mutex_lock(&surface->mutexLock); + + /* Resize stream only if window geometry has changed */ +- if (surface->isResized) { ++ if ((surface->width != window->width) || ++ (surface->height != window->height) || ++ (surface->dx != window->dx) || ++ (surface->dy != window->dy)) { + // If a damage thread is in use, wait for it to finish processing all + // pending frames +@@ -1630,5 +1643,4 @@ + + discard_surface_context(surface); +- surface->isResized = EGL_FALSE; + surface->ctx.wlStreamResource = NULL; + surface->ctx.isAttached = EGL_FALSE; +@@ -1655,34 +1667,4 @@ + pthread_mutex_unlock(&surface->mutexLock); + } +- +-static void +-resize_callback(struct wl_egl_window *window, void *data) +-{ +- WlEglDisplay *display = NULL; +- WlEglSurface *surface = (WlEglSurface *)data; +- +- if (!window || !surface) { +- return; +- } +- +- display = surface->wlEglDpy; +- if (!wlEglIsWaylandDisplay(display->nativeDpy) || +- !wlEglIsWaylandWindowValid(surface->wlEglWin)) { +- return; +- } +- +- pthread_mutex_lock(&surface->mutexLock); +- +- /* Resize stream only if window geometry has changed */ +- if ((surface->width != window->width) || +- (surface->height != window->height) || +- (surface->dx != window->dx) || +- (surface->dy != window->dy)) { +- surface->isResized = EGL_TRUE; +- wl_surface_commit(surface->wlSurface); +- } +- +- pthread_mutex_unlock(&surface->mutexLock); +-} + + static EGLBoolean validateSurfaceAttrib(EGLAttrib attrib, EGLAttrib value) +--- a/src/wayland-eglswap.c ++++ b/src/wayland-eglswap.c +@@ -65,6 +65,4 @@ + surface = eglSurface; + +- wlEglResizeSurfaceIfRequired(display, data, surface); +- + if (surface->pendingSwapIntervalUpdate == EGL_TRUE) { + /* Send request from client to override swapinterval value based on diff --git a/egl-wayland.spec b/egl-wayland.spec index 0926ece..683f843 100644 --- a/egl-wayland.spec +++ b/egl-wayland.spec @@ -1,11 +1,11 @@ -%global commit0 d0febeedfd8ded6872029c83a80f7a9997ed1f49 -%global date 20220626 +%global commit0 53b6a87c27e8272d65e29393b48e5344b39f698b +%global date 20220621 %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) #global tag %{version} Name: egl-wayland Version: 1.1.10 -Release: 3%{!?tag:.%{date}git%{shortcommit0}}%{?dist} +Release: 4%{!?tag:.%{date}git%{shortcommit0}}%{?dist} Summary: Wayland EGL External Platform library License: MIT URL: https://github.com/NVIDIA/%{name} @@ -19,6 +19,8 @@ Source0: %url/archive/%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz Source1: 10_nvidia_wayland.json Source2: 15_nvidia_gbm.json +Patch0: https://gitweb.gentoo.org/repo/gentoo.git/plain/gui-libs/egl-wayland/files/egl-wayland-1.1.10-revert-defer-resizes.patch + BuildRequires: meson BuildRequires: libtool BuildRequires: eglexternalplatform-devel @@ -72,6 +74,9 @@ find %{buildroot} -name '*.la' -delete %{_datadir}/wayland-eglstream/ %changelog +* Thu Jun 30 2022 Leigh Scott - 1.1.10-4.20220621git53b6a87 +- Fix GTK4 resizing + * Wed Jun 29 2022 Leigh Scott - 1.1.10-3.20220626gitd0febee - Update to latest snapshot diff --git a/sources b/sources index 27bd592..7ba8e38 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (egl-wayland-d0febee.tar.gz) = 1bd74d427dc798553c4ccf55d329be9a12258a2d23f06fbf5fca180d135010746aa1d47543a50b388eb17e9a9b7e29075d66c1586cbef521197e71ebd510b701 +SHA512 (egl-wayland-53b6a87.tar.gz) = bace4390bf2a2493aeb4d80a5e4173a8357f55d91e0c64ee80e558ace431fcf0b56f751e4d6f0d733fbc01eb7d5f1339c472c7c4a84e1242a46e4f5914379e6a