aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-10-28 12:33:59 +0100
committerGitHub <noreply@github.com>2018-10-28 12:33:59 +0100
commite3ec1be9415faf1407f3774489187b9a1bcc2894 (patch)
treed378b5a1d90640f4064f0367051bba1cc5ac8f91
parent2ae2c247a0e0824b753c9a77cc9e072719c551e9 (diff)
parentb42fc4f2b104b555ef7aca75c4d0edc894d11478 (diff)
Merge pull request #1338 from emersion/wayland-swap-interval
render: on Wayland, make eglSwapBuffers non-blocking
-rw-r--r--include/wlr/render/egl.h1
-rw-r--r--render/egl.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h
index c42b0325..30de3d26 100644
--- a/include/wlr/render/egl.h
+++ b/include/wlr/render/egl.h
@@ -17,6 +17,7 @@
#include <wlr/render/dmabuf.h>
struct wlr_egl {
+ EGLenum platform;
EGLDisplay display;
EGLConfig config;
EGLContext context;
diff --git a/render/egl.c b/render/egl.c
index cfa37f20..644f94ac 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -130,6 +130,8 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *remote_display,
goto error;
}
+ egl->platform = platform;
+
EGLint major, minor;
if (eglInitialize(egl->display, &major, &minor) == EGL_FALSE) {
wlr_log(WLR_ERROR, "Failed to initialize EGL");
@@ -319,6 +321,11 @@ bool wlr_egl_is_current(struct wlr_egl *egl) {
bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface,
pixman_region32_t *damage) {
+ // Never block when swapping buffers on Wayland
+ if (egl->platform == EGL_PLATFORM_WAYLAND_EXT) {
+ eglSwapInterval(egl->display, 0);
+ }
+
EGLBoolean ret;
if (damage != NULL && (egl->exts.swap_buffers_with_damage_ext ||
egl->exts.swap_buffers_with_damage_khr)) {