aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx')
-rw-r--r--xorg-server/glx/glxext.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index c0142fe2e..c2de3cedd 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/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,