Module: Mesa
Branch: main
Commit: 9db70eb5778952cc57612cafb92288152a38c143
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9db70eb5778952cc57612cafb92288152a38c143

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Thu Sep 16 17:04:12 2021 +0200

radeonsi/sqtt: add si_se_is_disabled

Based on radv_se_is_disabled.

Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12899>

---

 src/gallium/drivers/radeonsi/si_sqtt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_sqtt.c 
b/src/gallium/drivers/radeonsi/si_sqtt.c
index b219bbe16fc..7fae0269c03 100644
--- a/src/gallium/drivers/radeonsi/si_sqtt.c
+++ b/src/gallium/drivers/radeonsi/si_sqtt.c
@@ -66,6 +66,14 @@ si_thread_trace_init_bo(struct si_context *sctx)
    return true;
 }
 
+static bool
+si_se_is_disabled(struct si_context* sctx, unsigned se)
+{
+   /* 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,
@@ -82,6 +90,9 @@ si_emit_thread_trace_start(struct si_context* sctx,
       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))
+         continue;
+
       /* Target SEx and SH0. */
       radeon_set_uconfig_reg(cs, R_030800_GRBM_GFX_INDEX,
                              S_030800_SE_INDEX(se) |
@@ -291,6 +302,9 @@ si_emit_thread_trace_stop(struct si_context *sctx,
    radeon_end();
 
    for (unsigned se = 0; se < max_se; se++) {
+      if (si_se_is_disabled(sctx, se))
+         continue;
+
       radeon_begin(cs);
 
       /* Target SEi and SH0. */

Reply via email to