Guarantee that the back buffer is validated by calling flush before
assigning the back buffer to current.

Signed-off-by: Mandeep Singh Baines <m...@chromium.org>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.olive...@intel.com>
Cc: Benjamin Franzke <benjaminfran...@googlemail.com>
Cc: Kristian Hogsberg <k...@bitplanet.net>
Cc: David Reveman <reve...@chromium.org>
Cc: Stephane Marchesin <marc...@chromium.org>
---
 src/egl/drivers/dri2/platform_drm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_drm.c 
b/src/egl/drivers/dri2/platform_drm.c
index 18ecd17..7b4529d 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -325,6 +325,8 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *draw)
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
 
+   (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
+
    if (dri2_surf->base.Type == EGL_WINDOW_BIT) {
       if (dri2_surf->current)
         _eglError(EGL_BAD_SURFACE, "dri2_swap_buffers");
@@ -332,7 +334,6 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *draw)
       dri2_surf->back = NULL;
    }
 
-   (*dri2_dpy->flush->flush)(dri2_surf->dri_drawable);
    (*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
 
    return EGL_TRUE;
-- 
1.7.3.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to