diff options
author | Alyssa Rosenzweig <alyssa@collabora.com> | 2022-08-31 14:29:19 -0400 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-09-01 14:50:24 +0000 |
commit | a7aa8fbf7a19d612015aa7e853e745df6a4e7447 (patch) | |
tree | 99fbd167cdbc0cc4fe6745ad70bcbaa999963030 | |
parent | 161e35e156c21802687d8ac69f266591110e4abd (diff) |
etnaviv: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_context.c | 11 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_shader.c | 4 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c index f66587711bc..65073a0170f 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.c +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c @@ -55,6 +55,7 @@ #include "util/u_memory.h" #include "util/u_prim.h" #include "util/u_upload_mgr.h" +#include "util/u_debug_cb.h" #include "hw/common.xml.h" @@ -164,7 +165,7 @@ etna_get_vs(struct etna_context *ctx, struct etna_shader_key key) { const struct etna_shader_variant *old = ctx->shader.vs; - ctx->shader.vs = etna_shader_variant(ctx->shader.bind_vs, key, &ctx->debug); + ctx->shader.vs = etna_shader_variant(ctx->shader.bind_vs, key, &ctx->base.debug); if (!ctx->shader.vs) return false; @@ -200,7 +201,7 @@ etna_get_fs(struct etna_context *ctx, struct etna_shader_key key) } } - ctx->shader.fs = etna_shader_variant(ctx->shader.bind_fs, key, &ctx->debug); + ctx->shader.fs = etna_shader_variant(ctx->shader.bind_fs, key, &ctx->base.debug); if (!ctx->shader.fs) return false; @@ -552,11 +553,7 @@ etna_set_debug_callback(struct pipe_context *pctx, struct etna_screen *screen = ctx->screen; util_queue_finish(&screen->shader_compiler_queue); - - if (cb) - ctx->debug = *cb; - else - memset(&ctx->debug, 0, sizeof(ctx->debug)); + u_default_set_debug_callback(pctx, cb); } struct pipe_context * diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.h b/src/gallium/drivers/etnaviv/etnaviv_context.h index 8ab37ba33f0..c1fcd9c5972 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.h +++ b/src/gallium/drivers/etnaviv/etnaviv_context.h @@ -187,7 +187,6 @@ struct etna_context { uint64_t rs_operations; } stats; - struct util_debug_callback debug; int in_fence_fd; /* list of accumulated HW queries */ diff --git a/src/gallium/drivers/etnaviv/etnaviv_shader.c b/src/gallium/drivers/etnaviv/etnaviv_shader.c index 7b9c6fa2e95..804b7c48253 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_shader.c +++ b/src/gallium/drivers/etnaviv/etnaviv_shader.c @@ -461,7 +461,7 @@ etna_shader_variant(struct etna_shader *shader, struct etna_shader_key key, static inline bool initial_variants_synchronous(struct etna_context *ctx) { - return unlikely(ctx->debug.debug_message) || (etna_mesa_debug & ETNA_DBG_SHADERDB); + return unlikely(ctx->base.debug.debug_message) || (etna_mesa_debug & ETNA_DBG_SHADERDB); } static void @@ -498,7 +498,7 @@ etna_create_shader_state(struct pipe_context *pctx, if (initial_variants_synchronous(ctx)) { struct etna_shader_key key = {}; - etna_shader_variant(shader, key, &ctx->debug); + etna_shader_variant(shader, key, &ctx->base.debug); } else { struct etna_screen *screen = ctx->screen; util_queue_add_job(&screen->shader_compiler_queue, shader, &shader->ready, |