summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-09-28 15:56:14 -0700
committerJason Ekstrand <[email protected]>2015-09-28 15:58:34 -0700
commit9ac3dde3a08d2914d4a95c42493b2b91d0f05244 (patch)
treef0b1faff2bff20b1b8cfc3f782e1a7fd87d27a2e /src
parentddcedb979a143ca25a8c16b9ce39956311b3b324 (diff)
anv/wsi_wayland: Fix FIFO mode
Previously, there were a number of things we were doing wrong: 1) We weren't flushing the wl_display so dead-looping clients weren't guaranteed to work. 2) We were sending the frame event after calling wl_surface.commit() so it wasn't getting assigned to the correct frame 3) We weren't actually setting fifo_ready to false. Unfortunately, we never noticed because (3) was hiding the other two. This commit fixes all three and clients that use FIFO mode are now properly refresh-rate limited.
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/anv_wsi_wayland.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vulkan/anv_wsi_wayland.c b/src/vulkan/anv_wsi_wayland.c
index 11f2dae9759..a601ad1851f 100644
--- a/src/vulkan/anv_wsi_wayland.c
+++ b/src/vulkan/anv_wsi_wayland.c
@@ -516,14 +516,17 @@ wsi_wl_queue_present(struct anv_swap_chain *anv_chain,
assert(image_index < chain->image_count);
wl_surface_attach(chain->surface, chain->images[image_index].buffer, 0, 0);
wl_surface_damage(chain->surface, 0, 0, INT32_MAX, INT32_MAX);
- wl_surface_commit(chain->surface);
if (chain->present_mode == VK_PRESENT_MODE_FIFO_WSI) {
struct wl_callback *frame = wl_surface_frame(chain->surface);
wl_proxy_set_queue((struct wl_proxy *)frame, chain->queue);
wl_callback_add_listener(frame, &frame_listener, chain);
+ chain->fifo_ready = false;
}
+ wl_surface_commit(chain->surface);
+ wl_display_flush(chain->display->display);
+
return VK_SUCCESS;
}