anv/wsi: Avoid stuck Wayland connection
authorDaniel Stone <daniels@collabora.com>
Tue, 19 Jan 2016 16:51:56 +0000 (16:51 +0000)
committerDaniel Stone <daniels@collabora.com>
Tue, 19 Jan 2016 16:54:55 +0000 (16:54 +0000)
In acquire_next_image, we are waiting for a wl_buffer::release to arrive
and release one of the buffers in our swapchain. Most compositors don't
explicitly flush release events, so we may need to perform a roundtrip
instead, to ensure the event arrives.

Signed-off-by: Daniel Stone <daniels@collabora.com>
src/vulkan/anv_wsi_wayland.c

index 5e8a3a56f6826933c5c1b642e1d32586712b6310..c8f9cf27ab343ac1e5924eaf84dd6922114f6f34 100644 (file)
@@ -536,8 +536,8 @@ wsi_wl_swapchain_acquire_next_image(struct anv_swapchain *anv_chain,
       /* This time we do a blocking dispatch because we can't go
        * anywhere until we get an event.
        */
-      int ret = wl_display_dispatch_queue(chain->display->display,
-                                          chain->queue);
+      int ret = wl_display_roundtrip_queue(chain->display->display,
+                                           chain->queue);
       if (ret < 0)
          return vk_error(VK_ERROR_OUT_OF_DATE_KHR);
    }