[PATCH mesa] egl/wayland: Dispatch the event queue before get_buffers

Kristian Høgsberg hoegsberg at gmail.com
Fri Nov 23 18:49:58 PST 2012


On Thu, Nov 22, 2012 at 03:34:49PM +0200, Ander Conselvan de Oliveira wrote:
> 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.

Ouch, yes, good catch.  We'll need this in mesa master and 9.0.2, so
please add the:

    Note: This is a candidate for stable branches.

line to the commit message so the mesa team will pick it up for 9.0.x.
 
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
>
> ---
>  src/egl/drivers/dri2/platform_wayland.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
> index 772116a..2708aab 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -401,6 +401,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);
> +

We need to either require wayland 1.0.2 in configure.ac or make this
call conditionaly on wayland version > 1.0.2.  We have
wayland-version.h, so I'd prefer to just do the version check, but of
course recommend using 1.0.2

Kristian

>     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)) {
> -- 
> 1.7.10.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list