From: Marek Olšák Date: Sat, 10 Nov 2018 06:17:13 +0000 (-0500) Subject: mesa/glthread: pass the function name to _mesa_glthread_restore_dispatch X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=247d5a8e94787aad8a91f447853539f7932a99f5;p=mesa.git mesa/glthread: pass the function name to _mesa_glthread_restore_dispatch If you insert printf there, you'll know why glthread was disabled. Reviewed-by: Timothy Arceri --- diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 5b35357ac54..4fd2bc2a5b9 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -249,7 +249,7 @@ class PrintCode(gl_XML.gl_print_base): out('if ({0}) {{'.format(func.marshal_fail)) with indent(): out('_mesa_glthread_finish(ctx);') - out('_mesa_glthread_restore_dispatch(ctx);') + out('_mesa_glthread_restore_dispatch(ctx, __func__);') self.print_sync_dispatch(func) out('return;') out('}') diff --git a/src/mesa/main/glthread.c b/src/mesa/main/glthread.c index 18a83bb9be4..145c5199978 100644 --- a/src/mesa/main/glthread.c +++ b/src/mesa/main/glthread.c @@ -121,11 +121,11 @@ _mesa_glthread_destroy(struct gl_context *ctx) free(glthread); ctx->GLThread = NULL; - _mesa_glthread_restore_dispatch(ctx); + _mesa_glthread_restore_dispatch(ctx, "destroy"); } void -_mesa_glthread_restore_dispatch(struct gl_context *ctx) +_mesa_glthread_restore_dispatch(struct gl_context *ctx, const char *func) { /* Remove ourselves from the dispatch table except if another ctx/thread * already installed a new dispatch table. @@ -136,6 +136,9 @@ _mesa_glthread_restore_dispatch(struct gl_context *ctx) if (_glapi_get_dispatch() == ctx->MarshalExec) { ctx->CurrentClientDispatch = ctx->CurrentServerDispatch; _glapi_set_dispatch(ctx->CurrentClientDispatch); +#if 0 + printf("glthread disabled: %s\n", func); +#endif } } diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h index 8cd5d022674..59cb95feb4a 100644 --- a/src/mesa/main/glthread.h +++ b/src/mesa/main/glthread.h @@ -99,7 +99,7 @@ struct glthread_state void _mesa_glthread_init(struct gl_context *ctx); void _mesa_glthread_destroy(struct gl_context *ctx); -void _mesa_glthread_restore_dispatch(struct gl_context *ctx); +void _mesa_glthread_restore_dispatch(struct gl_context *ctx, const char *func); void _mesa_glthread_flush_batch(struct gl_context *ctx); void _mesa_glthread_finish(struct gl_context *ctx); diff --git a/src/mesa/main/marshal.c b/src/mesa/main/marshal.c index 8f8e8c78ed2..1827585ef0a 100644 --- a/src/mesa/main/marshal.c +++ b/src/mesa/main/marshal.c @@ -89,7 +89,7 @@ _mesa_marshal_Enable(GLenum cap) if (cap == GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB) { _mesa_glthread_finish(ctx); - _mesa_glthread_restore_dispatch(ctx); + _mesa_glthread_restore_dispatch(ctx, "Enable(DEBUG_OUTPUT_SYNCHRONOUS)"); } else { cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Enable, sizeof(*cmd));