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 <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27616>
This commit is contained in:
Asahi Lina 2023-11-08 22:27:37 +09:00 committed by Marge Bot
parent 8845702f8c
commit ff900ceffe
2 changed files with 2 additions and 1 deletions

View file

@ -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);

View file

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