summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2021-06-03 09:07:54 +0200
committerMarge Bot <eric+marge@anholt.net>2021-06-03 15:39:34 +0000
commitaff92f50c6f19ea36544253e254edd97acabe1eb (patch)
treee78cea745a8092f24c9e18f06f063627d68f524c
parent416496a0c43cc3647c981dd8739fef1230ac59ac (diff)
ac: add ac_thread_trace::data
Instead of passing two different structs to ac_dump_rgp_capture(). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11156>
-rw-r--r--src/amd/common/ac_rgp.c9
-rw-r--r--src/amd/common/ac_rgp.h3
-rw-r--r--src/amd/common/ac_sqtt.h1
-rw-r--r--src/amd/vulkan/layers/radv_sqtt_layer.c3
-rw-r--r--src/amd/vulkan/radv_sqtt.c1
-rw-r--r--src/gallium/drivers/radeonsi/si_sqtt.c3
6 files changed, 10 insertions, 10 deletions
diff --git a/src/amd/common/ac_rgp.c b/src/amd/common/ac_rgp.c
index 2277058c413..7d0d48a91c0 100644
--- a/src/amd/common/ac_rgp.c
+++ b/src/amd/common/ac_rgp.c
@@ -819,10 +819,10 @@ static enum elf_gfxip_level ac_chip_class_to_elf_gfxip_level(enum chip_class chi
}
static void ac_sqtt_dump_data(struct radeon_info *rad_info,
- const struct ac_thread_trace *thread_trace,
- struct ac_thread_trace_data *thread_trace_data,
+ struct ac_thread_trace *thread_trace,
FILE *output)
{
+ struct ac_thread_trace_data *thread_trace_data = thread_trace->data;
struct sqtt_file_chunk_asic_info asic_info = {0};
struct sqtt_file_chunk_cpu_info cpu_info = {0};
struct sqtt_file_chunk_api_info api_info = {0};
@@ -948,8 +948,7 @@ static void ac_sqtt_dump_data(struct radeon_info *rad_info,
}
int ac_dump_rgp_capture(struct radeon_info *info,
- const struct ac_thread_trace *thread_trace,
- struct ac_thread_trace_data *thread_trace_data)
+ struct ac_thread_trace *thread_trace)
{
char filename[2048];
struct tm now;
@@ -967,7 +966,7 @@ int ac_dump_rgp_capture(struct radeon_info *info,
if (!f)
return -1;
- ac_sqtt_dump_data(info, thread_trace, thread_trace_data, f);
+ ac_sqtt_dump_data(info, thread_trace, f);
fprintf(stderr, "RGP capture saved to '%s'\n", filename);
diff --git a/src/amd/common/ac_rgp.h b/src/amd/common/ac_rgp.h
index f704e5ddd3f..118fd9d5e90 100644
--- a/src/amd/common/ac_rgp.h
+++ b/src/amd/common/ac_rgp.h
@@ -108,8 +108,7 @@ struct rgp_pso_correlation {
int
ac_dump_rgp_capture(struct radeon_info *info,
- const struct ac_thread_trace *thread_trace,
- struct ac_thread_trace_data *thread_trace_data);
+ struct ac_thread_trace *thread_trace);
void
ac_rgp_file_write_elf_object(FILE *output, size_t file_elf_start,
diff --git a/src/amd/common/ac_sqtt.h b/src/amd/common/ac_sqtt.h
index 459c5da593a..b0f3de8a74c 100644
--- a/src/amd/common/ac_sqtt.h
+++ b/src/amd/common/ac_sqtt.h
@@ -70,6 +70,7 @@ struct ac_thread_trace_se {
};
struct ac_thread_trace {
+ struct ac_thread_trace_data *data;
uint32_t num_traces;
struct ac_thread_trace_se traces[4];
};
diff --git a/src/amd/vulkan/layers/radv_sqtt_layer.c b/src/amd/vulkan/layers/radv_sqtt_layer.c
index 9cbd1354705..818caca9444 100644
--- a/src/amd/vulkan/layers/radv_sqtt_layer.c
+++ b/src/amd/vulkan/layers/radv_sqtt_layer.c
@@ -363,8 +363,7 @@ radv_handle_thread_trace(VkQueue _queue)
radv_QueueWaitIdle(_queue);
if (radv_get_thread_trace(queue, &thread_trace)) {
- ac_dump_rgp_capture(&queue->device->physical_device->rad_info, &thread_trace,
- &queue->device->thread_trace);
+ ac_dump_rgp_capture(&queue->device->physical_device->rad_info, &thread_trace);
} else {
/* Trigger a new capture if the driver failed to get
* the trace because the buffer was too small.
diff --git a/src/amd/vulkan/radv_sqtt.c b/src/amd/vulkan/radv_sqtt.c
index 4843856bf0a..2d3cdd58e38 100644
--- a/src/amd/vulkan/radv_sqtt.c
+++ b/src/amd/vulkan/radv_sqtt.c
@@ -629,5 +629,6 @@ radv_get_thread_trace(struct radv_queue *queue, struct ac_thread_trace *thread_t
thread_trace->num_traces++;
}
+ thread_trace->data = &device->thread_trace;
return true;
}
diff --git a/src/gallium/drivers/radeonsi/si_sqtt.c b/src/gallium/drivers/radeonsi/si_sqtt.c
index b01bf2c3753..76a24b58a42 100644
--- a/src/gallium/drivers/radeonsi/si_sqtt.c
+++ b/src/gallium/drivers/radeonsi/si_sqtt.c
@@ -536,6 +536,7 @@ si_get_thread_trace(struct si_context *sctx,
thread_trace->traces[se] = thread_trace_se;
}
+ thread_trace->data = sctx->thread_trace;
return true;
}
@@ -696,7 +697,7 @@ si_handle_thread_trace(struct si_context *sctx, struct radeon_cmdbuf *rcs)
/* Wait for SQTT to finish and read back the bo */
if (sctx->ws->fence_wait(sctx->ws, sctx->last_sqtt_fence, PIPE_TIMEOUT_INFINITE) &&
si_get_thread_trace(sctx, &thread_trace)) {
- ac_dump_rgp_capture(&sctx->screen->info, &thread_trace, sctx->thread_trace);
+ ac_dump_rgp_capture(&sctx->screen->info, &thread_trace);
} else {
fprintf(stderr, "Failed to read the trace\n");
}