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>
This commit is contained in:
Alyssa Rosenzweig 2022-08-31 14:29:19 -04:00 committed by Marge Bot
parent 161e35e156
commit a7aa8fbf7a
3 changed files with 6 additions and 10 deletions

View file

@ -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 *

View file

@ -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 */

View file

@ -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,