diff options
author | Daniel Drake <dsd@laptop.org> | 2008-07-24 21:06:34 -0500 |
---|---|---|
committer | Daniel Drake <dsd@gentoo.org> | 2008-07-24 21:06:34 -0500 |
commit | eff25430b4a391409e39337962ff7697165d23c7 (patch) | |
tree | d20cf4012009a856dbf1b607c42b9b22da1e9965 /glx/glxext.c | |
parent | 62b5690415786c4a6e8bac464aa8db578beb74f5 (diff) |
Don't abort if swrast library is not present
GLX is enabled by default, but the current swrast behaviour causes X
to abort with fatal error if the swrast dri library dlopen fails.
Handle the case where the swrast library is not present, and do not
register the GLX extension unless at least one screen has a usable
GL provider.
Diffstat (limited to 'glx/glxext.c')
-rw-r--r-- | glx/glxext.c | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/glx/glxext.c b/glx/glxext.c index 13c65dade..6ba404fb1 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -279,6 +279,7 @@ void GlxExtensionInit(void) ScreenPtr pScreen; int i; __GLXprovider *p; + Bool glx_provided = False; __glXContextRes = CreateNewResourceType((DeleteType)ContextGone); __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone); @@ -289,6 +290,29 @@ void GlxExtensionInit(void) if (!AddCallback (&ClientStateCallback, glxClientCallback, 0)) return; + for (i = 0; i < screenInfo.numScreens; i++) { + pScreen = screenInfo.screens[i]; + + for (p = __glXProviderStack; p != NULL; p = p->next) { + if (p->screenProbe(pScreen) != NULL) { + LogMessage(X_INFO, + "GLX: Initialized %s GL provider for screen %d\n", + p->name, i); + break; + } + } + + if (!p) + LogMessage(X_INFO, + "GLX: no usable GL providers found for screen %d\n", i); + else + glx_provided = True; + } + + /* don't register extension if GL is not provided on any screen */ + if (!glx_provided) + return; + /* ** Add extension to server extensions. */ @@ -306,19 +330,6 @@ void GlxExtensionInit(void) } __glXErrorBase = extEntry->errorBase; - - for (i = 0; i < screenInfo.numScreens; i++) { - pScreen = screenInfo.screens[i]; - - for (p = __glXProviderStack; p != NULL; p = p->next) { - if (p->screenProbe(pScreen) != NULL) { - LogMessage(X_INFO, - "GLX: Initialized %s GL provider for screen %d\n", - p->name, i); - break; - } - } - } } /************************************************************************/ |