From ff900ceffec057cf7b3289a39e38fd39e1a108d8 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 8 Nov 2023 22:27:37 +0900 Subject: [PATCH] asahi: Enable scratch debugging Via ASAHI_MESA_DEBUG=scratch. This will assert if enabled and the scratch workgroup allocation count turns out not to be sufficient (that is, there were failed allocations), to help debug the max occupancy calculation. Signed-off-by: Asahi Lina Part-of: --- src/gallium/drivers/asahi/agx_batch.c | 2 +- src/gallium/drivers/asahi/agx_pipe.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/asahi/agx_batch.c b/src/gallium/drivers/asahi/agx_batch.c index dc48830b9f9..4be6df6a70c 100644 --- a/src/gallium/drivers/asahi/agx_batch.c +++ b/src/gallium/drivers/asahi/agx_batch.c @@ -666,7 +666,7 @@ agx_batch_submit(struct agx_context *ctx, struct agx_batch *batch, free(in_syncs); free(shared_bos); - if (dev->debug & (AGX_DBG_TRACE | AGX_DBG_SYNC)) { + if (dev->debug & (AGX_DBG_TRACE | AGX_DBG_SYNC | AGX_DBG_SCRATCH)) { /* Wait so we can get errors reported back */ int ret = drmSyncobjWait(dev->fd, &batch->syncobj, 1, INT64_MAX, 0, NULL); assert(!ret); diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 10436d73ed1..cafadbf3e78 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -78,6 +78,7 @@ static const struct debug_named_value agx_debug_options[] = { {"noshadow", AGX_DBG_NOSHADOW, "Force disable resource shadowing"}, {"noclipctrl",AGX_DBG_NOCLIPCTRL,"Disable ARB_clip_control"}, {"varyings", AGX_DBG_VARYINGS, "Validate varying linkage"}, + {"scratch", AGX_DBG_SCRATCH, "Debug scratch memory usage"}, DEBUG_NAMED_VALUE_END }; /* clang-format on */