[PATCH mesa] egl/wayland: Dispatch the event queue before get_buffers
Kristian Høgsberg
hoegsberg at gmail.com
Fri Nov 30 14:15:44 PST 2012
On Fri, Nov 23, 2012 at 09:49:58PM -0500, Kristian Høgsberg wrote:
> 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
I ended up releasing 1.0.2 so that mesa can depend on this new entry
point. Ian said that he might do the 9.0.2 release next week, so I
decided to make a release. We had a few important fixes in the 1.0
branch and we can always make another 1.0.x release if something comes
up. As for using mesa with wayland master, I think we'll just bump
the git version to 1.1.0. That way an install of git master will
still satisfy the mesa configure check. We'll have to call the next
major release 1.2 instead of 1.1, but other than that this seem like
the simplest solution.
Kristian
More information about the wayland-devel
mailing list