Module: Mesa
Branch: 9.0
Commit: c7775e842bec815ede6badc35dbfe4991c183e3a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c7775e842bec815ede6badc35dbfe4991c183e3a

Author: Tapani Pälli <tapani.pa...@intel.com>
Date:   Mon Aug 13 16:47:52 2012 +0300

android: do not expose single buffered eglconfigs

On Android we want to add only double buffered configs for visuals.
Earlier implementation set the SurfaceType as 0 for single buffered
configs but driver still exposed these configs that were not compatible
with any egl surface type.  This caused Khronos conformance test runs to
fail on Android. This patch fixes the issue by skipping single buffered
configs earlier and not exposing them.

Signed-off-by: Tapani Pälli <tapani.pa...@intel.com>
Signed-off-by: Chad Versace <chad.vers...@linux.intel.com>
(cherry picked from commit d58ca43b809593314907694e744780ab9b28d590)

---

 src/egl/drivers/dri2/platform_android.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_android.c 
b/src/egl/drivers/dri2/platform_android.c
index 7e57295..15bf054 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -500,6 +500,14 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay 
*dpy)
       for (j = 0; dri2_dpy->driver_configs[j]; j++) {
          const EGLint surface_type = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
          struct dri2_egl_config *dri2_conf;
+         unsigned int double_buffered = 0;
+
+         dri2_dpy->core->getConfigAttrib(dri2_dpy->driver_configs[j],
+            __DRI_ATTRIB_DOUBLE_BUFFER, &double_buffered);
+
+         /* support only double buffered configs */
+         if (!double_buffered)
+            continue;
 
          dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
                count + 1, visuals[i].size, surface_type, NULL,
@@ -525,17 +533,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay 
*dpy)
       /* there is no front buffer so no OpenGL */
       dri2_conf->base.RenderableType &= ~EGL_OPENGL_BIT;
       dri2_conf->base.Conformant &= ~EGL_OPENGL_BIT;
-
-      /*
-       * We want to make sure GL_DRAW_BUFFER for windows or pbuffers is always
-       * GL_BACK.  For EGL configs that do not have a double DRI config, clear
-       * the surface type.
-       *
-       * This is just to be on the safe side.  dri2_add_config never sets
-       * EGL_WINDOW_BIT or EGL_PBUFFER_BIT for such configs.
-       */
-      if (!dri2_conf->dri_double_config)
-         dri2_conf->base.SurfaceType = 0;
    }
 
    return (count != 0);

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

Reply via email to