From 3d012d707d0242780cd386868ab511846dc9b0af Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Thu, 15 Oct 2026 13:19:58 +0300 Subject: Add damage presentation and reduce CPU surface latency Add yasl_cpu_present_damage to submit partial damage rectangles. Skip commit timers for CPU surfaces to prevent display delay. Remove frame callback gating in surface_draw_frame when free buffers exist. Flush the display immediately on CPU present. Forward tearing option to window specifications. --- src/platform/wayland/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/platform/wayland/buffer.c') diff --git a/src/platform/wayland/buffer.c b/src/platform/wayland/buffer.c index b68621d..7ff4bd0 100644 --- a/src/platform/wayland/buffer.c +++ b/src/platform/wayland/buffer.c @@ -497,7 +497,7 @@ static void commit_buffer(struct wayland_surface *w, int idx) wp_fifo_v1_wait_barrier(w->fifo); wp_fifo_v1_set_barrier(w->fifo); } - if (w->commit_timer && w->conn->pres_clock_known) { + if (w->commit_timer && w->conn->pres_clock_known && w->base.presenter != YASL_PRIVATE_PRESENTER_CPU) { uint64_t now = yasl_private_loop_now_ns(); uint64_t next = yasl_private_clock_next_present_ns(&w->clock); bool soon = next > now && next - now < (uint64_t)(w->clock.refresh_ns * 1.5); @@ -558,7 +558,7 @@ void surface_draw_frame(struct wayland_surface *w) surface_fail(w); return; } - if (w->closed || !w->cbs->draw || w->frame_cb || !w->want_draw) + if (w->closed || !w->cbs->draw || !w->want_draw) return; int idx = buffer_pick_free_index(w->buffers, w->cur); -- cgit v1.2.3