<div dir="ltr">Acked-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 30, 2018 at 7:56 AM Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If the client has requested that AcquireNextImage not block at all, with<br>
a timeout of 0, then don't make any non-blocking calls.<br>
<br>
This will still potentially block infinitely given a non-infinte<br>
timeout, but the fix for that is much more involved.<br>
<br>
Signed-off-by: Daniel Stone <<a href="mailto:daniels@collabora.com" target="_blank">daniels@collabora.com</a>><br>
Cc: <a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a><br>
Cc: Chad Versace <<a href="mailto:chadversary@chromium.org" target="_blank">chadversary@chromium.org</a>><br>
Cc: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>><br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=108540" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=108540</a><br>
---<br>
src/vulkan/wsi/wsi_common_wayland.c | 9 +++++++--<br>
1 file changed, 7 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c<br>
index e9cc22ec603..981243d8b14 100644<br>
--- a/src/vulkan/wsi/wsi_common_wayland.c<br>
+++ b/src/vulkan/wsi/wsi_common_wayland.c<br>
@@ -699,9 +699,14 @@ wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain,<br>
}<br>
}<br>
<br>
- /* This time we do a blocking dispatch because we can't go<br>
- * anywhere until we get an event.<br>
+ /* We now have to do a blocking dispatch, because all our images<br>
+ * are in use and we cannot return one until the server does. However,<br>
+ * if the client has requested non-blocking ANI, then we tell it up front<br>
+ * that we have nothing to return.<br>
*/<br>
+ if (info->timeout == 0)<br>
+ return VK_NOT_READY;<br>
+<br>
int ret = wl_display_roundtrip_queue(chain->display->wl_display,<br>
chain->display->queue);<br>
if (ret < 0)<br>
-- <br>
2.19.1<br>
<br>
</blockquote></div>