summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@collabora.com>2022-08-31 13:49:37 -0400
committerMarge Bot <emma+marge@anholt.net>2022-09-01 14:50:24 +0000
commitad5f0592cc4494c3c03f15aa20b01c60432b8a09 (patch)
tree063328b180bd29f164e132eb2d48accc4c114a1e
parente9b54e1000596fc253118c1067c90d111ca84404 (diff)
vc4: Use u_default_set_debug_callback
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Juan A. Suarez <jasuarez@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18351>
-rw-r--r--src/gallium/drivers/vc4/vc4_context.c14
-rw-r--r--src/gallium/drivers/vc4/vc4_context.h6
2 files changed, 4 insertions, 16 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.c b/src/gallium/drivers/vc4/vc4_context.c
index 50e5a632d8e..f03cf57cc14 100644
--- a/src/gallium/drivers/vc4/vc4_context.c
+++ b/src/gallium/drivers/vc4/vc4_context.c
@@ -84,18 +84,6 @@ vc4_texture_barrier(struct pipe_context *pctx, unsigned flags)
}
static void
-vc4_set_debug_callback(struct pipe_context *pctx,
- const struct util_debug_callback *cb)
-{
- struct vc4_context *vc4 = vc4_context(pctx);
-
- if (cb)
- vc4->debug = *cb;
- else
- memset(&vc4->debug, 0, sizeof(vc4->debug));
-}
-
-static void
vc4_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
{
struct vc4_context *vc4 = vc4_context(pctx);
@@ -172,7 +160,7 @@ vc4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
pctx->priv = priv;
pctx->destroy = vc4_context_destroy;
pctx->flush = vc4_pipe_flush;
- pctx->set_debug_callback = vc4_set_debug_callback;
+ pctx->set_debug_callback = u_default_set_debug_callback;
pctx->invalidate_resource = vc4_invalidate_resource;
pctx->texture_barrier = vc4_texture_barrier;
diff --git a/src/gallium/drivers/vc4/vc4_context.h b/src/gallium/drivers/vc4/vc4_context.h
index e3f2c66e957..62d537990be 100644
--- a/src/gallium/drivers/vc4/vc4_context.h
+++ b/src/gallium/drivers/vc4/vc4_context.h
@@ -30,6 +30,7 @@
#include "pipe/p_context.h"
#include "pipe/p_state.h"
#include "util/slab.h"
+#include "util/u_debug_cb.h"
#include "xf86drm.h"
#define __user
@@ -381,7 +382,6 @@ struct vc4_context {
struct pipe_viewport_state viewport;
struct vc4_constbuf_stateobj constbuf[PIPE_SHADER_TYPES];
struct vc4_vertexbuf_stateobj vertexbuf;
- struct util_debug_callback debug;
struct vc4_hwperfmon *perfmon;
/** @} */
@@ -428,8 +428,8 @@ struct vc4_depth_stencil_alpha_state {
#define perf_debug(...) do { \
if (VC4_DBG(PERF)) \
fprintf(stderr, __VA_ARGS__); \
- if (unlikely(vc4->debug.debug_message)) \
- util_debug_message(&vc4->debug, PERF_INFO, __VA_ARGS__); \
+ if (unlikely(vc4->base.debug.debug_message)) \
+ util_debug_message(&vc4->base.debug, PERF_INFO, __VA_ARGS__); \
} while (0)
static inline struct vc4_context *