It can be shared between RADV and RadeonSI.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22732>
return cb_id;
}
+
+bool
+ac_sqtt_se_is_disabled(const struct radeon_info *info, unsigned se)
+{
+ /* FIXME: SQTT only works on SE0 for some unknown reasons. */
+ if (info->gfx_level == GFX11)
+ return se != 0;
+
+ /* No active CU on the SE means it is disabled. */
+ return info->cu_mask[se][0] == 0;
+}
union rgp_sqtt_marker_cb_id ac_sqtt_get_next_cmdbuf_id(struct ac_thread_trace_data *data,
enum amd_ip_type ip_type);
+bool ac_sqtt_se_is_disabled(const struct radeon_info *info, unsigned se);
+
#endif
return debug_get_bool_option("RADV_THREAD_TRACE_INSTRUCTION_TIMING", true);
}
-static bool
-radv_se_is_disabled(struct radv_device *device, unsigned se)
-{
- /* FIXME: SQTT only works on SE0 for some unknown reasons. */
- if (device->physical_device->rad_info.gfx_level == GFX11 && se != 0)
- return true;
-
- /* No active CU on the SE means it is disabled. */
- return device->physical_device->rad_info.cu_mask[se][0] == 0;
-}
-
static uint32_t
gfx11_get_thread_trace_ctrl(struct radv_device *device, bool enable)
{
uint64_t shifted_va = data_va >> SQTT_BUFFER_ALIGN_SHIFT;
int first_active_cu = ffs(device->physical_device->rad_info.cu_mask[se][0]);
- if (radv_se_is_disabled(device, se))
+ if (ac_sqtt_se_is_disabled(rad_info, se))
continue;
/* Target SEx and SH0. */
}
for (unsigned se = 0; se < max_se; se++) {
- if (radv_se_is_disabled(device, se))
+ if (ac_sqtt_se_is_disabled(&device->physical_device->rad_info, se))
continue;
/* Target SEi and SH0. */
struct ac_thread_trace_se thread_trace_se = {0};
int first_active_cu = ffs(device->physical_device->rad_info.cu_mask[se][0]);
- if (radv_se_is_disabled(device, se))
+ if (ac_sqtt_se_is_disabled(rad_info, se))
continue;
if (!ac_is_thread_trace_complete(&device->physical_device->rad_info, &device->thread_trace,
return true;
}
-static bool
-si_se_is_disabled(struct si_context* sctx, unsigned se)
-{
- /* FIXME: SQTT only works on SE0 for some unknown reasons. */
- if (sctx->screen->info.gfx_level == GFX11)
- return se != 0;
-
- /* No active CU on the SE means it is disabled. */
- return sctx->screen->info.cu_mask[se][0] == 0;
-}
-
-
static void
si_emit_thread_trace_start(struct si_context* sctx,
struct radeon_cmdbuf *cs,
uint64_t data_va = ac_thread_trace_get_data_va(&sctx->screen->info, sctx->thread_trace, va, se);
uint64_t shifted_va = data_va >> SQTT_BUFFER_ALIGN_SHIFT;
- if (si_se_is_disabled(sctx, se))
+ if (ac_sqtt_se_is_disabled(&sctx->screen->info, se))
continue;
/* Target SEx and SH0. */
}
for (unsigned se = 0; se < max_se; se++) {
- if (si_se_is_disabled(sctx, se))
+ if (ac_sqtt_se_is_disabled(&sctx->screen->info, se))
continue;
radeon_begin(cs);
struct ac_thread_trace_se thread_trace_se = {0};
- if (si_se_is_disabled(sctx, se))
+ if (ac_sqtt_se_is_disabled(&sctx->screen->info, se))
continue;
if (!ac_is_thread_trace_complete(&sctx->screen->info, sctx->thread_trace, info)) {