Mesa (main): ac/spm: fix determing the SPM wire

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


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

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

ac/spm: fix determing the SPM wire

One SPM wire holds two 16-bit counters.

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/amd/common/ac_spm.c b/src/amd/common/ac_spm.c
index 11d8fbc3705..f64e86711e2 100644
--- a/src/amd/common/ac_spm.c
+++ b/src/amd/common/ac_spm.c
@@ -133,8 +133,8 @@ ac_spm_map_counter(struct ac_spm_trace_data *spm_trace,
          /* Determine if the counter is even or odd. */
          counter->is_even = !(index % 2);
 
-         /* Determine the SPM wire (lower 16-bits for even, upper for odd). */
-         *spm_wire = !counter->is_even + i;
+         /* Determine the SPM wire (one wire holds two 16-bit counters). */
+         *spm_wire = !!(index >= 2);
 
          return true;
       }



More information about the mesa-commit mailing list