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 <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14564>
This commit is contained in:
Rob Clark 2022-01-14 13:35:16 -08:00 committed by Marge Bot
parent d15021435e
commit fcb3b87553
2 changed files with 16 additions and 1 deletions

View File

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

View File

@ -41,6 +41,7 @@ enum rd_sect_type {
RD_FRAG_SHADER,
RD_BUFFER_CONTENTS,
RD_GPU_ID,
RD_CHIP_ID,
};
/* RD_PARAM types: */