ac/spm: fix determining the counter slot

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: e928f475cc ("ac: add initial SPM support")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13758>
This commit is contained in:
Samuel Pitoiset 2021-11-11 16:15:08 +01:00
parent 11c6a32759
commit a9c4e0c371

View file

@ -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 */