xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Thu May 22 18:08:36 PDT 2014


 glx/glxext.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

New commits:
commit db2e708f31a162c6c66643d3559dd5f3e21ee06b
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Sep 27 17:44:42 2012 -0400

    glx: Require at least one True/DirectColor visual
    
    Mesa no longer supports rendering to anything less.  GLX 1.2 requires
    that the server advertise at least one GLX visual.  GLX 1.3 and 1.4 are
    more subtle: they require at least one fbconfig capable of window
    rendering, and _also_ require that window-capable fbconfigs have a
    non-zero value for the GLX_VISUAL_ID.  In either case we should refuse
    to init GLX if there's not at least one GL-capable visual on at least
    one screen.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxext.c b/glx/glxext.c
index c0142fe..c2de3ce 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -316,6 +316,23 @@ GlxPushProvider(__GLXprovider * provider)
     __glXProviderStack = provider;
 }
 
+static Bool
+checkScreenVisuals(void)
+{
+    int i, j;
+
+    for (i = 0; i < screenInfo.numScreens; i++) {
+        ScreenPtr screen = screenInfo.screens[i];
+        for (j = 0; j < screen->numVisuals; j++) {
+            if (screen->visuals[j].class == TrueColor ||
+                screen->visuals[j].class == DirectColor)
+                return True;
+        }
+    }
+
+    return False;
+}
+
 /*
 ** Initialize the GLX extension.
 */
@@ -334,6 +351,10 @@ GlxExtensionInit(void)
         *stack = &__glXDRISWRastProvider;
     }
 
+    /* Mesa requires at least one True/DirectColor visual */
+    if (!checkScreenVisuals())
+        return;
+
     __glXContextRes = CreateNewResourceType((DeleteType) ContextGone,
                                             "GLXContext");
     __glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone,


More information about the xorg-commit mailing list