diff options
author | Ian Romanick <[email protected]> | 2005-04-13 20:59:15 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-04-13 20:59:15 +0000 |
commit | 25fe93f0a11e6f4c8d470441ff91b9cddf7b3023 (patch) | |
tree | fc8e2b7c9509abef30425ecf49aebaf281614a6f /src/glx/x11/dri_glx.c | |
parent | c604e457d1ebe9a884b0a1fb08af38a0ce486699 (diff) |
Add TLS support to libGL and, by virtue of using glthread.h and GL_CALL, all
DRI drivers. A TLS enabled libGL can load a TLS or a non-TLS DRI driver,
but a TLS DRI driver requires a TLS enabled libGL.
This fixes bug #1822.
Diffstat (limited to 'src/glx/x11/dri_glx.c')
-rw-r--r-- | src/glx/x11/dri_glx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index b703c4fa9eb..7ac80eb74d7 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -222,6 +222,15 @@ static __DRIdriver *OpenDriver(const char *driverName) void *handle = NULL; + /* If TLS support is enabled, try to open the TLS version of the driver + * binary first. If that fails, try the non-TLS version. + */ +#ifdef GLX_USE_TLS + snprintf(realDriverName, 200, "%s/tls/%s_dri.so", libDir, driverName); + InfoMessageF("OpenDriver: trying %s\n", realDriverName); + handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL); +#endif + if ( handle == NULL ) { snprintf(realDriverName, 200, "%s/%s_dri.so", libDir, driverName); InfoMessageF("OpenDriver: trying %s\n", realDriverName); |