summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Davy <axel.davy@ens.fr>2013-12-03 17:04:10 +0100
committerCarl Worth <cworth@cworth.org>2013-12-12 15:34:27 -0800
commit2776a496d4fa28f7d5039eb7f8d79c047a6e7d9f (patch)
treed3eaf1646486de3ff1889e14c7702dde6add61e3
parent1919ec6ba43a8fb229495e2ebb87789fb11ffb8c (diff)
downloadmesa-2776a496d4fa28f7d5039eb7f8d79c047a6e7d9f.tar.gz
Enable throttling in SwapBuffers
flush_with_flags, when available, allows the driver to throttle. Using this suppress input lag issues that can be observed in heavy rendering situations on non-intel cards. Signed-off-by: Axel Davy <axel.davy@ens.fr> Cc: "10.0" mesa-stable@lists.freedesktop.org (cherry picked from commit afcce46fd505da51883000249ef29dd69f1d7791)
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 82be48f8827..43e8f4b0c5a 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -557,6 +557,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
+ struct dri2_egl_context *dri2_ctx;
+ _EGLContext *ctx;
int i, ret = 0;
while (dri2_surf->frame_callback && ret != -1)
@@ -610,7 +612,17 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
}
}
- (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
+ if (dri2_dpy->flush->base.version >= 4) {
+ ctx = _eglGetCurrentContext();
+ dri2_ctx = dri2_egl_context(ctx);
+ (*dri2_dpy->flush->flush_with_flags)(dri2_ctx->dri_context,
+ dri2_surf->dri_drawable,
+ __DRI2_FLUSH_DRAWABLE,
+ __DRI2_THROTTLE_SWAPBUFFER);
+ } else {
+ (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
+ }
+
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
wl_surface_commit(dri2_surf->wl_win->surface);