diff options
author | Samuel Pitoiset <[email protected]> | 2020-02-26 14:12:01 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2020-03-10 09:57:56 +0100 |
commit | be700775dc2e97a414d14bc764cd2eb72a639306 (patch) | |
tree | db3ef18f39334ceaedeef577d27c437529a88911 /src/amd/vulkan | |
parent | f4fbcfe8183b7253b411dd7ac2aadecd47bd76e4 (diff) |
radv/sqtt: add a helper that emits thread trace userdata markers
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4031>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r-- | src/amd/vulkan/radv_private.h | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_sqtt.c | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index a9e711a0b51..ab056b49821 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -2412,6 +2412,8 @@ bool radv_begin_thread_trace(struct radv_queue *queue); bool radv_end_thread_trace(struct radv_queue *queue); bool radv_get_thread_trace(struct radv_queue *queue, struct radv_thread_trace *thread_trace); +void radv_emit_thread_trace_userdata(struct radeon_cmdbuf *cs, + const void *data, uint32_t num_dwords); /* radv_rgp.c */ int radv_dump_thread_trace(struct radv_device *device, diff --git a/src/amd/vulkan/radv_sqtt.c b/src/amd/vulkan/radv_sqtt.c index ba0f2f712e9..1935c990255 100644 --- a/src/amd/vulkan/radv_sqtt.c +++ b/src/amd/vulkan/radv_sqtt.c @@ -341,6 +341,23 @@ radv_emit_thread_trace_stop(struct radv_device *device, S_030800_INSTANCE_BROADCAST_WRITES(1)); } +void +radv_emit_thread_trace_userdata(struct radeon_cmdbuf *cs, + const void *data, uint32_t num_dwords) +{ + const uint32_t *dwords = (uint32_t *)data; + + while (num_dwords > 0) { + uint32_t count = MIN2(num_dwords, 2); + + radeon_set_uconfig_reg_seq(cs, R_030D08_SQ_THREAD_TRACE_USERDATA_2, count); + radeon_emit_array(cs, dwords, count); + + dwords += count; + num_dwords -= count; + } +} + static void radv_emit_spi_config_cntl(struct radv_device *device, struct radeon_cmdbuf *cs, bool enable) |