shm: track busy buffers’ age, and add compile-time option to force double buffering

By default, age all matching buffers that are busy (i.e. in use by the
compositor).

This allows us to detect whether we can apply the current frame’s
damage directly, or if we need to prepare the buffer first (e.g. copy
old buffer, or re-apply last frame’s damage etc).
This commit is contained in:
Daniel Eklöf 2021-05-07 18:18:35 +02:00
parent 1501d36470
commit c8b342ae51
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 34 additions and 11 deletions

2
shm.h
View file

@ -32,6 +32,8 @@ struct buffer {
bool scrollable;
bool purge; /* True if this buffer should be destroyed */
int age;
};
struct buffer *shm_get_buffer(