libnvidia-egl-wayland/0007-egl-wayland-fix-device-name-case-where-only-wl_drm-e.patch
Stefan Dirsch 205bb60fa5 - 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
2024-10-07 13:46:32 +00:00

44 lines
1.6 KiB
Diff

From 845568c64b69b462918ed89760abb21039e55368 Mon Sep 17 00:00:00 2001
From: Austin Shafer <ashafer@badland.io>
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