summaryrefslogtreecommitdiffstats
path: root/src/egl
diff options
context:
space:
mode:
authorDaniel Stone <[email protected]>2017-05-05 14:44:20 +0100
committerJuan A. Suarez Romero <[email protected]>2017-05-31 21:53:24 +0200
commit013433b3d9399a1fa0966e4e13d3c3f3ed36264c (patch)
tree631b04e6ae0ab85e0f1ff0cbc73c24f372aed32f /src/egl
parent0dbab1e0f716f846c266931b55715c5fbba21228 (diff)
egl/wayland: Don't open-code roundtrip
wl_display_roundtrip_queue() exists and can replace roundtrip(). The API was introduced with wayland 1.6, while we currently require 1.11. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: [email protected] (cherry picked from commit 8118bc269f39ea0b965752ea89b886b28094db42) Signed-off-by: Juan A. Suarez Romero <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index a3380f298d3..561609dbab4 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -55,34 +55,10 @@ static EGLBoolean
dri2_wl_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
EGLint interval);
-static void
-sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
-{
- int *done = data;
-
- *done = 1;
- wl_callback_destroy(callback);
-}
-
-static const struct wl_callback_listener sync_listener = {
- .done = sync_callback
-};
-
static int
roundtrip(struct dri2_egl_display *dri2_dpy)
{
- struct wl_callback *callback;
- int done = 0, ret = 0;
-
- callback = wl_display_sync(dri2_dpy->wl_dpy_wrapper);
- wl_callback_add_listener(callback, &sync_listener, &done);
- while (ret != -1 && !done)
- ret = wl_display_dispatch_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
-
- if (!done)
- wl_callback_destroy(callback);
-
- return ret;
+ return wl_display_roundtrip_queue(dri2_dpy->wl_dpy, dri2_dpy->wl_queue);
}
static void