vulkan/wsi: Allow binding presentation_timing when software rendering
authorDerek Foreman <derek.foreman@collabora.com>
Wed, 9 Aug 2023 19:17:27 +0000 (14:17 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 11 Aug 2023 00:35:37 +0000 (00:35 +0000)
The presentation timing extension is used for doing WaitForPresent
properly, but we accidentally bind it after an early return intended to
stop us from binding dmabuf when software rendering.

Remove the early return.

cc: mesa-stable

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24588>

src/vulkan/wsi/wsi_common_wayland.c

index 9ccf26b..8d28034 100644 (file)
@@ -782,15 +782,14 @@ registry_handle_global(void *data, struct wl_registry *registry,
          display->wl_shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
          wl_shm_add_listener(display->wl_shm, &shm_listener, display);
       }
-      return;
-   }
-
-   if (strcmp(interface, zwp_linux_dmabuf_v1_interface.name) == 0 && version >= 3) {
-      display->wl_dmabuf =
-         wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface,
-                          MIN2(version, ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION));
-      zwp_linux_dmabuf_v1_add_listener(display->wl_dmabuf,
-                                       &dmabuf_listener, display);
+   } else {
+      if (strcmp(interface, zwp_linux_dmabuf_v1_interface.name) == 0 && version >= 3) {
+         display->wl_dmabuf =
+            wl_registry_bind(registry, name, &zwp_linux_dmabuf_v1_interface,
+                             MIN2(version, ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION));
+         zwp_linux_dmabuf_v1_add_listener(display->wl_dmabuf,
+                                          &dmabuf_listener, display);
+      }
    }
 
    if (strcmp(interface, wp_presentation_interface.name) == 0) {