diff options
author | Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> | 2012-11-22 15:34:49 +0200 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-11-30 17:05:50 -0500 |
commit | 60a11e295b86475ff334291a5b483e422371b21c (patch) | |
tree | 6d779b5a0c5d836ce73015f895125de9b0e81220 /src/egl | |
parent | 89ba4368fd86778405eea163e2b27812055f0df9 (diff) |
egl/wayland: Dispatch the event queue before get_buffers
When a client frame callback is executed and the client starts rendering
again, the egl event queue might not have been dispatched so that the
buffer release event for the previous frame hasn't been processed. In
that case a third buffer is allocated, even though it would be possible
to reuse the buffer that was just released.
The wl_display_dispatch_queue_pending() entry point is available from
wayland-client 1.0.2, so require that in configure.ac. Also, just
let the pkg-config macro throw its own error, which will show what version
we were looking for and failed to find.
Note: This is a candidate for stable branches.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_wayland.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 7c1aa94583..ba54286b7b 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -420,6 +420,9 @@ dri2_get_buffers_with_format(__DRIdrawable * driDrawable, dri2_egl_display(dri2_surf->base.Resource.Display); int i; + /* There might be a buffer release already queued that wasn't processed */ + wl_display_dispatch_queue_pending(dri2_dpy->wl_dpy, dri2_dpy->wl_queue); + if (dri2_surf->base.Type == EGL_WINDOW_BIT && (dri2_surf->base.Width != dri2_surf->wl_win->width || dri2_surf->base.Height != dri2_surf->wl_win->height)) { |