[Mesa-dev] [PATCH] egl_dri2: drm: make sure back buffer is validated before making current

Mandeep Singh Baines mandeep.baines at gmail.com
Fri Apr 13 07:36:20 PDT 2012


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

Signed-off-by: Mandeep Singh Baines <msb at chromium.org>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
Cc: Benjamin Franzke <benjaminfranzke at googlemail.com>
Cc: Kristian Hogsberg <krh at bitplanet.net>
Cc: David Reveman <reveman at chromium.org>
Cc: Stephane Marchesin <marcheu at 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



More information about the mesa-dev mailing list