summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorGeorge Sapountzis <[email protected]>2010-03-27 14:06:05 +0200
committerGeorge Sapountzis <[email protected]>2010-03-27 14:06:05 +0200
commit29ec84b0a80e1fe2e6f58f91ab63f2f9ebd012a6 (patch)
tree6a22dc9fffda4c67cc188ce36fc1e62c37d25f58 /src/glx
parentc8844c5549dec7e9c47ab49d6e229980f62da74d (diff)
glx: try swrastg_dri, if swrast_dri fails
This needs a patch for xserver/glx also. An enviroment variable will be added at some point, it chould be for swrastg only or all gallium drivers.
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/drisw_glx.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 3db2d63f1f7..99f8f2cbf06 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -360,6 +360,20 @@ driDestroyScreen(__GLXscreenConfigs * psc)
dlclose(psc->driver);
}
+static void *
+driOpenSwrast(void)
+{
+ void *driver = NULL;
+
+ if (driver == NULL)
+ driver = driOpenDriver("swrast");
+
+ if (driver == NULL)
+ driver = driOpenDriver("swrastg");
+
+ return driver;
+}
+
static __GLXDRIscreen *
driCreateScreen(__GLXscreenConfigs * psc, int screen,
__GLXdisplayPrivate * priv)
@@ -367,14 +381,13 @@ driCreateScreen(__GLXscreenConfigs * psc, int screen,
__GLXDRIscreen *psp;
const __DRIconfig **driver_configs;
const __DRIextension **extensions;
- const char *driverName = "swrast";
int i;
psp = Xcalloc(1, sizeof *psp);
if (psp == NULL)
return NULL;
- psc->driver = driOpenDriver(driverName);
+ psc->driver = driOpenSwrast();
if (psc->driver == NULL)
goto handle_error;