diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 6c41a3862ad..739a8cee7db 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -2627,12 +2627,6 @@ dri2_wl_swrast_put_image2(__DRIdrawable *draw, int op, int x, int y, int w, char *src, *dst; assert(copy_width <= stride); - if (wl_proxy_get_version((struct wl_proxy *)dri2_surf->wl_surface_wrapper) < - WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) - wl_surface_damage(dri2_surf->wl_surface_wrapper, 0, 0, INT32_MAX, INT32_MAX); - else - wl_surface_damage_buffer(dri2_surf->wl_surface_wrapper, - x, y, w, h); dst = dri2_wl_swrast_get_backbuffer_data(dri2_surf); @@ -2720,6 +2714,13 @@ dri2_wl_swrast_swap_buffers_with_damage(_EGLDisplay *disp, _EGLSurface *draw, dri2_surf->back->wl_buffer, dri2_surf->dx, dri2_surf->dy); + /* If the compositor doesn't support damage_buffer, we deliberately + * ignore the damage region and post maximum damage, due to + * https://bugs.freedesktop.org/78190 */ + if (!n_rects || !try_damage_buffer(dri2_surf, rects, n_rects)) + wl_surface_damage(dri2_surf->wl_surface_wrapper, 0, 0, INT32_MAX, + INT32_MAX); + /* guarantee full copy for partial update */ int w = n_rects == 1 ? (rects[2] - rects[0]) : 0; int copy_width = dri2_wl_swrast_get_stride_for_format(dri2_surf->format, w);