0021-egl-wayland-flush-the-drawable-before-blitting.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From dc5816cc975e908bc213176fc1fccfb634c18c0a Mon Sep 17 00:00:00 2001
  2. From: Brendan King <Brendan.King@imgtec.com>
  3. Date: Wed, 8 Nov 2017 15:26:25 +0000
  4. Subject: [PATCH] egl/wayland: flush the drawable before blitting
  5. Flush the drawable before blitting in the "is_different_gpu" case when
  6. swapping buffers, and pass the flush flag to the blitImage call. The
  7. change brings the code into line with the way the DRI3 GLX code works.
  8. For the PowerVR driver, the drawable parameters that will be used in
  9. the flush have been obtained previously, including any native fence
  10. associated with the blit source. The blit will result in a new native
  11. fence for the source, and make the one in the drawable parameters
  12. invalid.
  13. ---
  14. src/egl/drivers/dri2/platform_wayland.c | 5 +++--
  15. 1 file changed, 3 insertions(+), 2 deletions(-)
  16. diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
  17. index c2e4287..811d28b 100644
  18. --- a/src/egl/drivers/dri2/platform_wayland.c
  19. +++ b/src/egl/drivers/dri2/platform_wayland.c
  20. @@ -1117,6 +1117,8 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp,
  21. wl_surface_damage(dri2_surf->wl_surface_wrapper,
  22. 0, 0, INT32_MAX, INT32_MAX);
  23. + dri2_flush_drawable_for_swapbuffers(disp, draw);
  24. +
  25. if (dri2_dpy->is_different_gpu) {
  26. _EGLContext *ctx = _eglGetCurrentContext();
  27. struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);
  28. @@ -1126,10 +1128,9 @@ dri2_wl_swap_buffers_with_damage(_EGLDisplay *disp,
  29. 0, 0, dri2_surf->base.Width,
  30. dri2_surf->base.Height,
  31. 0, 0, dri2_surf->base.Width,
  32. - dri2_surf->base.Height, 0);
  33. + dri2_surf->base.Height, __BLIT_FLAG_FLUSH);
  34. }
  35. - dri2_flush_drawable_for_swapbuffers(disp, draw);
  36. dri2_dpy->flush->invalidate(dri2_surf->dri_drawable);
  37. wl_surface_commit(dri2_surf->wl_surface_wrapper);