egl/wayland/sw: pass damage region through from put_image2 to wl_surface_damage

this propagates damage from drisw to wayland; y inversion matches protocol

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
This commit is contained in:
Mike Blumenkrantz
2024-02-12 13:30:01 -05:00
committed by Marge Bot
parent d90b14c768
commit fa465e34ca

View File

@@ -2470,7 +2470,12 @@ dri2_wl_swrast_put_image2(__DRIdrawable *draw, int op, int x, int y, int w,
char *src, *dst;
assert(copy_width <= stride);
wl_surface_damage(dri2_surf->wl_surface_wrapper, 0, 0, INT32_MAX, INT32_MAX);
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, dri2_surf->base.Height - y - h, w, h);
dst = dri2_wl_swrast_get_backbuffer_data(dri2_surf);