diff options
author | Deepak Rawat <[email protected]> | 2018-04-24 11:50:59 -0700 |
---|---|---|
committer | Thomas Hellstrom <[email protected]> | 2018-05-03 13:55:58 +0200 |
commit | 9a21c96126d6a13e7b472ec622c517c0d0285ba8 (patch) | |
tree | 841dcf7173073bfceb6745f49f060f3ee78fbed2 /src/egl/drivers/dri2 | |
parent | fd4eba4929e0e87f71b3b72a4e9fa5ac4abae52c (diff) |
egl/x11: Send invalidate to driver on copy_region path in swap_buffer
Similar to swap_available path send invalidate to the driver because
egl/X11 is not watching for for server's invalidate events. The
dri2_copy_region path is trigerred when server supports DRI2 version
minor 1.
Tested with piglit egl tests for regression.
V2: Move invalidate from dri2_copy_region to swap_buffer common.
Cc: <[email protected]>
Signed-off-by: Deepak Rawat <[email protected]>
Signed-off-by: Thomas Hellstrom <[email protected]>
Acked-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index fa838f6721e..7aca0a90203 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -869,19 +869,22 @@ dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, if (draw->Type == EGL_PIXMAP_BIT || draw->Type == EGL_PBUFFER_BIT) return 0; - if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available) - return dri2_copy_region(drv, disp, draw, dri2_surf->region) ? 0 : -1; - - dri2_flush_drawable_for_swapbuffers(disp, draw); + if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available) { + swap_count = dri2_copy_region(drv, disp, draw, dri2_surf->region) ? 0 : -1; + } else { + dri2_flush_drawable_for_swapbuffers(disp, draw); - cookie = xcb_dri2_swap_buffers_unchecked(dri2_dpy->conn, dri2_surf->drawable, - msc_hi, msc_lo, divisor_hi, divisor_lo, remainder_hi, remainder_lo); + cookie = xcb_dri2_swap_buffers_unchecked(dri2_dpy->conn, + dri2_surf->drawable, msc_hi, + msc_lo, divisor_hi, divisor_lo, + remainder_hi, remainder_lo); - reply = xcb_dri2_swap_buffers_reply(dri2_dpy->conn, cookie, NULL); + reply = xcb_dri2_swap_buffers_reply(dri2_dpy->conn, cookie, NULL); - if (reply) { - swap_count = (((int64_t)reply->swap_hi) << 32) | reply->swap_lo; - free(reply); + if (reply) { + swap_count = (((int64_t)reply->swap_hi) << 32) | reply->swap_lo; + free(reply); + } } /* Since we aren't watching for the server's invalidate events like we're |