mesa/glthread: pass the function name to _mesa_glthread_restore_dispatch
authorMarek Olšák <marek.olsak@amd.com>
Sat, 10 Nov 2018 06:17:13 +0000 (01:17 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 21 Nov 2018 02:17:38 +0000 (21:17 -0500)
If you insert printf there, you'll know why glthread was disabled.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mapi/glapi/gen/gl_marshal.py
src/mesa/main/glthread.c
src/mesa/main/glthread.h
src/mesa/main/marshal.c

index 5b35357ac548dc358f2e9c05f969f325dad70319..4fd2bc2a5b9143dee0b0f00d31cc0b1d8b2955f7 100644 (file)
@@ -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('}')
index 18a83bb9be47c41fdb945f2ae60da4bd2525c92e..145c5199978052b66a764778c26786a50c41c2c9 100644 (file)
@@ -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
    }
 }
 
index 8cd5d0226743d92dacf35600f83a78ee62e9920e..59cb95feb4a0bc4a09c0ac3de757c12423e49a19 100644 (file)
@@ -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);
 
index 8f8e8c78ed21e23ef5dcedb2a4d560959efd78f7..1827585ef0a458fd9bcbde66de9c1393269df302 100644 (file)
@@ -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));