radv: do not trace inactive shader engines with SQTT
This fixes a GPU hang on my Sienna because the number of SE is less than the maximum, and SE #1 is disabled. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9370>
This commit is contained in:
@@ -29,6 +29,12 @@
|
||||
|
||||
#define SQTT_BUFFER_ALIGN_SHIFT 12
|
||||
|
||||
static bool
|
||||
radv_se_is_disabled(struct radv_device *device, unsigned se)
|
||||
{
|
||||
/* No active CU on the SE means it is disabled. */
|
||||
return device->physical_device->rad_info.cu_mask[se][0] == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
radv_emit_thread_trace_start(struct radv_device *device,
|
||||
@@ -47,6 +53,9 @@ radv_emit_thread_trace_start(struct radv_device *device,
|
||||
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))
|
||||
continue;
|
||||
|
||||
/* Target SEx and SH0. */
|
||||
radeon_set_uconfig_reg(cs, R_030800_GRBM_GFX_INDEX,
|
||||
S_030800_SE_INDEX(se) |
|
||||
@@ -267,6 +276,9 @@ radv_emit_thread_trace_stop(struct radv_device *device,
|
||||
radeon_emit(cs, EVENT_TYPE(V_028A90_THREAD_TRACE_FINISH) | EVENT_INDEX(0));
|
||||
|
||||
for (unsigned se = 0; se < max_se; se++) {
|
||||
if (radv_se_is_disabled(device, se))
|
||||
continue;
|
||||
|
||||
/* Target SEi and SH0. */
|
||||
radeon_set_uconfig_reg(cs, R_030800_GRBM_GFX_INDEX,
|
||||
S_030800_SE_INDEX(se) |
|
||||
@@ -632,7 +644,6 @@ radv_get_thread_trace(struct radv_queue *queue,
|
||||
void *thread_trace_ptr = device->thread_trace.ptr;
|
||||
|
||||
memset(thread_trace, 0, sizeof(*thread_trace));
|
||||
thread_trace->num_traces = max_se;
|
||||
|
||||
for (unsigned se = 0; se < max_se; se++) {
|
||||
uint64_t info_offset = ac_thread_trace_get_info_offset(se);
|
||||
@@ -644,6 +655,9 @@ radv_get_thread_trace(struct radv_queue *queue,
|
||||
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))
|
||||
continue;
|
||||
|
||||
if (!ac_is_thread_trace_complete(&device->physical_device->rad_info, info)) {
|
||||
uint32_t expected_size =
|
||||
ac_get_expected_buffer_size(&device->physical_device->rad_info, info);
|
||||
@@ -673,7 +687,8 @@ radv_get_thread_trace(struct radv_queue *queue,
|
||||
|
||||
thread_trace_se.compute_unit = 0;
|
||||
|
||||
thread_trace->traces[se] = thread_trace_se;
|
||||
thread_trace->traces[thread_trace->num_traces] = thread_trace_se;
|
||||
thread_trace->num_traces++;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user