From fbd68930cdd5d1a29b19de5dd592ee495f920ffb6dd173bd075b357418a495b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 15 Nov 2024 15:00:16 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main libnvidia-egl-wayland revision a87a4a279b7e2c25c0f986a80ed1f4f4 --- ...ayland-enable-CI-with-github-actions.patch | 108 ++++++++++++++++++ ...x-use-after-free-in-library-teardown.patch | 30 +++++ ...le-failure-to-acquire-image-in-wlEgl.patch | 40 +++++++ libnvidia-egl-wayland.changes | 8 ++ libnvidia-egl-wayland.spec | 3 + 5 files changed, 189 insertions(+) create mode 100644 0001-egl-wayland-enable-CI-with-github-actions.patch create mode 100644 0002-egl-wayland-Fix-use-after-free-in-library-teardown.patch create mode 100644 0003-egl-wayland-Handle-failure-to-acquire-image-in-wlEgl.patch diff --git a/0001-egl-wayland-enable-CI-with-github-actions.patch b/0001-egl-wayland-enable-CI-with-github-actions.patch new file mode 100644 index 0000000..800ce9a --- /dev/null +++ b/0001-egl-wayland-enable-CI-with-github-actions.patch @@ -0,0 +1,108 @@ +From 40e835f197178e7e4387a042acc8f1dc42f810ee Mon Sep 17 00:00:00 2001 +From: Austin Shafer +Date: Wed, 9 Oct 2024 14:53:52 -0400 +Subject: [PATCH 1/3] egl-wayland: enable CI with github actions + +This enables CI for github actions builds, aimed for helping verify +new pull requests. This adds tests for the meson and autotools builds +on ubuntu 24.04. Other distros are apparently not supported by default +so we aren't able to expand testing this way. +--- + .github/workflows/arch-build.yml | 16 ++++++++++++++++ + .github/workflows/autoconf-build.yml | 14 ++++++++++++++ + .github/workflows/meson-build.yml | 14 ++++++++++++++ + .github/workflows/meson-llvm-build.yml | 17 +++++++++++++++++ + 4 files changed, 61 insertions(+) + create mode 100644 .github/workflows/arch-build.yml + create mode 100644 .github/workflows/autoconf-build.yml + create mode 100644 .github/workflows/meson-build.yml + create mode 100644 .github/workflows/meson-llvm-build.yml + +diff --git a/.github/workflows/arch-build.yml b/.github/workflows/arch-build.yml +new file mode 100644 +index 0000000..3f56616 +--- /dev/null ++++ b/.github/workflows/arch-build.yml +@@ -0,0 +1,16 @@ ++name: Arch Build ++on: [push, pull_request] ++jobs: ++ Meson-Build: ++ runs-on: ubuntu-24.04 ++ container: ++ image: archlinux:latest ++ steps: ++ - uses: actions/checkout@v4 ++ - run: pacman --noconfirm -Syy ++ - run: pacman --noconfirm -S wayland-protocols libdrm libglvnd pkgconf ++ - run: pacman --noconfirm -S wayland eglexternalplatform ++ - run: pacman --noconfirm -S meson ninja gcc ++ - run: meson build ++ - run: ninja -C build ++ - run: ninja -C build install +diff --git a/.github/workflows/autoconf-build.yml b/.github/workflows/autoconf-build.yml +new file mode 100644 +index 0000000..c52ed92 +--- /dev/null ++++ b/.github/workflows/autoconf-build.yml +@@ -0,0 +1,14 @@ ++name: Autotools GCC Build ++on: [push, pull_request] ++jobs: ++ Meson-Build: ++ runs-on: ubuntu-24.04 ++ steps: ++ - uses: actions/checkout@v4 ++ - run: sudo apt update ++ - run: sudo apt install -y wayland-protocols libdrm-dev libegl-dev ++ - run: sudo apt install -y libwayland-dev libwayland-egl-backend-dev eglexternalplatform-dev ++ - run: sudo apt install -y meson ninja-build gcc ++ - run: ./autogen.sh ++ - run: make ++ - run: sudo make install +diff --git a/.github/workflows/meson-build.yml b/.github/workflows/meson-build.yml +new file mode 100644 +index 0000000..ca070d6 +--- /dev/null ++++ b/.github/workflows/meson-build.yml +@@ -0,0 +1,14 @@ ++name: Meson GCC Build ++on: [push, pull_request] ++jobs: ++ Meson-Build: ++ runs-on: ubuntu-24.04 ++ steps: ++ - uses: actions/checkout@v4 ++ - run: sudo apt update ++ - run: sudo apt install -y wayland-protocols libdrm-dev libegl-dev ++ - run: sudo apt install -y libwayland-dev libwayland-egl-backend-dev eglexternalplatform-dev ++ - run: sudo apt install -y meson ninja-build gcc ++ - run: meson build ++ - run: ninja -C build ++ - run: sudo ninja -C build install +diff --git a/.github/workflows/meson-llvm-build.yml b/.github/workflows/meson-llvm-build.yml +new file mode 100644 +index 0000000..83a8dbe +--- /dev/null ++++ b/.github/workflows/meson-llvm-build.yml +@@ -0,0 +1,17 @@ ++name: Meson LLVM Build ++on: [push, pull_request] ++jobs: ++ Meson-Build: ++ runs-on: ubuntu-24.04 ++ steps: ++ - uses: actions/checkout@v4 ++ - run: sudo apt update ++ - run: sudo apt install -y wayland-protocols libdrm-dev libegl-dev ++ - run: sudo apt install -y libwayland-dev libwayland-egl-backend-dev eglexternalplatform-dev ++ - run: sudo apt install -y meson ninja-build clang ++ - name: meson build ++ run: meson build ++ env: ++ CC: clang ++ - run: ninja -C build ++ - run: sudo ninja -C build install +-- +2.43.0 + diff --git a/0002-egl-wayland-Fix-use-after-free-in-library-teardown.patch b/0002-egl-wayland-Fix-use-after-free-in-library-teardown.patch new file mode 100644 index 0000000..61ebb56 --- /dev/null +++ b/0002-egl-wayland-Fix-use-after-free-in-library-teardown.patch @@ -0,0 +1,30 @@ +From 0cd471dcfd46e6cb8b71eceddb20cc02eadabf61 Mon Sep 17 00:00:00 2001 +From: Robin Ebert +Date: Tue, 15 Oct 2024 16:26:05 +0200 +Subject: [PATCH 2/3] egl-wayland: Fix use after free in library teardown + +--- + src/wayland-egldisplay.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c +index 7089271..edd79c4 100644 +--- a/src/wayland-egldisplay.c ++++ b/src/wayland-egldisplay.c +@@ -729,10 +729,10 @@ static EGLBoolean terminateDisplay(WlEglDisplay *display, EGLBoolean globalTeard + * destroy the display connection itself */ + wlEglDestroyAllSurfaces(display); + +- wlEglDestroyFormatSet(&display->formatSet); +- wlEglDestroyFeedback(&display->defaultFeedback); +- + if (!globalTeardown || display->ownNativeDpy) { ++ wlEglDestroyFormatSet(&display->formatSet); ++ wlEglDestroyFeedback(&display->defaultFeedback); ++ + if (display->wlRegistry) { + wl_registry_destroy(display->wlRegistry); + display->wlRegistry = NULL; +-- +2.43.0 + diff --git a/0003-egl-wayland-Handle-failure-to-acquire-image-in-wlEgl.patch b/0003-egl-wayland-Handle-failure-to-acquire-image-in-wlEgl.patch new file mode 100644 index 0000000..cb0e1ec --- /dev/null +++ b/0003-egl-wayland-Handle-failure-to-acquire-image-in-wlEgl.patch @@ -0,0 +1,40 @@ +From 218f67846472c9310355210ee9a7e1fabed95062 Mon Sep 17 00:00:00 2001 +From: shiningdracon +Date: Sun, 8 Sep 2024 19:34:26 -0700 +Subject: [PATCH 3/3] egl-wayland: Handle failure to acquire image in + wlEglSendDamageEvent + +The image parameter of send_explicit_sync_points is assumed not to be +null, however this is a case the rest of the code handles. This causes +sporadic problems on KDE when running overnight as the image will not +be valid at some point, causing us to crash. + +Fixes #143 +--- + src/wayland-eglsurface.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c +index 4e4dcff..ae6cafc 100644 +--- a/src/wayland-eglsurface.c ++++ b/src/wayland-eglsurface.c +@@ -265,11 +265,13 @@ wlEglSendDamageEvent(WlEglSurface *surface, + } + + image = pop_acquired_image(surface); +- if (image) { +- surface->ctx.currentBuffer = image->buffer; +- image->attached = EGL_TRUE; ++ if (!image) { ++ return EGL_FALSE; + } + ++ surface->ctx.currentBuffer = image->buffer; ++ image->attached = EGL_TRUE; ++ + /* + * Send our explicit sync acquire and release points. This needs to be done + * as part of the surface attach as it is a protocol error to specify these +-- +2.43.0 + diff --git a/libnvidia-egl-wayland.changes b/libnvidia-egl-wayland.changes index 9d5bd08..895d879 100644 --- a/libnvidia-egl-wayland.changes +++ b/libnvidia-egl-wayland.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Nov 6 15:53:40 UTC 2024 - Stefan Dirsch + +- 0001-egl-wayland-enable-CI-with-github-actions.patch + 0002-egl-wayland-Fix-use-after-free-in-library-teardown.patch + 0003-egl-wayland-Handle-failure-to-acquire-image-in-wlEgl.patch + * apply latest fixes from git (jsc#PED-11284) + ------------------------------------------------------------------- Mon Oct 7 13:40:16 UTC 2024 - Stefan Dirsch diff --git a/libnvidia-egl-wayland.spec b/libnvidia-egl-wayland.spec index e14b34f..05ecaea 100644 --- a/libnvidia-egl-wayland.spec +++ b/libnvidia-egl-wayland.spec @@ -37,6 +37,9 @@ Patch6: 0006-egl-wayland-Accept-device-name-from-either-wl_drm-or.patch Patch7: 0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch Patch8: 0008-Add-ICD-json-file.patch Patch9: 0009-egl-wayland-Fix-roundtrip-eating-wl_drm-events-in-ge.patch +Patch11: 0001-egl-wayland-enable-CI-with-github-actions.patch +Patch12: 0002-egl-wayland-Fix-use-after-free-in-library-teardown.patch +Patch13: 0003-egl-wayland-Handle-failure-to-acquire-image-in-wlEgl.patch BuildRequires: gcc-c++ BuildRequires: meson >= 0.50 BuildRequires: ninja