diff options
author | Daniel Drake <dsd@laptop.org> | 2008-07-24 21:06:34 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-08-29 14:38:43 -0400 |
commit | 05472534cfefe6057b908cc7d698967eecb5dde4 (patch) | |
tree | 386616182ef341169dfb38ff57ce64e0d9d44708 /glx | |
parent | 4652c51e92ab21df020f83be3dc1ca1c897f6cf9 (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.
(cherry picked from commit eff25430b4a391409e39337962ff7697165d23c7)
Diffstat (limited to 'glx')
-rw-r--r-- | glx/glxdriswrast.c | 2 | ||||
-rw-r--r-- | glx/glxext.c | 37 |
2 files changed, 25 insertions, 14 deletions
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c index 9d987c238..f36dae739 100644 --- a/glx/glxdriswrast.c +++ b/glx/glxdriswrast.c @@ -532,7 +532,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) xfree(screen); - FatalError("GLX: could not load software renderer\n"); + LogMessage(X_ERROR, "GLX: could not load software renderer\n"); return NULL; } 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; - } - } - } } /************************************************************************/ |