assert(chain->has_present_queue);
while (chain->status >= 0) {
- /* It should be safe to unconditionally block here. Later in the loop
- * we blocks until the previous present has landed on-screen. At that
- * point, we should have received IDLE_NOTIFY on all images presented
- * before that point so the client should be able to acquire any image
- * other than the currently presented one.
+ /* We can block here unconditionally because after an image was sent to
+ * the server (later on in this loop) we ensure at least one image is
+ * acquirable by the consumer or wait there on such an event.
*/
uint32_t image_index = 0;
result = wsi_queue_pull(&chain->present_queue, &image_index, INT64_MAX);
goto fail;
if (chain->has_acquire_queue) {
- while (chain->last_present_msc < target_msc) {
+ /* Wait for our presentation to occur and ensure we have at least one
+ * image that can be acquired by the client afterwards. This ensures we
+ * can pull on the present-queue on the next loop.
+ */
+ while (chain->last_present_msc < target_msc ||
+ chain->sent_image_count == chain->base.image_count) {
xcb_generic_event_t *event =
xcb_wait_for_special_event(chain->conn, chain->special_event);
if (!event) {