From: Marek Olšák Date: Wed, 19 Feb 2020 22:29:14 +0000 (-0500) Subject: glthread: don't insert _mesa_post_marshal_hook into every function X-Git-Tag: upstream/20.1.8~2814 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19dc528bbf74cb823c87420ee3e5b8cb6495a199;p=platform%2Fupstream%2Fmesa.git glthread: don't insert _mesa_post_marshal_hook into every function Let the developer decide that in the python script. Reviewed-by: Timothy Arceri Part-of: --- diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 5f4787c..261213b7 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -131,7 +131,9 @@ class PrintCode(gl_XML.gl_print_base): if not func.fixed_params and not func.variable_params: out('(void) cmd;\n') - out('_mesa_post_marshal_hook(ctx);') + + # Uncomment this if you want to call _mesa_glthread_finish for debugging + #out('_mesa_glthread_finish(ctx);') def print_async_struct(self, func): out('struct marshal_cmd_{0}'.format(func.name)) diff --git a/src/mesa/main/marshal.c b/src/mesa/main/marshal.c index e0d423a..28054d2 100644 --- a/src/mesa/main/marshal.c +++ b/src/mesa/main/marshal.c @@ -32,6 +32,17 @@ #include "marshal.h" #include "dispatch.h" +static inline void +_mesa_post_marshal_hook(struct gl_context *ctx) +{ + /* This can be enabled for debugging whether a failure is a synchronization + * problem between the main thread and the worker thread, or a failure in + * how we actually marshal. + */ + if (false) + _mesa_glthread_finish(ctx); +} + struct marshal_cmd_Flush { struct marshal_cmd_base cmd_base; diff --git a/src/mesa/main/marshal.h b/src/mesa/main/marshal.h index 10c5083..c15253f 100644 --- a/src/mesa/main/marshal.h +++ b/src/mesa/main/marshal.h @@ -132,17 +132,6 @@ debug_print_marshal(const char *func) struct _glapi_table * _mesa_create_marshal_table(const struct gl_context *ctx); -static inline void -_mesa_post_marshal_hook(struct gl_context *ctx) -{ - /* This can be enabled for debugging whether a failure is a synchronization - * problem between the main thread and the worker thread, or a failure in - * how we actually marshal. - */ - if (false) - _mesa_glthread_finish(ctx); -} - /** * Checks whether we're on a compat context for code-generated