Mesa (7.9): egl_glx: Fix borken driver.

Chia-I Wu olv at kemper.freedesktop.org
Wed Jan 5 02:55:34 PST 2011


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

Author: Chia-I Wu <olv at lunarg.com>
Date:   Wed Jan  5 18:51:39 2011 +0800

egl_glx: Fix borken driver.

The driver was broken since 6eda3f311bc24999835003e404d5eda5599bc5de.
All configs fail to pass _eglValidateConfig.  This fix might not be
complete, but at least EGL demos run.

This fixes bug #32825.

---

 src/egl/drivers/glx/egl_glx.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c
index b2076e2..9805598 100644
--- a/src/egl/drivers/glx/egl_glx.c
+++ b/src/egl/drivers/glx/egl_glx.c
@@ -142,7 +142,6 @@ static const struct {
    { GLX_STENCIL_SIZE,			EGL_STENCIL_SIZE },
    { GLX_SAMPLE_BUFFERS,		EGL_SAMPLE_BUFFERS },
    { GLX_SAMPLES,			EGL_SAMPLES },
-   { GLX_RENDER_TYPE,			EGL_RENDERABLE_TYPE },
    { GLX_X_RENDERABLE,			EGL_NATIVE_RENDERABLE },
    { GLX_X_VISUAL_TYPE,			EGL_NATIVE_VISUAL_TYPE },
    { GLX_CONFIG_CAVEAT,			EGL_CONFIG_CAVEAT },
@@ -218,6 +217,16 @@ convert_fbconfig(Display *dpy, GLXFBConfig fbconfig,
 
    _eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
 
+   _eglSetConfigKey(&GLX_conf->Base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
+
+   glXGetFBConfigAttrib(dpy, fbconfig, GLX_TRANSPARENT_TYPE, &val);
+   if (val == GLX_NONE) {
+      _eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_TYPE, EGL_NONE);
+      _eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_RED_VALUE, 0);
+      _eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_GREEN_VALUE, 0);
+      _eglSetConfigKey(&GLX_conf->Base, EGL_TRANSPARENT_BLUE_VALUE, 0);
+   }
+
    return EGL_TRUE;
 }
 
@@ -294,6 +303,7 @@ convert_visual(Display *dpy, XVisualInfo *vinfo,
       surface_type |= EGL_PIXMAP_BIT;
 
    _eglSetConfigKey(&GLX_conf->Base, EGL_SURFACE_TYPE, surface_type);
+   _eglSetConfigKey(&GLX_conf->Base, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT);
 
    _eglSetConfigKey(&GLX_conf->Base, EGL_NATIVE_RENDERABLE, EGL_TRUE);
 



More information about the mesa-commit mailing list