Mesa (main): ac/spm: fix determining the counter slot

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 15 11:11:08 UTC 2021


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Nov 11 16:15:08 2021 +0100

ac/spm: fix determining the counter slot

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Fixes: e928f475ccf ("ac: add initial SPM support")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13758>

---

 src/amd/common/ac_spm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/common/ac_spm.c b/src/amd/common/ac_spm.c
index f64e86711e2..04a9426fca4 100644
--- a/src/amd/common/ac_spm.c
+++ b/src/amd/common/ac_spm.c
@@ -103,7 +103,7 @@ ac_spm_map_counter(struct ac_spm_trace_data *spm_trace,
       /* Generic blocks. */
       for (unsigned i = 0; i < block_sel->num_counters; i++) {
          struct ac_spm_counter_select *cntr_sel = &block_sel->counters[i];
-         int index = ffs(~cntr_sel->active);
+         int index = ffs(~cntr_sel->active) - 1;
 
          switch (index) {
          case 0: /* use S_037004_PERF_SEL */



More information about the mesa-commit mailing list