diff options
author | emersion <contact@emersion.fr> | 2018-01-30 14:45:02 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-01-30 14:45:02 +0100 |
commit | 704130cc1164604c5b805adf186999269e14c5a5 (patch) | |
tree | 3b155e9746555d5d9c2bd104c203a3dfb7c7aae8 /backend | |
parent | a7cba7d83fc0c881af79792029f36cd46c6cab2c (diff) |
output: fix performance issues with wlr_output_schedule_frame
Diffstat (limited to 'backend')
-rw-r--r-- | backend/wayland/output.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 4fec1955..4a8fb0bf 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -21,9 +21,10 @@ static void surface_frame_callback(void *data, struct wl_callback *cb, uint32_t time) { struct wlr_wl_backend_output *output = data; assert(output); - wlr_output_send_frame(&output->wlr_output); wl_callback_destroy(cb); output->frame_callback = NULL; + + wlr_output_send_frame(&output->wlr_output); } static struct wl_callback_listener frame_listener = { @@ -50,6 +51,11 @@ static bool wlr_wl_output_swap_buffers(struct wlr_output *wlr_output) { struct wlr_wl_backend_output *output = (struct wlr_wl_backend_output *)wlr_output; + if (output->frame_callback != NULL) { + wlr_log(L_ERROR, "Skipping buffer swap"); + return false; + } + output->frame_callback = wl_surface_frame(output->surface); wl_callback_add_listener(output->frame_callback, &frame_listener, output); |