ac/sqtt: add a helper to get cmdbuf IDs per queue

These will be used by RADV to implement queue event timings.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22670>
This commit is contained in:
Samuel Pitoiset 2023-04-24 17:15:15 +02:00 committed by Marge Bot
parent a7b4573c11
commit 9c33c4dcbe
2 changed files with 18 additions and 0 deletions

View file

@ -173,3 +173,15 @@ ac_check_profile_state(const struct radeon_info *info)
data[n] = 0;
return strstr(data, "profile") == NULL;
}
union rgp_sqtt_marker_cb_id
ac_sqtt_get_next_cmdbuf_id(struct ac_thread_trace_data *data,
enum amd_ip_type ip_type)
{
union rgp_sqtt_marker_cb_id cb_id = {0};
cb_id.global_cb_id.cb_index =
p_atomic_inc_return(&data->cmdbuf_ids_per_queue[ip_type]);
return cb_id;
}

View file

@ -31,6 +31,7 @@
#include <assert.h>
#include "ac_rgp.h"
#include "amd_family.h"
struct radeon_cmdbuf;
struct radeon_info;
@ -45,6 +46,8 @@ struct ac_thread_trace_data {
int start_frame;
char *trigger_file;
uint32_t cmdbuf_ids_per_queue[AMD_NUM_IP_TYPES];
struct rgp_code_object rgp_code_object;
struct rgp_loader_events rgp_loader_events;
struct rgp_pso_correlation rgp_pso_correlation;
@ -531,4 +534,7 @@ bool ac_sqtt_add_code_object_loader_event(struct ac_thread_trace_data *thread_tr
bool ac_check_profile_state(const struct radeon_info *info);
union rgp_sqtt_marker_cb_id ac_sqtt_get_next_cmdbuf_id(struct ac_thread_trace_data *data,
enum amd_ip_type ip_type);
#endif