summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-11-10 01:17:13 -0500
committerMarek Olšák <[email protected]>2018-11-20 21:17:38 -0500
commit247d5a8e94787aad8a91f447853539f7932a99f5 (patch)
tree20eda9e5165f41ef093c60295aea2f1f64302143 /src
parent25d95ed5359b88b297277fceac7c33f35d1d59ba (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mapi/glapi/gen/gl_marshal.py2
-rw-r--r--src/mesa/main/glthread.c7
-rw-r--r--src/mesa/main/glthread.h2
-rw-r--r--src/mesa/main/marshal.c2
4 files changed, 8 insertions, 5 deletions
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));