From c50b1f990093a2a453288b976ef7f6d9a303f793 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 7 Oct 2023 16:23:09 +0200 Subject: render: more fine-grained wayland surface damage tracking Before this patch. Wayland surface damage tracking was done on a per-row basis. That is, even if just one cell was updated, the entire row was "damaged". Now, damage is per cell. This hopefully results in lower latencies in many use cases, and especially on high DPI monitors. --- shm.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'shm.h') diff --git a/shm.h b/shm.h index 440cfa1d..f9e90a23 100644 --- a/shm.h +++ b/shm.h @@ -24,7 +24,18 @@ struct buffer { unsigned age; - pixman_region32_t dirty; + /* + * First item in the array is used to track frame-to-frame + * damage. This is used when re-applying damage from the last + * frame, when the compositor doesn't release buffers immediately + * (forcing us to double buffer) + * + * The remaining items are used to track surface damage. Each + * worker thread adds its own cell damage to "its" region. When + * the frame is done, all damage is converted to a single region, + * which is then used in calls to wl_surface_damage_buffer(). + */ + pixman_region32_t *dirty; }; void shm_fini(void); -- cgit v1.3