On Wed, Dec 04, 2013 at 02:36:05PM +0000, Neil Roberts wrote: > I think this is a good idea. Imagine a simple game main loop like this: > > while (TRUE) { > do_some_game_logic(); > redraw(); > eglSwapBuffers(); > } > > In that case it wouldn't flush the commit until the right at the > beginning of each call to eglSwapBuffers when it waits for the frame > callback. Then it would have to block waiting for the compositor to > finish rendering before it receives the frame callback. If we dispatch > after the swap buffers then in this case the compositor could start > rendering while the game is in do_some_game_logic(). > > There was a similar patch proposed on the Mesa-dev mailing list here: > > http://lists.freedesktop.org/archives/mesa-dev/2013-August/043697.html > > That also points out the additional problem case where the rendering is > done in a separate thread. After the rendering is done potentially > nothing would wake up the main loop thread and cause a dispatch. > > That patch also moves the call to dri2_dpy->flush->flush further up. I'm > not sure if that is necessary. It also adds a pointer to the wl_display > in struct dri2_egl_surface which definitely looks unnecessary. So I > think Axel's patch makes more sense. > > Reviewed-by: Neil Roberts <n...@linux.intel.com>
Yup, let's do it then. I pushed the path to mesa master, with a Cc to the 10.0 branch. Kristian > Regards, > - Neil > > Axel Davy <axel.d...@ens.fr> writes: > > > We would like the compositor to receive the commited buffer > > as soon as possible, so it has the time to treat it, and > > release old ones. We shouldn't rely on the client > > to flush the queue for us. > > > > Signed-off-by: Axel Davy <axel.d...@ens.fr> > > --- > > We flush the wl_display after we flush the drawable. > > > > src/egl/drivers/dri2/platform_wayland.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/src/egl/drivers/dri2/platform_wayland.c > > b/src/egl/drivers/dri2/platform_wayland.c > > index 7e3733b..8c3d1f1 100644 > > --- a/src/egl/drivers/dri2/platform_wayland.c > > +++ b/src/egl/drivers/dri2/platform_wayland.c > > @@ -627,6 +627,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv, > > (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable); > > (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable); > > > > + wl_display_flush(dri2_dpy->wl_dpy); > > + > > return EGL_TRUE; > > } > > > > -- > > 1.8.1.2 > > > > _______________________________________________ > > wayland-devel mailing list > > wayland-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > _______________________________________________ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/wayland-devel _______________________________________________ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel