From: Alyssa Rosenzweig Date: Wed, 5 Aug 2020 23:43:58 +0000 (-0400) Subject: pan/decode: Add helper to dump GPU structures X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d2ddd4d56562d0c43e662882eca0964377dfba20;p=mesa.git pan/decode: Add helper to dump GPU structures Based on generating unpack/print. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Tomeu Vizoso Part-of: --- diff --git a/src/panfrost/lib/decode.c b/src/panfrost/lib/decode.c index d3b68f29fa9..059a74d24aa 100644 --- a/src/panfrost/lib/decode.c +++ b/src/panfrost/lib/decode.c @@ -57,6 +57,19 @@ static void pandecode_swizzle(unsigned swizzle, enum mali_format format); } \ } +#define DUMP_CL(title, T, cl, indent) {\ + fprintf(pandecode_dump_stream, "%s\n", title); \ + struct MALI_ ## T temp; \ + MALI_ ## T ## _unpack((const uint8_t *) cl, &temp); \ + MALI_ ## T ## _print(pandecode_dump_stream, &temp, 0); \ +} + +#define DUMP_ADDR(title, T, addr, indent) {\ + struct pandecode_mapped_memory *mapped_mem = pandecode_find_mapped_gpu_mem_containing(addr); \ + const uint8_t *cl = pandecode_fetch_gpu_mem(mapped_mem, addr, MALI_ ## T ## _LENGTH); \ + DUMP_CL(title, T, cl, indent); \ +} + FILE *pandecode_dump_stream; /* Semantic logging type.