backend-drm: Cache drm_fb for each weston_buffer

When we first create a drm_fb from a weston_buffer, cache it and keep it
alive as long as the buffer lives. This allows us to reuse the gbm_bo
and kernel-side DRM framebuffer, rather than constantly creating and
destroying them at every repaint. The overhead of doing so (e.g. MMU
updates) can be significant on some platforms.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone
2021-11-18 16:01:03 +00:00
parent 2ecc38b042
commit 7d27df4c4c
3 changed files with 48 additions and 6 deletions
+1
View File
@@ -1198,6 +1198,7 @@ struct weston_buffer {
int32_t width, height;
uint32_t busy_count;
int y_inverted;
void *backend_private;
};
struct weston_buffer_reference {