From fcb3b8755393cf36707e8944ed05f2b7061d81cb Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 14 Jan 2022 13:35:16 -0800 Subject: [PATCH] freedreno/decode: Handle chip-id For cmdstream traces from newer devices, we need to identify the gpu based on chip-id. Signed-off-by: Rob Clark Part-of: --- src/freedreno/decode/cffdump.c | 16 +++++++++++++++- src/freedreno/decode/redump.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/freedreno/decode/cffdump.c b/src/freedreno/decode/cffdump.c index 0ed1989798a..0220b23b386 100644 --- a/src/freedreno/decode/cffdump.c +++ b/src/freedreno/decode/cffdump.c @@ -370,7 +370,21 @@ handle_file(const char *filename, int start, int end, int draw) break; case RD_GPU_ID: if (!got_gpu_id) { - options.gpu_id = *((unsigned int *)buf); + uint32_t gpu_id = *((unsigned int *)buf); + if (!gpu_id) + break; + options.gpu_id = gpu_id; + printl(2, "gpu_id: %d\n", options.gpu_id); + cffdec_init(&options); + got_gpu_id = 1; + } + break; + case RD_CHIP_ID: + if (!got_gpu_id) { + uint64_t chip_id = *((uint64_t *)buf); + options.gpu_id = 100 * ((chip_id >> 24) & 0xff) + + 10 * ((chip_id >> 16) & 0xff) + + ((chip_id >> 8) & 0xff); printl(2, "gpu_id: %d\n", options.gpu_id); cffdec_init(&options); got_gpu_id = 1; diff --git a/src/freedreno/decode/redump.h b/src/freedreno/decode/redump.h index 5c4b8f0a41b..bf202d8839d 100644 --- a/src/freedreno/decode/redump.h +++ b/src/freedreno/decode/redump.h @@ -41,6 +41,7 @@ enum rd_sect_type { RD_FRAG_SHADER, RD_BUFFER_CONTENTS, RD_GPU_ID, + RD_CHIP_ID, }; /* RD_PARAM types: */