Mesa (10.0): egl/wayland: Send commit after flushing the driver context

Carl Worth cworth at kemper.freedesktop.org
Fri Dec 13 04:22:07 UTC 2013


Module: Mesa
Branch: 10.0
Commit: 1919ec6ba43a8fb229495e2ebb87789fb11ffb8c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1919ec6ba43a8fb229495e2ebb87789fb11ffb8c

Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Wed Dec  4 12:08:35 2013 -0800

egl/wayland: Send commit after flushing the driver context

This typically won't make a difference, since we only send the requests at
wl_display_flush() time.  There might be a small race
with another thread calling wl_display_flush() after our commit request,
but before we flush the DRI driver.  Moving the commit below the DRI
driver flush call looks more natural and eliminates the small race.

Cc: "10.0" mesa-stable at lists.freedesktop.org
(cherry picked from commit 33eb5eabeec0c17e81b6bb11be703701e4025d4e)

---

 src/egl/drivers/dri2/platform_wayland.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index d28fb72..82be48f 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -610,11 +610,10 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
       }
    }
 
-   wl_surface_commit(dri2_surf->wl_win->surface);
-
    (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
    (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
 
+   wl_surface_commit(dri2_surf->wl_win->surface);
    wl_display_flush(dri2_dpy->wl_dpy);
 
    return EGL_TRUE;




More information about the mesa-commit mailing list