freedreno/decode: Lookup device info
First step for migration to chip_id. With newer devices we won't be able to decode the chip_id in any meaningful way, ie. it is just a number. But we can use the device table to figure out things like generation which are needed to properly decode cmdstream, etc. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25333>
This commit is contained in:
@@ -5,7 +5,7 @@ time: 1593887022.767858793
|
||||
comm: crashit
|
||||
cmdline: ./crashit IB1 4 5
|
||||
revision: 630 (6.3.0.2)
|
||||
Got gpu_id=630
|
||||
Got chip_id=0x6030002
|
||||
rbbm-status: 0x00000000
|
||||
ringbuffer:
|
||||
- id: 0
|
||||
|
@@ -6,7 +6,7 @@ comm: deqp-vk
|
||||
cmdline: ./deqp-vk --deqp-log-images=enable --deqp-log-filename=/home/anholt/TestResults.qpa --deqp-surface-type=pbuffer --deqp-surface-width=256 --deqp-surface-height=256 --deqp-gl-config-name=rgba8888d24s8ms0 --deqp-case=dEQP-VK.renderpass2.dedicated_allocation.attachment_allocation.roll.46
|
||||
gpu-initialized: 1
|
||||
revision: 618 (6.1.8.0)
|
||||
Got gpu_id=618
|
||||
Got chip_id=0x6010800
|
||||
rbbm-status: 0x00000000
|
||||
ringbuffer:
|
||||
- id: 0
|
||||
|
@@ -6,7 +6,7 @@ comm: testfw_app:sq0
|
||||
cmdline: ./testfw_app --gfx glfw --gl_api=gles -t gl_driver2_short
|
||||
gpu-initialized: 1
|
||||
revision: 618 (6.1.8.0)
|
||||
Got gpu_id=618
|
||||
Got chip_id=0x6010800
|
||||
rbbm-status: 0x00000000
|
||||
ringbuffer:
|
||||
- id: 0
|
||||
|
@@ -46,6 +46,7 @@ enum query_mode {
|
||||
|
||||
struct cffdec_options {
|
||||
struct fd_dev_id dev_id;
|
||||
const struct fd_dev_info *info;
|
||||
unsigned gpu_id;
|
||||
int draw_filter;
|
||||
int color;
|
||||
|
@@ -339,10 +339,10 @@ handle_file(const char *filename, int start, int end, int draw)
|
||||
options.dev_id.gpu_id = gpu_id;
|
||||
printl(2, "gpu_id: %d\n", options.dev_id.gpu_id);
|
||||
|
||||
const struct fd_dev_info *info = fd_dev_info(&options.dev_id);
|
||||
if (!info)
|
||||
options.info = fd_dev_info(&options.dev_id);
|
||||
if (!options.info)
|
||||
break;
|
||||
options.gpu_id = info->chip * 100;
|
||||
options.gpu_id = options.info->chip * 100;
|
||||
|
||||
cffdec_init(&options);
|
||||
got_gpu_id = 1;
|
||||
@@ -353,10 +353,10 @@ handle_file(const char *filename, int start, int end, int draw)
|
||||
options.dev_id.chip_id = parse_chip_id(ps.buf);
|
||||
printl(2, "chip_id: 0x%" PRIx64 "\n", options.dev_id.chip_id);
|
||||
|
||||
const struct fd_dev_info *info = fd_dev_info(&options.dev_id);
|
||||
if (!info)
|
||||
options.info = fd_dev_info(&options.dev_id);
|
||||
if (!options.info)
|
||||
break;
|
||||
options.gpu_id = info->chip * 100;
|
||||
options.gpu_id = options.info->chip * 100;
|
||||
|
||||
cffdec_init(&options);
|
||||
got_gpu_id = 1;
|
||||
|
@@ -767,14 +767,19 @@ decode(void)
|
||||
if (startswith(line, "revision:")) {
|
||||
unsigned core, major, minor, patchid;
|
||||
|
||||
parseline(line, "revision: %u (%u.%u.%u.%u)", &options.gpu_id,
|
||||
parseline(line, "revision: %u (%u.%u.%u.%u)", &options.dev_id.gpu_id,
|
||||
&core, &major, &minor, &patchid);
|
||||
|
||||
if (options.gpu_id == 0) {
|
||||
options.gpu_id = (core * 100) + (major * 10) + minor;
|
||||
options.dev_id.chip_id = (core << 24) | (major << 16) | (minor << 8) | patchid;
|
||||
options.info = fd_dev_info(&options.dev_id);
|
||||
if (!options.info) {
|
||||
printf("Unsupported device\n");
|
||||
break;
|
||||
}
|
||||
|
||||
printf("Got gpu_id=%u\n", options.gpu_id);
|
||||
options.gpu_id = options.dev_id.gpu_id;
|
||||
|
||||
printf("Got chip_id=0x%"PRIx64"\n", options.dev_id.chip_id);
|
||||
|
||||
cffdec_init(&options);
|
||||
|
||||
|
@@ -74,7 +74,7 @@ is_64b(void)
|
||||
static inline bool
|
||||
is_gmu_legacy(void)
|
||||
{
|
||||
switch (options.gpu_id) {
|
||||
switch (options.dev_id.gpu_id) {
|
||||
case 615:
|
||||
case 618:
|
||||
case 630:
|
||||
|
Reference in New Issue
Block a user