radv: pass submit info to radv_check_gpu_hangs()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 25 Jul 2023 06:07:29 +0000 (08:07 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 25 Jul 2023 06:50:33 +0000 (06:50 +0000)
This will allow to dump preambles/postambles CS and eventually even
more CS.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24191>

src/amd/vulkan/radv_debug.c
src/amd/vulkan/radv_debug.h
src/amd/vulkan/radv_queue.c

index 1e4f92c..68a1465 100644 (file)
@@ -697,7 +697,7 @@ radv_gpu_hang_occurred(struct radv_queue *queue, enum amd_ip_type ring)
 }
 
 void
-radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs)
+radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_info *submit_info)
 {
    struct radv_device *device = queue->device;
    enum amd_ip_type ring;
@@ -741,7 +741,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs)
    snprintf(dump_path, sizeof(dump_path), "%s/%s", dump_dir, "trace.log");
    f = fopen(dump_path, "w+");
    if (f) {
-      radv_dump_trace(queue->device, cs, f);
+      radv_dump_trace(queue->device, submit_info->cs_array[0], f);
       fclose(f);
    }
 
index dc78eda..d5cc374 100644 (file)
@@ -94,7 +94,7 @@ enum {
 bool radv_init_trace(struct radv_device *device);
 void radv_finish_trace(struct radv_device *device);
 
-void radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs);
+void radv_check_gpu_hangs(struct radv_queue *queue, const struct radv_winsys_submit_info *submit_info);
 
 void radv_print_spirv(const char *data, uint32_t size, FILE *fp);
 
index 9f9ab90..e151a6d 100644 (file)
@@ -1633,7 +1633,6 @@ radv_queue_submit_normal(struct radv_queue *queue, struct vk_queue_submit *submi
       const bool last_submit = j + advance == cmd_buffer_count;
       bool submit_ace = false;
       unsigned num_submitted_cs = 0;
-      unsigned cs_idx = 0;
 
       if (queue->device->trace_bo)
          *queue->device->trace_id_ptr = 0;
@@ -1662,7 +1661,6 @@ radv_queue_submit_normal(struct radv_queue *queue, struct vk_queue_submit *submi
             cs_array[num_submitted_cs++] = cmd_buffer->cs;
 
          chainable = can_chain_next ? cmd_buffer->cs : NULL;
-         cs_idx = num_submitted_cs - 1;
       }
 
       submit.cs_count = num_submitted_cs;
@@ -1677,7 +1675,7 @@ radv_queue_submit_normal(struct radv_queue *queue, struct vk_queue_submit *submi
          goto fail;
 
       if (queue->device->trace_bo) {
-         radv_check_gpu_hangs(queue, cs_array[cs_idx]);
+         radv_check_gpu_hangs(queue, &submit);
       }
 
       if (queue->device->tma_bo) {