From 205bb60fa5959e1ab37f9b9910e6c52080fd80849632e54cde0b7506e283c3e6 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Mon, 7 Oct 2024 13:46:32 +0000 Subject: [PATCH] - 0001-egl-wayland-bump-version-to-1.1.17.patch 0002-Fix-the-include-path-for-drm_fourcc.h.patch 0003-Fix-a-declaration-after-code.patch 0004-egl-swap-provide-damage-rectangles-to-wl_surface.patch 0005-Use-INT32_MAX-for-wl_surface_damage.patch 0006-egl-wayland-Accept-device-name-from-either-wl_drm-or.patch 0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch 0008-Add-ICD-json-file.patch 0009-egl-wayland-Fix-roundtrip-eating-wl_drm-events-in-ge.patch * apply latest fixes including adding ICD json file; related: https://github.com/openSUSE/nvidia-driver-G06/issues/26 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libnvidia-egl-wayland?expand=0&rev=27 --- .gitattributes | 23 +++ .gitignore | 1 + 0001-egl-wayland-bump-version-to-1.1.17.patch | 54 +++++++ ...ix-the-include-path-for-drm_fourcc.h.patch | 29 ++++ 0003-Fix-a-declaration-after-code.patch | 30 ++++ ...vide-damage-rectangles-to-wl_surface.patch | 115 ++++++++++++++ ...-Use-INT32_MAX-for-wl_surface_damage.patch | 27 ++++ ...pt-device-name-from-either-wl_drm-or.patch | 60 ++++++++ ...device-name-case-where-only-wl_drm-e.patch | 43 ++++++ 0008-Add-ICD-json-file.patch | 37 +++++ ...roundtrip-eating-wl_drm-events-in-ge.patch | 64 ++++++++ baselibs.conf | 1 + egl-wayland-1.1.13.tar.gz | 3 + egl-wayland-1.1.14.tar.gz | 3 + egl-wayland-1.1.15.tar.gz | 3 + egl-wayland-1.1.16.tar.gz | 3 + libnvidia-egl-wayland.changes | 140 ++++++++++++++++++ libnvidia-egl-wayland.spec | 117 +++++++++++++++ 18 files changed, 753 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-egl-wayland-bump-version-to-1.1.17.patch create mode 100644 0002-Fix-the-include-path-for-drm_fourcc.h.patch create mode 100644 0003-Fix-a-declaration-after-code.patch create mode 100644 0004-egl-swap-provide-damage-rectangles-to-wl_surface.patch create mode 100644 0005-Use-INT32_MAX-for-wl_surface_damage.patch create mode 100644 0006-egl-wayland-Accept-device-name-from-either-wl_drm-or.patch create mode 100644 0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch create mode 100644 0008-Add-ICD-json-file.patch create mode 100644 0009-egl-wayland-Fix-roundtrip-eating-wl_drm-events-in-ge.patch create mode 100644 baselibs.conf create mode 100644 egl-wayland-1.1.13.tar.gz create mode 100644 egl-wayland-1.1.14.tar.gz create mode 100644 egl-wayland-1.1.15.tar.gz create mode 100644 egl-wayland-1.1.16.tar.gz create mode 100644 libnvidia-egl-wayland.changes create mode 100644 libnvidia-egl-wayland.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-egl-wayland-bump-version-to-1.1.17.patch b/0001-egl-wayland-bump-version-to-1.1.17.patch new file mode 100644 index 0000000..4002ffe --- /dev/null +++ b/0001-egl-wayland-bump-version-to-1.1.17.patch @@ -0,0 +1,54 @@ +From 2d31baa7831166fd27a2fc01ecc684613046bb28 Mon Sep 17 00:00:00 2001 +From: Austin Shafer +Date: Fri, 23 Aug 2024 10:12:10 -0400 +Subject: [PATCH 1/9] egl-wayland bump version to 1.1.17 + +We are changing the release process and bumping versions immediately +after a release tag is made, that way versions installed from the +latest git master will always have the "next" version. +--- + configure.ac | 2 +- + include/wayland-external-exports.h | 2 +- + meson.build | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 75489a5..36594a9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2,7 +2,7 @@ AC_PREREQ([2.64]) + + m4_define([wayland_eglstream_major_version], [1]) + m4_define([wayland_eglstream_minor_version], [1]) +-m4_define([wayland_eglstream_micro_version], [16]) ++m4_define([wayland_eglstream_micro_version], [17]) + m4_define([wayland_eglstream_version], + [wayland_eglstream_major_version.wayland_eglstream_minor_version.wayland_eglstream_micro_version]) + +diff --git a/include/wayland-external-exports.h b/include/wayland-external-exports.h +index 43579c9..2993dea 100644 +--- a/include/wayland-external-exports.h ++++ b/include/wayland-external-exports.h +@@ -53,7 +53,7 @@ + #define WAYLAND_EXTERNAL_VERSION_MINOR 0 + #endif + +-#define WAYLAND_EXTERNAL_VERSION_MICRO 16 ++#define WAYLAND_EXTERNAL_VERSION_MICRO 17 + + + #define EGL_EXTERNAL_PLATFORM_VERSION_MAJOR WAYLAND_EXTERNAL_VERSION_MAJOR +diff --git a/meson.build b/meson.build +index 4d9bd1a..b3700fa 100644 +--- a/meson.build ++++ b/meson.build +@@ -1,5 +1,5 @@ + project('wayland-eglstream', 'c', +- version : '1.1.16', ++ version : '1.1.17', + default_options : [ + 'buildtype=debugoptimized', + 'c_std=gnu99', +-- +2.43.0 + diff --git a/0002-Fix-the-include-path-for-drm_fourcc.h.patch b/0002-Fix-the-include-path-for-drm_fourcc.h.patch new file mode 100644 index 0000000..12e04fd --- /dev/null +++ b/0002-Fix-the-include-path-for-drm_fourcc.h.patch @@ -0,0 +1,29 @@ +From 7c18d91d3605785b0d5a821b067cda5d61b2710f Mon Sep 17 00:00:00 2001 +From: Kyle Brenneman +Date: Mon, 26 Aug 2024 09:16:20 -0600 +Subject: [PATCH 2/9] Fix the include path for drm_fourcc.h. + +Remove the leading "libdrm/" when including drm_fourcc.h. + +We shouldn't hard-code a path like that -- using pkg-config should add +the appropriate include path. +--- + src/wayland-eglsurface.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c +index da08fb2..1b8ff77 100644 +--- a/src/wayland-eglsurface.c ++++ b/src/wayland-eglsurface.c +@@ -41,7 +41,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +-- +2.43.0 + diff --git a/0003-Fix-a-declaration-after-code.patch b/0003-Fix-a-declaration-after-code.patch new file mode 100644 index 0000000..c9e2707 --- /dev/null +++ b/0003-Fix-a-declaration-after-code.patch @@ -0,0 +1,30 @@ +From 80ecf7edc4659c580fcd9d752b57bf23ef7399c0 Mon Sep 17 00:00:00 2001 +From: Kyle Brenneman +Date: Mon, 26 Aug 2024 09:19:15 -0600 +Subject: [PATCH 3/9] Fix a declaration after code. + +In wayland-egldisplay.c, move a declaration to the top of the function. +Older versions of C don't allow mixing declarations and code. +--- + src/wayland-egldisplay.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c +index 4d25cd7..468b32d 100644 +--- a/src/wayland-egldisplay.c ++++ b/src/wayland-egldisplay.c +@@ -568,9 +568,10 @@ static void + dmabuf_feedback_check_done(void *data, struct zwp_linux_dmabuf_feedback_v1 *dmabuf_feedback) + { + WlServerProtocols *protocols = (WlServerProtocols *)data; ++ drmDevice *drm_device; ++ + (void) dmabuf_feedback; + +- drmDevice *drm_device; + assert(getDeviceFromDevId); + if (getDeviceFromDevId(protocols->devId, 0, &drm_device) == 0) { + if (drm_device->available_nodes & (1 << DRM_NODE_RENDER)) { +-- +2.43.0 + diff --git a/0004-egl-swap-provide-damage-rectangles-to-wl_surface.patch b/0004-egl-swap-provide-damage-rectangles-to-wl_surface.patch new file mode 100644 index 0000000..8b82448 --- /dev/null +++ b/0004-egl-swap-provide-damage-rectangles-to-wl_surface.patch @@ -0,0 +1,115 @@ +From 8dbdd61b7c07e23bc5b8913fe3d52f32995be98a Mon Sep 17 00:00:00 2001 +From: Christian Hergert +Date: Fri, 23 Aug 2024 19:10:27 +0200 +Subject: [PATCH 4/9] egl-swap: provide damage rectangles to wl_surface + +Previously, wlEglSendDamageEvent used the entire surface as damage to +the compositor but in the wrong coordinate system. wl_surface_damage() +requires coordinates for the surface which could be scaled while +wl_surface_damage_buffer() expects buffer coordinates which is what +surface->width and surface->height represent. + +This ensures that the parameters to eglSwapBuffersWithDamage() are passed +along to the compositor as well. The coordinate system is flipped between +eglSwapBuffersWithDamage() and wl_surface_damage_buffer() which is handled +as well. + +Signed-off-by: Christian Hergert +--- + include/wayland-eglsurface-internal.h | 4 +++- + src/wayland-eglsurface.c | 25 +++++++++++++++++++++---- + src/wayland-eglswap.c | 4 ++-- + 3 files changed, 26 insertions(+), 7 deletions(-) + +diff --git a/include/wayland-eglsurface-internal.h b/include/wayland-eglsurface-internal.h +index dfc5fd4..b70b9d3 100644 +--- a/include/wayland-eglsurface-internal.h ++++ b/include/wayland-eglsurface-internal.h +@@ -206,7 +206,9 @@ EGLBoolean + wlEglSurfaceCheckReleasePoints(WlEglDisplay *display, WlEglSurface *surface); + + EGLBoolean wlEglSendDamageEvent(WlEglSurface *surface, +- struct wl_event_queue *queue); ++ struct wl_event_queue *queue, ++ EGLint *rects, ++ EGLint n_rects); + + void wlEglCreateFrameSync(WlEglSurface *surface); + EGLint wlEglWaitFrameSync(WlEglSurface *surface); +diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c +index da08fb2..1f01616 100644 +--- a/src/wayland-eglsurface.c ++++ b/src/wayland-eglsurface.c +@@ -242,9 +242,13 @@ send_explicit_sync_points (WlEglDisplay *display, WlEglSurface *surface, + } + + EGLBoolean +-wlEglSendDamageEvent(WlEglSurface *surface, struct wl_event_queue *queue) ++wlEglSendDamageEvent(WlEglSurface *surface, ++ struct wl_event_queue *queue, ++ EGLint *rects, ++ EGLint n_rects) + { + struct wl_display *wlDpy = surface->wlEglDpy->nativeDpy; ++ EGLint i; + + if (surface->ctx.wlStreamResource) { + /* Attach same buffer to indicate new content for the surface is +@@ -286,8 +290,21 @@ wlEglSendDamageEvent(WlEglSurface *surface, struct wl_event_queue *queue) + surface->dy); + } + +- wl_surface_damage(surface->wlSurface, 0, 0, +- surface->width, surface->height); ++ if (n_rects > 0 && ++ (wl_proxy_get_version((struct wl_proxy *)surface->wlSurface) >= ++ WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)) { ++ for (i = 0; i < n_rects; i++) { ++ const EGLint *rect = &rects[i * 4]; ++ // Coordinate systems are flipped between eglSwapBuffersWithDamage ++ // and wl_surface_damage_buffer, so invert Y values. ++ int inv_y = surface->height - (rect[1] + rect[3]); ++ wl_surface_damage_buffer(surface->wlSurface, rect[0], inv_y, rect[2], rect[3]); ++ } ++ } else { ++ wl_surface_damage(surface->wlSurface, 0, 0, UINT32_MAX, UINT32_MAX); ++ } ++ ++ + wl_surface_commit(surface->wlSurface); + surface->ctx.isAttached = EGL_TRUE; + +@@ -357,7 +374,7 @@ damage_thread(void *args) + + wlEglCreateFrameSync(surface); + +- ok = wlEglSendDamageEvent(surface, queue); ++ ok = wlEglSendDamageEvent(surface, queue, NULL, 0); + surface->ctx.framesProcessed++; + + pthread_cond_signal(&surface->condFrameSync); +diff --git a/src/wayland-eglswap.c b/src/wayland-eglswap.c +index bf1157d..ea99f49 100644 +--- a/src/wayland-eglswap.c ++++ b/src/wayland-eglswap.c +@@ -147,7 +147,7 @@ EGLBoolean wlEglSwapBuffersWithDamageHook(EGLDisplay eglDisplay, EGLSurface eglS + surface->ctx.framesProduced++; + } else { + wlEglCreateFrameSync(surface); +- res = wlEglSendDamageEvent(surface, surface->wlEventQueue); ++ res = wlEglSendDamageEvent(surface, surface->wlEventQueue, rects, n_rects); + wlEglSurfaceCheckReleasePoints(display, surface); + } + } +@@ -434,7 +434,7 @@ EGLBoolean wlEglPostPresentExport2(WlEglSurface *surface, + surface->ctx.framesProduced++; + } else { + wlEglCreateFrameSync(surface); +- res = wlEglSendDamageEvent(surface, surface->wlEventQueue); ++ res = wlEglSendDamageEvent(surface, surface->wlEventQueue, NULL, 0); + } + + // Release wlEglSurface lock. +-- +2.43.0 + diff --git a/0005-Use-INT32_MAX-for-wl_surface_damage.patch b/0005-Use-INT32_MAX-for-wl_surface_damage.patch new file mode 100644 index 0000000..1a532a7 --- /dev/null +++ b/0005-Use-INT32_MAX-for-wl_surface_damage.patch @@ -0,0 +1,27 @@ +From febf851acc9c6a9a067ec001104533777adb5572 Mon Sep 17 00:00:00 2001 +From: Kyle Brenneman +Date: Tue, 27 Aug 2024 08:17:20 -0600 +Subject: [PATCH 5/9] Use INT32_MAX for wl_surface_damage + +The wl_surface_damage request takes signed integer parameters, so +sending UINT32_MAX would be received as -1. Instead, send INT32_MAX. +--- + src/wayland-eglsurface.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c +index c2e3fdc..4e4dcff 100644 +--- a/src/wayland-eglsurface.c ++++ b/src/wayland-eglsurface.c +@@ -301,7 +301,7 @@ wlEglSendDamageEvent(WlEglSurface *surface, + wl_surface_damage_buffer(surface->wlSurface, rect[0], inv_y, rect[2], rect[3]); + } + } else { +- wl_surface_damage(surface->wlSurface, 0, 0, UINT32_MAX, UINT32_MAX); ++ wl_surface_damage(surface->wlSurface, 0, 0, INT32_MAX, INT32_MAX); + } + + +-- +2.43.0 + diff --git a/0006-egl-wayland-Accept-device-name-from-either-wl_drm-or.patch b/0006-egl-wayland-Accept-device-name-from-either-wl_drm-or.patch new file mode 100644 index 0000000..19698b1 --- /dev/null +++ b/0006-egl-wayland-Accept-device-name-from-either-wl_drm-or.patch @@ -0,0 +1,60 @@ +From 6355c1605a0b0ccfdc1963170c5564b291ad0eb0 Mon Sep 17 00:00:00 2001 +From: Austin Shafer +Date: Fri, 6 Sep 2024 14:06:32 -0400 +Subject: [PATCH 6/9] egl-wayland: Accept device name from either wl_drm or + linux_dmabuf + +Commit 11386cc allowed for listening for the DRM device using the +dmabuf protocol instead of wl_drm, when possible. Unfortunately some +headless compositors (kwin) do not properly send the device id through +dmabuf, even though they send the device path properly through wl_drm. +This change relaxes our check to ensure that one of the protocols sends +the information so that we can use it to verify compositor support. +--- + src/wayland-egldisplay.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c +index 468b32d..0128dbd 100644 +--- a/src/wayland-egldisplay.c ++++ b/src/wayland-egldisplay.c +@@ -485,6 +485,7 @@ static void wl_drm_device(void *data, struct wl_drm *wl_drm, const char *name) + WlServerProtocols *protocols = (WlServerProtocols *)data; + (void) wl_drm; + ++ free(protocols->drm_name); + protocols->drm_name = strdup(name); + } + +@@ -575,6 +576,7 @@ dmabuf_feedback_check_done(void *data, struct zwp_linux_dmabuf_feedback_v1 *dmab + assert(getDeviceFromDevId); + if (getDeviceFromDevId(protocols->devId, 0, &drm_device) == 0) { + if (drm_device->available_nodes & (1 << DRM_NODE_RENDER)) { ++ free(protocols->drm_name); + protocols->drm_name = strdup(drm_device->nodes[DRM_NODE_RENDER]); + } + +@@ -632,6 +634,7 @@ registry_handle_global_check_protocols( + + if ((strcmp(interface, "wl_drm") == 0) && (version >= 2)) { + protocols->wlDrm = wl_registry_bind(registry, name, &wl_drm_interface, 2); ++ wl_drm_add_listener(protocols->wlDrm, &drmListener, protocols); + } + } + +@@ -828,10 +831,9 @@ static bool getServerProtocolsInfo(struct wl_display *nativeDpy, + wl_display_roundtrip_queue(nativeDpy, queue); + zwp_linux_dmabuf_feedback_v1_destroy(default_feedback); + } +- } else if (protocols->wlDrm) { +- wl_drm_add_listener(protocols->wlDrm, &drmListener, protocols); +- wl_display_roundtrip_queue(nativeDpy, queue); + } ++ ++ /* Check that one of our two protocols provided the device name */ + result = protocols->drm_name != NULL; + + if (protocols->wlDmaBuf) { +-- +2.43.0 + diff --git a/0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch b/0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch new file mode 100644 index 0000000..f59983b --- /dev/null +++ b/0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch @@ -0,0 +1,43 @@ +From 845568c64b69b462918ed89760abb21039e55368 Mon Sep 17 00:00:00 2001 +From: Austin Shafer +Date: Tue, 17 Sep 2024 10:39:26 -0400 +Subject: [PATCH 7/9] egl-wayland: fix device name case where only wl_drm + exists + +This fixes a problem in commit 6355c16 where we do not properly wait +for a roundtrip to get the wl_drm name, which can lead to failing to +initialize and falling back to another ICD. This fix also properly +prioritizes the device provided by dmabuf feedback over the wl_drm +name, only using wl_drm if dmabuf did not provide anything. +--- + src/wayland-egldisplay.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c +index 0128dbd..3921ede 100644 +--- a/src/wayland-egldisplay.c ++++ b/src/wayland-egldisplay.c +@@ -634,7 +634,6 @@ registry_handle_global_check_protocols( + + if ((strcmp(interface, "wl_drm") == 0) && (version >= 2)) { + protocols->wlDrm = wl_registry_bind(registry, name, &wl_drm_interface, 2); +- wl_drm_add_listener(protocols->wlDrm, &drmListener, protocols); + } + } + +@@ -833,6 +832,12 @@ static bool getServerProtocolsInfo(struct wl_display *nativeDpy, + } + } + ++ /* If we didn't get a name through linux_dmabuf then fall back to wl_drm */ ++ if (!protocols->drm_name && protocols->wlDrm) { ++ wl_drm_add_listener(protocols->wlDrm, &drmListener, protocols); ++ wl_display_roundtrip_queue(nativeDpy, queue); ++ } ++ + /* Check that one of our two protocols provided the device name */ + result = protocols->drm_name != NULL; + +-- +2.43.0 + diff --git a/0008-Add-ICD-json-file.patch b/0008-Add-ICD-json-file.patch new file mode 100644 index 0000000..ac6f4e5 --- /dev/null +++ b/0008-Add-ICD-json-file.patch @@ -0,0 +1,37 @@ +From 954e094faacdacad6d82905d2f0a674c3e37fbec Mon Sep 17 00:00:00 2001 +From: Simone Caronni +Date: Thu, 19 Sep 2024 16:00:09 +0200 +Subject: [PATCH 8/9] Add ICD json file + +--- + src/10_nvidia_wayland.json | 6 ++++++ + src/meson.build | 3 +++ + 2 files changed, 9 insertions(+) + create mode 100644 src/10_nvidia_wayland.json + +diff --git a/src/10_nvidia_wayland.json b/src/10_nvidia_wayland.json +new file mode 100644 +index 0000000..c08a641 +--- /dev/null ++++ b/src/10_nvidia_wayland.json +@@ -0,0 +1,6 @@ ++{ ++ "file_format_version" : "1.0.0", ++ "ICD" : { ++ "library_path" : "libnvidia-egl-wayland.so.1" ++ } ++} +diff --git a/src/meson.build b/src/meson.build +index 704632b..1f1ca34 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -86,3 +86,6 @@ egl_wayland = library('nvidia-egl-wayland', + version : meson.project_version(), + install : true, + ) ++ ++install_data('10_nvidia_wayland.json', ++ install_dir: '@0@/egl/egl_external_platform.d'.format(get_option('datadir'))) +-- +2.43.0 + diff --git a/0009-egl-wayland-Fix-roundtrip-eating-wl_drm-events-in-ge.patch b/0009-egl-wayland-Fix-roundtrip-eating-wl_drm-events-in-ge.patch new file mode 100644 index 0000000..028c3cc --- /dev/null +++ b/0009-egl-wayland-Fix-roundtrip-eating-wl_drm-events-in-ge.patch @@ -0,0 +1,64 @@ +From c10c5300483a8ec975e64e5d76c0fb00ac94e026 Mon Sep 17 00:00:00 2001 +From: Austin Shafer +Date: Thu, 19 Sep 2024 09:35:47 -0400 +Subject: [PATCH 9/9] egl-wayland: Fix roundtrip eating wl_drm events in + getServerProtocolsInfo + +This resolves another issue where the wl_drm events sent by the +compositor are silently dropped by a roundtrip that happens before +the wl_drm listener is registered. This change immediately registers +wl_drm and triggers its roundtrip first. The dmabuf feedback can +then proceed, potentially replacing the wl_drm name if a valid device +was provided. +--- + src/wayland-egldisplay.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c +index 3921ede..7089271 100644 +--- a/src/wayland-egldisplay.c ++++ b/src/wayland-egldisplay.c +@@ -634,6 +634,7 @@ registry_handle_global_check_protocols( + + if ((strcmp(interface, "wl_drm") == 0) && (version >= 2)) { + protocols->wlDrm = wl_registry_bind(registry, name, &wl_drm_interface, 2); ++ wl_drm_add_listener(protocols->wlDrm, &drmListener, protocols); + } + } + +@@ -817,11 +818,19 @@ static bool getServerProtocolsInfo(struct wl_display *nativeDpy, + protocols); + if (ret == 0) { + wl_display_roundtrip_queue(nativeDpy, queue); ++ /* use a second roundtrip to handle any wl_drm events triggered by binding the protocol */ ++ wl_display_roundtrip_queue(nativeDpy, queue); ++ + if (!getDeviceFromDevIdInitialised) { + getDeviceFromDevId = dlsym(RTLD_DEFAULT, "drmGetDeviceFromDevId"); + getDeviceFromDevIdInitialised = true; + } + ++ /* ++ * if dmabuf feedback is available then use that. This will potentially ++ * replace the drm_name provided by wl_drm, assuming the feedback provides ++ * a valid dev_t. ++ */ + if (protocols->wlDmaBuf && getDeviceFromDevId) { + struct zwp_linux_dmabuf_feedback_v1 *default_feedback + = zwp_linux_dmabuf_v1_get_default_feedback(protocols->wlDmaBuf); +@@ -832,12 +841,6 @@ static bool getServerProtocolsInfo(struct wl_display *nativeDpy, + } + } + +- /* If we didn't get a name through linux_dmabuf then fall back to wl_drm */ +- if (!protocols->drm_name && protocols->wlDrm) { +- wl_drm_add_listener(protocols->wlDrm, &drmListener, protocols); +- wl_display_roundtrip_queue(nativeDpy, queue); +- } +- + /* Check that one of our two protocols provided the device name */ + result = protocols->drm_name != NULL; + +-- +2.43.0 + diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..2830408 --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libnvidia-egl-wayland1 diff --git a/egl-wayland-1.1.13.tar.gz b/egl-wayland-1.1.13.tar.gz new file mode 100644 index 0000000..d779024 --- /dev/null +++ b/egl-wayland-1.1.13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:667561d794561d55d85b1273b2fe4def3f360e0ad27833d099e4f100f2244e48 +size 68153 diff --git a/egl-wayland-1.1.14.tar.gz b/egl-wayland-1.1.14.tar.gz new file mode 100644 index 0000000..09228ce --- /dev/null +++ b/egl-wayland-1.1.14.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb407ea391d5fab488a047130718fa7f30e799ee4fa9aa3abe64ebbcac80fc5f +size 73721 diff --git a/egl-wayland-1.1.15.tar.gz b/egl-wayland-1.1.15.tar.gz new file mode 100644 index 0000000..e4d195d --- /dev/null +++ b/egl-wayland-1.1.15.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24281c3b5409900ceb2472f781d19c079f11f4bba78771c518a71afb47ead793 +size 74483 diff --git a/egl-wayland-1.1.16.tar.gz b/egl-wayland-1.1.16.tar.gz new file mode 100644 index 0000000..e445fec --- /dev/null +++ b/egl-wayland-1.1.16.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3302002987128dac159ec5dde7a53831ccb905288daad62d1d18bafa0388858 +size 74615 diff --git a/libnvidia-egl-wayland.changes b/libnvidia-egl-wayland.changes new file mode 100644 index 0000000..9d5bd08 --- /dev/null +++ b/libnvidia-egl-wayland.changes @@ -0,0 +1,140 @@ +------------------------------------------------------------------- +Mon Oct 7 13:40:16 UTC 2024 - Stefan Dirsch + +- 0001-egl-wayland-bump-version-to-1.1.17.patch + 0002-Fix-the-include-path-for-drm_fourcc.h.patch + 0003-Fix-a-declaration-after-code.patch + 0004-egl-swap-provide-damage-rectangles-to-wl_surface.patch + 0005-Use-INT32_MAX-for-wl_surface_damage.patch + 0006-egl-wayland-Accept-device-name-from-either-wl_drm-or.patch + 0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch + 0008-Add-ICD-json-file.patch + 0009-egl-wayland-Fix-roundtrip-eating-wl_drm-events-in-ge.patch + * apply latest fixes including adding ICD json file; related: + https://github.com/openSUSE/nvidia-driver-G06/issues/26 + +------------------------------------------------------------------- +Thu Aug 22 20:33:25 UTC 2024 - RN + +- update to version 1.1.16: + * Fix a crash due to an assertion firing during surface + destruction, which affected Qt6 webengine + * Add an explicit dependency on the EGL headers + +------------------------------------------------------------------- +Sat Aug 10 13:56:34 UTC 2024 - RN + +- update to version 1.1.15: + * Significant stability fixes for explicit sync which prevents + crashes with Firefox/moonlight/more + * Added the `__NV_DISABLE_EXPLICIT_SYNC` environment variable. + Specifying `__NV_DISABLE_EXPLICIT_SYNC=1` disables the use of + the linux-drm-syncobj-v1 protocol + * Fix an issue causing KDE crashes, which also caused excessive + VRAM usage when resizing + * Fix race condition in damage_thread + +------------------------------------------------------------------- +Fri Jul 19 23:00:40 UTC 2024 - RN + +- update to version 1.1.14: + * Implement Explicit Sync (linux-drm-syncobj-v1) + * Fix freezing on KDE when explicit sync is enabled under certain + conditions + * Read compositor device from zwp_linux_dmabuf_v1 when available + * Properly validate and use the passed value of + EGL_EXT_present_opaque + +------------------------------------------------------------------- +Sun Nov 12 18:57:54 UTC 2023 - Florian "spirit" + +- update to version 1.1.13: + * Fixed a bug where PRIME render-offload was not working with KDE + * Fixed some more warnings from libwayland-client.so when closing + applications + * Fixed a bug that was causing intermittent segfaults in + wlEglDestroyFormatSet (notably affecting Firefox) + * Avoid unnecessarily calling eglQueryDeviceEXT during application + start-up on PRIME systems. This was both slow and would turn on + the dGPU wasting power. + +------------------------------------------------------------------- +Sat Jun 10 00:14:24 UTC 2023 - Nicola Pellegrini + +- update to version 1.1.12 + * Added support for version 4 of the Linux DMA-BUF protocol + * Added support for EGL_EXT_explicit_device extension + +------------------------------------------------------------------- +Fri Nov 4 19:38:35 UTC 2022 - Stefan Dirsch + +- update to version 1.1.11 + * latest bugfix release +- supersedes + * U_0001-wayland-Fail-eglGetDisplay-if-wl_drm-is-not-availabl.patch + * U_0002-generate-wayland-drm-client-protocol.h.patch + * U_0003-egl-wayland-retrieve-DRM-device-name-before-acquirin.patch + +------------------------------------------------------------------- +Thu Apr 21 12:46:29 UTC 2022 - Stefan Dirsch + +- U_0001-wayland-Fail-eglGetDisplay-if-wl_drm-is-not-availabl.patch + U_0002-generate-wayland-drm-client-protocol.h.patch + U_0003-egl-wayland-retrieve-DRM-device-name-before-acquirin.patch + * add latest fixes (U_0003-egl-wayland ... fixes boo#1195598) + +------------------------------------------------------------------- +Thu Apr 14 08:37:33 UTC 2022 - Stefan Dirsch + +- baselibs.conf + * Add 32-bit package variants. These are required for any EGL-using + 32-bit wayland binary (which is pretty much all of them) to work + at all: without it, running any 32-bit game under wayland will + segfault on startup. With SDL 2.0.22 planning to use wayland by + default, this is pretty important, as all 32-bit SDL programs will + break. + +------------------------------------------------------------------- +Mon Jan 10 14:19:00 UTC 2022 - Stefan Dirsch + +- update to version 1.1.9, which is needed by new 5xx.yy.zz + Nvidia driver (upcoming G06 driver series) + +------------------------------------------------------------------- +Mon Sep 27 13:49:26 UTC 2021 - Stefan Dirsch + +- needed for jira#SLE/SLE-19965, jira#SLE/SLE-19964, jira#SLE/SLE-18653 + +------------------------------------------------------------------- +Sun Jul 4 17:10:01 UTC 2021 - Callum Farmer + +- Use better tarball URL +- Run spec-cleaner + +------------------------------------------------------------------- +Thu Jul 1 22:28:26 UTC 2021 - Stefan Dirsch + +- added webpage for source tarballs to specfile + +------------------------------------------------------------------- +Thu Jul 1 16:03:04 UTC 2021 - Jan Engelhardt + +- Throw out ancient specfile constructs like BuildRoot and + defattr that have had proper defaults for long. Use more of the + contemporary macros, and drop all the nonstandard CFLAGS/LDFLAGS, + drop the unconditional strip calls. + +------------------------------------------------------------------- +Thu Jul 1 12:58:02 UTC 2021 - Stefan Dirsch + +- added missing copyright to specfile + +------------------------------------------------------------------- +Thu Jul 1 11:32:48 UTC 2021 - Stefan Dirsch + +- tried to address checkin policy issues for factory + +------------------------------------------------------------------- +Thu Jul 1 09:52:18 UTC 2021 - Alexander Evseev - 1.1.7 + +- First build. Version - 1.1.7 diff --git a/libnvidia-egl-wayland.spec b/libnvidia-egl-wayland.spec new file mode 100644 index 0000000..e14b34f --- /dev/null +++ b/libnvidia-egl-wayland.spec @@ -0,0 +1,117 @@ +# +# spec file for package libnvidia-egl-wayland +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define so_ver 1 +%define lname libnvidia-egl-wayland%{so_ver} +%define rname egl-wayland +Name: libnvidia-egl-wayland +Version: 1.1.16 +Release: 0 +Summary: The EGLStream-based Wayland external platform +License: MIT +Group: Development/Libraries/C and C++ +URL: https://github.com/NVIDIA/egl-wayland +Source0: https://github.com/NVIDIA/egl-wayland/archive/%{version}/%{rname}-%{version}.tar.gz +Source1: baselibs.conf +Patch1: 0001-egl-wayland-bump-version-to-1.1.17.patch +Patch2: 0002-Fix-the-include-path-for-drm_fourcc.h.patch +Patch3: 0003-Fix-a-declaration-after-code.patch +Patch4: 0004-egl-swap-provide-damage-rectangles-to-wl_surface.patch +Patch5: 0005-Use-INT32_MAX-for-wl_surface_damage.patch +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 +BuildRequires: gcc-c++ +BuildRequires: meson >= 0.50 +BuildRequires: ninja +BuildRequires: pkgconfig +BuildRequires: pkgconfig(egl) +BuildRequires: pkgconfig(eglexternalplatform) >= 1.1 +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(wayland-client) +BuildRequires: pkgconfig(wayland-egl-backend) >= 3 +BuildRequires: pkgconfig(wayland-protocols) +BuildRequires: pkgconfig(wayland-scanner) +BuildRequires: pkgconfig(wayland-server) +BuildRequires: pkgconfig(x11) + +%description +This is an implementation of a EGL External Platform library to add client-side +Wayland support to EGL on top of EGLDevice and EGLStream families of extensions. + +This library implements an EGL External Platform interface to work along with +EGL drivers that support the external platform mechanism. + +%package -n %{lname} +Summary: The EGLStream-based Wayland external platform +Group: System/Libraries + +%description -n %{lname} +This is an implementation of a EGL External Platform library to add client-side +Wayland support to EGL on top of EGLDevice and EGLStream families of extensions. + +This library implements an EGL External Platform interface to work along with +EGL drivers that support the external platform mechanism. + +%package -n libnvidia-egl-wayland-devel +Summary: Development package for %{name} +Group: Development/Languages/C and C++ +Requires: %{lname} = %{version}-%{release} + +%description -n libnvidia-egl-wayland-devel +This is an implementation of a EGL External Platform library to add client-side +Wayland support to EGL on top of EGLDevice and EGLStream families of extensions. + +This library implements an EGL External Platform interface to work along with +EGL drivers that support the external platform mechanism. + +This package provides headers and libraries required to build software +using %{name}. + +%prep +%autosetup -n %{rname}-%{version} -p1 + +%build +export LDFLAGS="-Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?_lto_cflags}" +%meson +%meson_build + +%install +%meson_install + +%post -n %{lname} -p /sbin/ldconfig +%postun -n %{lname} -p /sbin/ldconfig + +%files -n %{lname} +%license COPYING +%doc README.md +%{_libdir}/libnvidia-egl-wayland.so.%{so_ver}* +%{_datadir}/wayland-eglstream/ +%dir %{_datadir}/egl +%dir %{_datadir}/egl/egl_external_platform.d +%{_datadir}/egl/egl_external_platform.d/10_nvidia_wayland.json + +%files -n libnvidia-egl-wayland-devel +%license COPYING +%doc README.md +%{_libdir}/libnvidia-egl-wayland.so +%{_libdir}/pkgconfig/wayland-eglstream.pc +%{_datadir}/pkgconfig/wayland-eglstream-protocols.pc + +%changelog