diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2024-02-13 15:11:40 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-02-29 01:15:23 +0000 |
commit | 76f74f55a40bfaf6e1d73f5da23d1b067b1e37c2 (patch) | |
tree | 1187a096e61d64cd4ac28e6ce7efe6f7f46fd103 | |
parent | 4345c415d7ffcb48fd230e5259ce328a5daa49ad (diff) |
egl/wayland: add a separate hook for kopper buffer age
this otherwise hits the swrast one which is wrong
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 6978fef05e7..773510abe5d 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -2562,6 +2562,18 @@ dri2_wl_swrast_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw) } static EGLint +dri2_wl_kopper_query_buffer_age(_EGLDisplay *disp, _EGLSurface *surface) +{ + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surface); + + /* This can legitimately be null for lavapipe */ + if (dri2_dpy->kopper) + return dri2_dpy->kopper->queryBufferAge(dri2_surf->dri_drawable); + return 0; +} + +static EGLint dri2_wl_swrast_query_buffer_age(_EGLDisplay *disp, _EGLSurface *surface) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); @@ -2640,7 +2652,7 @@ static const struct dri2_egl_display_vtbl dri2_wl_kopper_display_vtbl = { .swap_buffers = dri2_wl_swrast_swap_buffers, .swap_buffers_with_damage = dri2_wl_swrast_swap_buffers_with_damage, .get_dri_drawable = dri2_surface_get_dri_drawable, - .query_buffer_age = dri2_wl_swrast_query_buffer_age, + .query_buffer_age = dri2_wl_kopper_query_buffer_age, }; static const __DRIswrastLoaderExtension swrast_loader_extension = { |