[Mesa-dev] [PATCH] egl_dri2: drm: make sure back buffer is validated before making current
Mandeep Baines
mandeep.baines at gmail.com
Fri Apr 13 07:56:01 PDT 2012
On Fri, Apr 13, 2012 at 7:36 AM, Mandeep Singh Baines
<mandeep.baines at gmail.com> wrote:
> Guarantee that the back buffer is validated by calling flush before
> assigning the back buffer to current.
>
Attached is an app which reproduces the bug.
> 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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eglkms.c
Type: text/x-csrc
Size: 8642 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120413/61a770bf/attachment-0001.c>
More information about the mesa-dev
mailing list