From 8b93d1dbbb64846c19f34a897defc1d0baf1c85b Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 28 Jun 2024 09:41:09 +0200 Subject: [PATCH] pan/decode: Interpret LOAD_MULTIPLE opcode when decoding a command stream This way we can support decoding of descriptors that are passed through context registers, which we will need for panvk, where the tiler/FB descriptors come from the VkQueue object, and are passed to command buffers. Of course, that means we can only see the latest version of such indirectly passed data, but that's already the case for most descriptors that are used several times in a command buffer anyway. Signed-off-by: Boris Brezillon Reviewed-by: Mary Guillemard Part-of: --- src/panfrost/lib/genxml/decode_csf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/panfrost/lib/genxml/decode_csf.c b/src/panfrost/lib/genxml/decode_csf.c index ef0a031e36a..20e2939ed00 100644 --- a/src/panfrost/lib/genxml/decode_csf.c +++ b/src/panfrost/lib/genxml/decode_csf.c @@ -857,6 +857,22 @@ interpret_ceu_instr(struct pandecode_context *ctx, struct queue_ctx *qctx) break; } + case MALI_CS_OPCODE_LOAD_MULTIPLE: { + pan_unpack(bytes, CS_LOAD_MULTIPLE, I); + mali_ptr addr = + ((uint64_t)qctx->regs[I.address + 1] << 32) | qctx->regs[I.address]; + addr += I.offset; + + uint32_t *src = + pandecode_fetch_gpu_mem(ctx, addr, util_last_bit(I.mask) * 4); + + for (uint32_t i = 0; i < 16; i++) { + if (I.mask & BITFIELD_BIT(i)) + qctx->regs[I.base_register + i] = src[i]; + } + break; + } + case MALI_CS_OPCODE_ADD_IMMEDIATE32: { pan_unpack(bytes, CS_ADD_IMMEDIATE32, I);