[Mesa-dev] [PATCH] mesa: remove remaining uses of _glthread_GetID()
Jose Fonseca
jfonseca at vmware.com
Wed Mar 5 07:23:35 PST 2014
----- Original Message -----
> It was really only used in the radeon driver for a debug printf.
> And evidently, libGL.so referenced it just to work around some sort
> of linker issue.
>
> This patch removes the two calls to the function and the function
> itself.
>
> Fixes undefined _glthread_GetID symbol in libGL reported by 'nm'.
> Though, the missing symbol doesn't cause any issues on my system but
> it does cause glxinfo to fail on one of our test systems.
> ---
> src/glx/glxcurrent.c | 10 ----------
> src/mapi/glapi/glapi.h | 4 ----
> src/mapi/mapi_glapi.c | 6 ------
> src/mapi/u_thread.h | 4 ++--
> src/mesa/drivers/dri/common/dri_test.c | 6 ------
> src/mesa/drivers/dri/radeon/radeon_fbo.c | 3 +--
> 6 files changed, 3 insertions(+), 30 deletions(-)
>
> diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
> index a6884cf..2e5111b 100644
> --- a/src/glx/glxcurrent.c
> +++ b/src/glx/glxcurrent.c
> @@ -213,16 +213,6 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
> struct glx_context *gc = (struct glx_context *) gc_user;
> struct glx_context *oldGC = __glXGetCurrentContext();
>
> - /* XXX: If this is left out, then libGL ends up not having this
> - * symbol, and drivers using it fail to load. Compare the
> - * implementation of this symbol to _glapi_noop_enable_warnings(),
> - * though, which gets into the library despite no callers, the same
> - * prototypes, and the same compile flags to the files containing
> - * them. Moving the definition to glapi_nop.c gets it into the
> - * library, though.
> - */
> - (void)_glthread_GetID();
> -
> /* Make sure that the new context has a nonzero ID. In the request,
> * a zero context ID is used only to mean that we bind to no current
> * context.
> diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
> index dcf91a7..7c22985 100644
> --- a/src/mapi/glapi/glapi.h
> +++ b/src/mapi/glapi/glapi.h
> @@ -168,10 +168,6 @@ _GLAPI_EXPORT struct _glapi_table *
> _glapi_create_table_from_handle(void *handle, const char *symbol_prefix);
>
>
> -_GLAPI_EXPORT unsigned long
> -_glthread_GetID(void);
> -
> -
> /*
> * These stubs are kept so that the old DRI drivers still load.
> */
> diff --git a/src/mapi/mapi_glapi.c b/src/mapi/mapi_glapi.c
> index 7b9f1ae..925caf3 100644
> --- a/src/mapi/mapi_glapi.c
> +++ b/src/mapi/mapi_glapi.c
> @@ -222,12 +222,6 @@ _glapi_get_proc_name(unsigned int offset)
> return stub ? stub_get_name(stub) : NULL;
> }
>
> -unsigned long
> -_glthread_GetID(void)
> -{
> - return u_thread_self();
> -}
> -
> void
> _glapi_noop_enable_warnings(unsigned char enable)
> {
> diff --git a/src/mapi/u_thread.h b/src/mapi/u_thread.h
> index 3e18358..0fc9392 100644
> --- a/src/mapi/u_thread.h
> +++ b/src/mapi/u_thread.h
> @@ -101,8 +101,8 @@ u_thread_self(void)
> * So for now, we side-step this mess and use Windows thread primitives
> * directly here.
> *
> - * FIXME: On the other hand, u_thread_self() and _glthread_GetID() are
> bad
> - * abstractions. Even with pthreads, there is no guarantee that
> + * FIXME: On the other hand, u_thread_self() is a bad
> + * abstraction. Even with pthreads, there is no guarantee that
> * pthread_self() will return numeric IDs -- we should be using
> * pthread_equal() instead of assuming we can compare thread ids...
> */
> diff --git a/src/mesa/drivers/dri/common/dri_test.c
> b/src/mesa/drivers/dri/common/dri_test.c
> index 3573285..7ab50d9 100644
> --- a/src/mesa/drivers/dri/common/dri_test.c
> +++ b/src/mesa/drivers/dri/common/dri_test.c
> @@ -76,12 +76,6 @@ _glapi_get_dispatch_table_size(void)
> return 0;
> }
>
> -PUBLIC unsigned long
> -_glthread_GetID(void)
> -{
> - return 0;
> -}
> -
> #ifndef NO_MAIN
> int main(int argc, char** argv)
> {
> diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c
> b/src/mesa/drivers/dri/radeon/radeon_fbo.c
> index 537ab49..12ad438 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
> @@ -783,8 +783,7 @@ radeon_render_texture(struct gl_context * ctx,
> return;
> }
>
> - DBG("Begin render texture tid %lx tex=%u w=%d h=%d refcount=%d\n",
> - _glthread_GetID(),
> + DBG("Begin render texture tex=%u w=%d h=%d refcount=%d\n",
> att->Texture->Name, newImage->Width, newImage->Height,
> rb->RefCount);
>
> --
> 1.7.10.4
>
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
More information about the mesa-dev
mailing list