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 <daniels@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
Cc: Chad Versace <chadversary@chromium.org>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108540
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
}
}
- /* 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)