summaryrefslogtreecommitdiff
path: root/src/wayland/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wayland/buffer.c')
-rw-r--r--src/wayland/buffer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wayland/buffer.c b/src/wayland/buffer.c
index 76f6c0e..3f9cf84 100644
--- a/src/wayland/buffer.c
+++ b/src/wayland/buffer.c
@@ -278,8 +278,10 @@ static void frame_done(void *data, struct wl_callback *cb, uint32_t ms)
w->frame_cb = NULL;
uint64_t now = yasl_loop_now_ns();
- if (!w->conn->pres_clock_known)
+ if (!w->conn->pres_clock_known) {
yasl_clock_presented(&w->clock, yasl_clock_extend_ms(ms, now), w->sample_refresh);
+ w->clock.source = YASL_TIMING_FRAME_CALLBACK;
+ }
if (w->want_draw)
wayland_surface_schedule_redraw(w);
@@ -358,6 +360,7 @@ static void presented(void *data, struct wp_presentation_feedback *fb,
(((uint64_t)tv_sec_hi << 32) | tv_sec_lo) * 1000000000ull + tv_nsec);
if (refresh) w->clock.refresh_ns = refresh;
w->clock.last_present_ns = ns;
+ w->clock.source = YASL_TIMING_PRESENTATION;
}
(void)fb;
feedback_destroy(feedback);
@@ -444,7 +447,7 @@ bool wayland_surface_present(struct wayland_surface *w, const struct yasl_frameb
if (!w || w->closed || !w->frame_active || w->frame_presented || !fb ||
!damage || fb->pixels != w->frame.target.pixels ||
fb->size.x != w->width || fb->size.y != w->height ||
- fb->buffer != w->cur)
+ fb->buffer != w->cur || fb->native_drawable || fb->transaction)
return false;
w->damage = *damage;
@@ -485,6 +488,7 @@ void surface_draw_frame(struct wayland_surface *w)
w->frame = (struct yasl_frame){
.surface = &w->base,
.target = {
+ .generation = yasl_frame_begin(&w->base),
.pixels = w->buffers[idx].pixels,
.size = { .x = w->width, .y = w->height },
.buffer = idx,
@@ -544,6 +548,7 @@ struct yasl_timing wayland_surface_timing(const struct wayland_surface *w)
.last_present_ns = w->clock.last_present_ns,
.next_present_ns = yasl_clock_next_present_ns(&w->clock),
.frames_skipped = w->frames_skipped,
+ .source = w->clock.source,
};
yasl_clock_resize_stats(&w->clock, &t.resize);
return t;