amd/common: use SH{0,1}_CU_EN definitions only of COMPUTE_STATIC_THREAD_MGMT_SE0
[mesa.git] / src / amd / vulkan / radv_debug.c
index 5cdbf5bea9a5a3bf096b54563aaeea9ff30478f8..432e65b1475c5f757a767b92ea820863d1fa4c4a 100644 (file)
@@ -63,7 +63,8 @@ radv_init_trace(struct radv_device *device)
        device->trace_bo = ws->buffer_create(ws, TRACE_BO_SIZE, 8,
                                             RADEON_DOMAIN_VRAM,
                                             RADEON_FLAG_CPU_ACCESS|
-                                            RADEON_FLAG_NO_INTERPROCESS_SHARING);
+                                            RADEON_FLAG_NO_INTERPROCESS_SHARING,
+                                            RADV_BO_PRIORITY_UPLOAD_BUFFER);
        if (!device->trace_bo)
                return false;
 
@@ -80,7 +81,7 @@ radv_init_trace(struct radv_device *device)
 }
 
 static void
-radv_dump_trace(struct radv_device *device, struct radeon_winsys_cs *cs)
+radv_dump_trace(struct radv_device *device, struct radeon_cmdbuf *cs)
 {
        const char *filename = getenv("RADV_TRACE_FILE");
        FILE *f = fopen(filename, "w");
@@ -130,7 +131,7 @@ radv_dump_debug_registers(struct radv_device *device, FILE *f)
        radv_dump_mmapped_reg(device, f, R_00803C_GRBM_STATUS_SE3);
        radv_dump_mmapped_reg(device, f, R_00D034_SDMA0_STATUS_REG);
        radv_dump_mmapped_reg(device, f, R_00D834_SDMA1_STATUS_REG);
-       if (info->chip_class <= VI) {
+       if (info->chip_class <= GFX8) {
                radv_dump_mmapped_reg(device, f, R_000E50_SRBM_STATUS);
                radv_dump_mmapped_reg(device, f, R_000E4C_SRBM_STATUS2);
                radv_dump_mmapped_reg(device, f, R_000E54_SRBM_STATUS3);
@@ -525,20 +526,30 @@ radv_dump_shaders(struct radv_pipeline *pipeline,
        }
 }
 
+static void
+radv_dump_pipeline_state(struct radv_pipeline *pipeline,
+                        VkShaderStageFlagBits active_stages, FILE *f)
+{
+       radv_dump_shaders(pipeline, active_stages, f);
+       radv_dump_annotated_shaders(pipeline, active_stages, f);
+       radv_dump_descriptors(pipeline, f);
+}
+
 static void
 radv_dump_graphics_state(struct radv_pipeline *graphics_pipeline,
                         struct radv_pipeline *compute_pipeline, FILE *f)
 {
        VkShaderStageFlagBits active_stages;
 
-       if (!graphics_pipeline)
-               return;
-
-       active_stages = graphics_pipeline->active_stages;
+       if (graphics_pipeline) {
+               active_stages = graphics_pipeline->active_stages;
+               radv_dump_pipeline_state(graphics_pipeline, active_stages, f);
+       }
 
-       radv_dump_shaders(graphics_pipeline, active_stages, f);
-       radv_dump_annotated_shaders(graphics_pipeline, active_stages, f);
-       radv_dump_descriptors(graphics_pipeline, f);
+       if (compute_pipeline) {
+               active_stages = VK_SHADER_STAGE_COMPUTE_BIT;
+               radv_dump_pipeline_state(compute_pipeline, active_stages, f);
+       }
 }
 
 static void
@@ -549,9 +560,7 @@ radv_dump_compute_state(struct radv_pipeline *compute_pipeline, FILE *f)
        if (!compute_pipeline)
                return;
 
-       radv_dump_shaders(compute_pipeline, active_stages, f);
-       radv_dump_annotated_shaders(compute_pipeline, active_stages, f);
-       radv_dump_descriptors(compute_pipeline, f);
+       radv_dump_pipeline_state(compute_pipeline, active_stages, f);
 }
 
 static struct radv_pipeline *
@@ -620,7 +629,7 @@ static void
 radv_dump_device_name(struct radv_device *device, FILE *f)
 {
        struct radeon_info *info = &device->physical_device->rad_info;
-       char llvm_string[32] = {}, kernel_version[128] = {};
+       char kernel_version[128] = {};
        struct utsname uname_data;
        const char *chip_name;
 
@@ -630,14 +639,11 @@ radv_dump_device_name(struct radv_device *device, FILE *f)
                snprintf(kernel_version, sizeof(kernel_version),
                         " / %s", uname_data.release);
 
-       snprintf(llvm_string, sizeof(llvm_string),
-                ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff,
-                HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH);
-
-       fprintf(f, "Device name: %s (%s DRM %i.%i.%i%s%s)\n\n",
+       fprintf(f, "Device name: %s (%s DRM %i.%i.%i%s, LLVM "
+               MESA_LLVM_VERSION_STRING ")\n\n",
                chip_name, device->physical_device->name,
                info->drm_major, info->drm_minor, info->drm_patchlevel,
-               kernel_version, llvm_string);
+               kernel_version);
 }
 
 static bool
@@ -652,7 +658,7 @@ radv_gpu_hang_occured(struct radv_queue *queue, enum ring_type ring)
 }
 
 void
-radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_winsys_cs *cs)
+radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs)
 {
        struct radv_pipeline *graphics_pipeline, *compute_pipeline;
        struct radv_device *device = queue->device;