0020-egl-wayland-post-maximum-damage-when-blitting.patch 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. From 047016425214067e3cee93ace2d64018fa13c2ce Mon Sep 17 00:00:00 2001
  2. From: Brendan King <Brendan.King@imgtec.com>
  3. Date: Wed, 8 Nov 2017 15:15:20 +0000
  4. Subject: [PATCH] egl/wayland: post maximum damage when blitting
  5. When blitting, as part of the "is_different_gpu" case when swapping
  6. buffers, the blit is done using the full surface dimensions, ignoring
  7. the damage region. This results in corruption of the non damaged region
  8. on screen. Workaround this by posting maximum damage when blitting.
  9. A better fix would be to limit the blit to the damaged region, at least
  10. when the number of damage rectangles is 1.
  11. ---
  12. src/egl/drivers/dri2/platform_wayland.c | 3 ++-
  13. 1 file changed, 2 insertions(+), 1 deletion(-)
  14. diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
  15. index c18edc0..c2e4287 100644
  16. --- a/src/egl/drivers/dri2/platform_wayland.c
  17. +++ b/src/egl/drivers/dri2/platform_wayland.c
  18. @@ -1112,7 +1112,8 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp,
  19. /* If the compositor doesn't support damage_buffer, we deliberately
  20. * ignore the damage region and post maximum damage, due to
  21. * https://bugs.freedesktop.org/78190 */
  22. - if (!n_rects || !try_damage_buffer(dri2_surf, rects, n_rects))
  23. + if (dri2_dpy->is_different_gpu ||
  24. + !n_rects || !try_damage_buffer(dri2_surf, rects, n_rects))
  25. wl_surface_damage(dri2_surf->wl_surface_wrapper,
  26. 0, 0, INT32_MAX, INT32_MAX);