diff --git a/src/panfrost/lib/genxml/decode.h b/src/panfrost/lib/genxml/decode.h index 98166c52c4d..07339f5c67b 100644 --- a/src/panfrost/lib/genxml/decode.h +++ b/src/panfrost/lib/genxml/decode.h @@ -41,6 +41,12 @@ struct pandecode_context { struct util_dynarray ro_mappings; int dump_frame_count; simple_mtx_t lock; + + /* On CSF context, set to true if the root CS ring buffer + * is managed in userspace. The blob does that, and mesa might use + * usermode queues too at some point. + */ + bool usermode_queue; }; void pandecode_dump_file_open(struct pandecode_context *ctx); diff --git a/src/panfrost/lib/genxml/decode_csf.c b/src/panfrost/lib/genxml/decode_csf.c index 603beea4f4d..08080a21d2a 100644 --- a/src/panfrost/lib/genxml/decode_csf.c +++ b/src/panfrost/lib/genxml/decode_csf.c @@ -951,6 +951,11 @@ GENX(pandecode_cs)(struct pandecode_context *ctx, mali_ptr queue, uint32_t size, .ip = cs, .end = cs + (size / 8), .gpu_id = gpu_id, + + /* If this is a kernel mode queue, we don't see the root ring buffer and + * we must adjust the initial call stack depth accordingly. + */ + .call_stack_depth = ctx->usermode_queue ? 0 : 1, }; if (size) {