[Mesa-dev] [PATCH 3/3] radv: Add trace ids for secondary buffers.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Aug 28 21:30:36 UTC 2017


Signed-off-by: Bas Nieuwenhuizen <basni at google.com>
---
 src/amd/vulkan/radv_cmd_buffer.c              | 2 ++
 src/amd/vulkan/radv_device.c                  | 2 +-
 src/amd/vulkan/radv_radeon_winsys.h           | 2 +-
 src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 4 ++--
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index e1249641917..12209d1dbdb 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -341,6 +341,8 @@ void radv_cmd_buffer_trace_emit(struct radv_cmd_buffer *cmd_buffer)
 		return;
 
 	va = device->ws->buffer_get_va(device->trace_bo);
+	if (cmd_buffer->level == VK_COMMAND_BUFFER_LEVEL_SECONDARY)
+		va += 4;
 
 	MAYBE_UNUSED unsigned cdw_max = radeon_check_space(cmd_buffer->device->ws, cmd_buffer->cs, 7);
 
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index fec965c6225..1e3148a0432 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -1389,7 +1389,7 @@ static void radv_dump_trace(struct radv_device *device,
 	}
 
 	fprintf(f, "Trace ID: %x\n", *device->trace_id_ptr);
-	device->ws->cs_dump(cs, f, *device->trace_id_ptr);
+	device->ws->cs_dump(cs, f, (const int*)device->trace_id_ptr, 2);
 	fclose(f);
 }
 
diff --git a/src/amd/vulkan/radv_radeon_winsys.h b/src/amd/vulkan/radv_radeon_winsys.h
index 215ef0bfc15..8e2ba7431a7 100644
--- a/src/amd/vulkan/radv_radeon_winsys.h
+++ b/src/amd/vulkan/radv_radeon_winsys.h
@@ -216,7 +216,7 @@ struct radeon_winsys {
 	void (*cs_execute_secondary)(struct radeon_winsys_cs *parent,
 				    struct radeon_winsys_cs *child);
 
-	void (*cs_dump)(struct radeon_winsys_cs *cs, FILE* file, uint32_t trace_id);
+	void (*cs_dump)(struct radeon_winsys_cs *cs, FILE* file, const int *trace_ids, int trace_id_count);
 
 	int (*surface_init)(struct radeon_winsys *ws,
 			    const struct ac_surf_info *surf_info,
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
index 49c9c909466..4a9ecab657f 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
@@ -987,7 +987,7 @@ static void *radv_amdgpu_winsys_get_cpu_addr(void *_cs, uint64_t addr)
 
 static void radv_amdgpu_winsys_cs_dump(struct radeon_winsys_cs *_cs,
                                        FILE* file,
-                                       uint32_t trace_id)
+                                       const int *trace_ids, int trace_id_count)
 {
 	struct radv_amdgpu_cs *cs = (struct radv_amdgpu_cs *)_cs;
 	void *ib = cs->base.buf;
@@ -998,7 +998,7 @@ static void radv_amdgpu_winsys_cs_dump(struct radeon_winsys_cs *_cs,
 		num_dw = cs->ib.size;
 	}
 	assert(ib);
-	ac_parse_ib(file, ib, num_dw, (const int*)&trace_id, 1,  "main IB",
+	ac_parse_ib(file, ib, num_dw, trace_ids, trace_id_count,  "main IB",
 		    cs->ws->info.chip_class, radv_amdgpu_winsys_get_cpu_addr, cs);
 }
 
-- 
2.14.1



More information about the mesa-dev mailing list