[Mesa-dev] [PATCH] mesa/glthread: print out syncs when MARSHAL_MAX_CMD_SIZE is exceeded

Nicolai Hähnle nhaehnle at gmail.com
Wed Mar 29 10:21:48 UTC 2017


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 29.03.2017 04:20, Timothy Arceri wrote:
> ---
>  src/mapi/glapi/gen/gl_marshal.py |  1 +
>  src/mesa/main/marshal.h          | 13 +++++++++++++
>  2 files changed, 14 insertions(+)
>
> diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py
> index c89d397..9639f9c 100644
> --- a/src/mapi/glapi/gen/gl_marshal.py
> +++ b/src/mapi/glapi/gen/gl_marshal.py
> @@ -84,20 +84,21 @@ class PrintCode(gl_XML.gl_print_base):
>      def print_sync_call(self, func):
>          call = 'CALL_{0}(ctx->CurrentServerDispatch, ({1}))'.format(
>              func.name, func.get_called_parameter_string())
>          if func.return_type == 'void':
>              out('{0};'.format(call))
>          else:
>              out('return {0};'.format(call))
>
>      def print_sync_dispatch(self, func):
>          out('_mesa_glthread_finish(ctx);')
> +        out('debug_print_sync_fallback("{0}");'.format(func.name))
>          self.print_sync_call(func)
>
>      def print_sync_body(self, func):
>          out('/* {0}: marshalled synchronously */'.format(func.name))
>          out('static {0} GLAPIENTRY'.format(func.return_type))
>          out('_mesa_marshal_{0}({1})'.format(func.name, func.get_parameter_string()))
>          out('{')
>          with indent():
>              out('GET_CURRENT_CONTEXT(ctx);')
>              out('_mesa_glthread_finish(ctx);')
> diff --git a/src/mesa/main/marshal.h b/src/mesa/main/marshal.h
> index 8ea303a..3ef5591 100644
> --- a/src/mesa/main/marshal.h
> +++ b/src/mesa/main/marshal.h
> @@ -113,20 +113,33 @@ _mesa_glthread_is_non_vbo_vertex_attrib_pointer(const struct gl_context *ctx)
>  static inline bool
>  _mesa_glthread_is_non_vbo_draw_elements(const struct gl_context *ctx)
>  {
>     return false;
>  }
>
>  #endif
>
>  #define DEBUG_MARSHAL_PRINT_CALLS 0
>
> +/**
> + * This is printed when we have fallen back to a sync. This can happen when
> + * MARSHAL_MAX_CMD_SIZE is exceeded.
> + */
> +static inline void
> +debug_print_sync_fallback(const char *func)
> +{
> +#if DEBUG_MARSHAL_PRINT_CALLS
> +   printf("fallback to sync: %s\n", func);
> +#endif
> +}
> +
> +
>  static inline void
>  debug_print_sync(const char *func)
>  {
>  #if DEBUG_MARSHAL_PRINT_CALLS
>     printf("sync: %s\n", func);
>  #endif
>  }
>
>  static inline void
>  debug_print_marshal(const char *func)
>


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list