summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2018-10-30 12:56:53 +0000
committerEric Engestrom <[email protected]>2019-05-02 11:51:03 +0000
commit9826e04eca69d04b64258d26983410bd2470f607 (patch)
treebe144d056a7bbc4c49ce1ea9fea3bd9117499649 /src/vulkan/wsi
parent8a67e4d30adee205d15443bdfe18955fb1a1230b (diff)
vulkan/wsi/wayland: Respect non-blocking AcquireNextImage
If the client has requested that AcquireNextImage not block at all, with a timeout of 0, then don't make any non-blocking calls. This will still potentially block infinitely given a non-infinte timeout, but the fix for that is much more involved. Signed-off-by: Daniel Stone <[email protected]> Cc: [email protected] Cc: Chad Versace <[email protected]> Cc: Jason Ekstrand <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108540 Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/vulkan/wsi')
-rw-r--r--src/vulkan/wsi/wsi_common_wayland.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index ad653848b82..cf978ea3bf6 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -774,9 +774,14 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain,
}
}
- /* This time we do a blocking dispatch because we can't go
- * anywhere until we get an event.
+ /* We now have to do a blocking dispatch, because all our images
+ * are in use and we cannot return one until the server does. However,
+ * if the client has requested non-blocking ANI, then we tell it up front
+ * that we have nothing to return.
*/
+ if (info->timeout == 0)
+ return VK_NOT_READY;
+
int ret = wl_display_roundtrip_queue(chain->display->wl_display,
chain->display->queue);
if (ret < 0)