summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/xlib/glxapi.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2008-09-11 06:09:05 +1000
committerBen Skeggs <[email protected]>2008-09-11 06:09:05 +1000
commit7158203b081ad34c03382f07e0df748eae235e9b (patch)
treeee61efebbafb5464ec090c21b5e05533588789a1 /src/gallium/winsys/xlib/glxapi.c
parent02025148c28d03d644e3d66dde1a423fe21e1c44 (diff)
parenteb5b16d278e0f7ee0121049e43dfee1d52f2b0f7 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Conflicts: configs/default
Diffstat (limited to 'src/gallium/winsys/xlib/glxapi.c')
-rw-r--r--src/gallium/winsys/xlib/glxapi.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/src/gallium/winsys/xlib/glxapi.c b/src/gallium/winsys/xlib/glxapi.c
index c2ccce6f520..c059fc3edb5 100644
--- a/src/gallium/winsys/xlib/glxapi.c
+++ b/src/gallium/winsys/xlib/glxapi.c
@@ -37,6 +37,7 @@
#include "main/glheader.h"
#include "glapi/glapi.h"
#include "glxapi.h"
+#include "pipe/p_thread.h"
extern struct _glxapi_table *_real_GetGLXDispatchTable(void);
@@ -127,26 +128,13 @@ get_dispatch(Display *dpy)
/**
* GLX API current context.
*/
-#if defined(GLX_USE_TLS)
-PUBLIC __thread void * CurrentContext
- __attribute__((tls_model("initial-exec")));
-#elif defined(THREADS)
-static _glthread_TSD ContextTSD; /**< Per-thread context pointer */
-#else
-static GLXContext CurrentContext = 0;
-#endif
+pipe_tsd ContextTSD;
static void
SetCurrentContext(GLXContext c)
{
-#if defined(GLX_USE_TLS)
- CurrentContext = c;
-#elif defined(THREADS)
- _glthread_SetTSD(&ContextTSD, c);
-#else
- CurrentContext = c;
-#endif
+ pipe_tsd_set(&ContextTSD, c);
}
@@ -238,13 +226,7 @@ glXGetConfig(Display *dpy, XVisualInfo *visinfo, int attrib, int *value)
GLXContext PUBLIC
glXGetCurrentContext(void)
{
-#if defined(GLX_USE_TLS)
- return CurrentContext;
-#elif defined(THREADS)
- return (GLXContext) _glthread_GetTSD(&ContextTSD);
-#else
- return CurrentContext;
-#endif
+ return (GLXContext) pipe_tsd_get(&ContextTSD);
}