From 25fe93f0a11e6f4c8d470441ff91b9cddf7b3023 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 13 Apr 2005 20:59:15 +0000 Subject: 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. --- src/glx/x11/dri_glx.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/glx') diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index b703c4fa9e..7ac80eb74d 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); -- cgit v1.2.3