xserver: Branch 'server-1.5-branch'

Adam Jackson ajax at kemper.freedesktop.org
Fri May 16 06:50:04 PDT 2008


 GL/glx/glxscreens.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 18a1d643bc82f15ad26059e2a479f5d5dd778343
Author: Hans de Goede <j.w.r.degoede at hhs.nl>
Date:   Wed Apr 23 12:28:30 2008 -0400

    Prefer glxvisuals with stencil buffer for default visuals
    
    The first fbconfig which has a depthbuffer > 0  and doublebuf is choosen
    when associating fbconfigs with the visuals, indepenent of stencil bits.
    This happens to work ok on intel as there all fbconfigs with a
    depthbuffer > 0 also have stencil bits.
    
    This patch fixes this by first trying to get a fbconfig for default X visuals
    with both stencilbuf, depthbuf and doublebuffering, and if that fails fallback
    to trying to get one with only a depthbuf and doublebuffering.
    (cherry picked from commit f6e22d69af6bc8f63c3a46535a09e217696a679f)

diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index 41ee029..5859de0 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -437,6 +437,7 @@ initGlxVisual(VisualPtr visual, __GLXconfig *config)
 typedef struct {
     GLboolean doubleBuffer;
     GLboolean depthBuffer;
+    GLboolean stencilBuffer;
 } FBConfigTemplateRec, *FBConfigTemplatePtr;
 
 static __GLXconfig *
@@ -453,6 +454,8 @@ pickFBConfig(__GLXscreen *pGlxScreen, FBConfigTemplatePtr template, int class)
 	    continue;
 	if ((config->depthBits > 0) != template->depthBuffer)
 	    continue;
+	if ((config->stencilBits > 0) != template->stencilBuffer)
+	    continue;
 
 	return config;
     }
@@ -466,8 +469,9 @@ addMinimalSet(__GLXscreen *pGlxScreen)
     __GLXconfig *config;
     VisualPtr visuals;
     int i, j;
-    FBConfigTemplateRec best = { GL_TRUE, GL_TRUE };
-    FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE };
+    FBConfigTemplateRec best = { GL_TRUE, GL_TRUE, GL_TRUE };
+    FBConfigTemplateRec good = { GL_TRUE, GL_TRUE, GL_FALSE };
+    FBConfigTemplateRec minimal = { GL_FALSE, GL_FALSE, GL_FALSE };
 
     pGlxScreen->visuals = xcalloc(pGlxScreen->pScreen->numVisuals,
 				  sizeof (__GLXconfig *));
@@ -480,8 +484,11 @@ addMinimalSet(__GLXscreen *pGlxScreen)
     for (i = 0, j = 0; i < pGlxScreen->pScreen->numVisuals; i++) {
 	if (visuals[i].nplanes == 32)
 	    config = pickFBConfig(pGlxScreen, &minimal, visuals[i].class);
-	else
+	else {
 	    config = pickFBConfig(pGlxScreen, &best, visuals[i].class);
+	    if (config == NULL)
+		config = pickFBConfig(pGlxScreen, &good, visuals[i].class);
+        }
 	if (config == NULL)
 	    config = pGlxScreen->fbconfigs;
 	if (config == NULL)


More information about the xorg-commit mailing list