[PATCH 3/3] egl_dri2: make swrast always double buffered

Haitao Feng haitao.feng at intel.com
Wed Feb 9 11:52:59 PST 2011


Signed-off-by: Haitao Feng <haitao.feng at intel.com>
---
 src/egl/drivers/dri2/egl_dri2.c     |    7 ++++---
 src/egl/drivers/dri2/platform_x11.c |    1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 919b996..ffd97a5 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -157,14 +157,15 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
       }
    }
 
-   /* In EGL, double buffer or not isn't a config attribute.  Pixmaps
+   /* In EGL, for dri2, double buffer or not isn't a config attribute.  Pixmaps
     * surfaces are always single buffered, pbuffer surfaces are always
     * back buffers and windows can be either, selected by passing an
     * attribute at window surface construction time.  To support this
     * we ignore all double buffer configs and manipulate the buffer we
-    * return in the getBuffer callback to get the behaviour we want. */
+    * return in the getBuffer callback to get the behaviour we want. 
+    * for swrast, all surfaces are always double buffered */
 
-   if (double_buffer)
+   if ((dri2_dpy->dri2 && double_buffer) || (dri2_dpy->swrast && !double_buffer))
       return NULL;
 
    if (depth > 0 && depth != base.BufferSize)
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index d138763..8147e12 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -23,6 +23,7 @@
  *
  * Authors:
  *    Kristian Høgsberg <krh at bitplanet.net>
+ *    Haitao Feng <haitao.feng at intel.com>
  */
 
 #include <stdlib.h>
-- 
1.7.1



More information about the mesa-dev mailing list