diff --git a/src/panfrost/perf/G31.xml b/src/panfrost/perf/G31.xml index 4fef36640b5..7400b1ddaf6 100644 --- a/src/panfrost/perf/G31.xml +++ b/src/panfrost/perf/G31.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G51.xml b/src/panfrost/perf/G51.xml index 3bb25c724c2..cad669d3c3b 100644 --- a/src/panfrost/perf/G51.xml +++ b/src/panfrost/perf/G51.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G52.xml b/src/panfrost/perf/G52.xml index 02b21da397f..35a9eaa7ba3 100644 --- a/src/panfrost/perf/G52.xml +++ b/src/panfrost/perf/G52.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G57.xml b/src/panfrost/perf/G57.xml index 20f9869cd93..e696d1702a0 100644 --- a/src/panfrost/perf/G57.xml +++ b/src/panfrost/perf/G57.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G68.xml b/src/panfrost/perf/G68.xml index 9095d9a8c53..de21afafca3 100644 --- a/src/panfrost/perf/G68.xml +++ b/src/panfrost/perf/G68.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G71.xml b/src/panfrost/perf/G71.xml index 080fd619f93..760e045b588 100644 --- a/src/panfrost/perf/G71.xml +++ b/src/panfrost/perf/G71.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G72.xml b/src/panfrost/perf/G72.xml index 80b420131f6..3f642ff9c2b 100644 --- a/src/panfrost/perf/G72.xml +++ b/src/panfrost/perf/G72.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G76.xml b/src/panfrost/perf/G76.xml index d0b44366893..43bc89a3afa 100644 --- a/src/panfrost/perf/G76.xml +++ b/src/panfrost/perf/G76.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G77.xml b/src/panfrost/perf/G77.xml index 60d99193b87..26ddfc07bb1 100644 --- a/src/panfrost/perf/G77.xml +++ b/src/panfrost/perf/G77.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/G78.xml b/src/panfrost/perf/G78.xml index fa7d9e95610..9288e316ab7 100644 --- a/src/panfrost/perf/G78.xml +++ b/src/panfrost/perf/G78.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/T72x.xml b/src/panfrost/perf/T72x.xml index 819b43fec59..16a5f807382 100644 --- a/src/panfrost/perf/T72x.xml +++ b/src/panfrost/perf/T72x.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/T76x.xml b/src/panfrost/perf/T76x.xml index 344d18f49ab..521ba49a49b 100644 --- a/src/panfrost/perf/T76x.xml +++ b/src/panfrost/perf/T76x.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/T82x.xml b/src/panfrost/perf/T82x.xml index abbe1ab5e13..beb86474f64 100644 --- a/src/panfrost/perf/T82x.xml +++ b/src/panfrost/perf/T82x.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/T83x.xml b/src/panfrost/perf/T83x.xml index 6834c9289b8..7f36dfd1e68 100644 --- a/src/panfrost/perf/T83x.xml +++ b/src/panfrost/perf/T83x.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/T86x.xml b/src/panfrost/perf/T86x.xml index d3a6d18a9c7..3dab882d43d 100644 --- a/src/panfrost/perf/T86x.xml +++ b/src/panfrost/perf/T86x.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/T88x.xml b/src/panfrost/perf/T88x.xml index ebbe0402be4..4a362d76984 100644 --- a/src/panfrost/perf/T88x.xml +++ b/src/panfrost/perf/T88x.xml @@ -1,6 +1,6 @@ - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/panfrost/perf/pan_gen_perf.py b/src/panfrost/perf/pan_gen_perf.py index bfcb8ea9a22..de0672c8392 100644 --- a/src/panfrost/perf/pan_gen_perf.py +++ b/src/panfrost/perf/pan_gen_perf.py @@ -200,7 +200,7 @@ def main(): c.write(".symbol_name = \"%s\"," % (counter.underscore_name)) c.write(".units = PAN_PERF_COUNTER_UNITS_%s," % (counter.units.upper())) c.write(".offset = %u," % (counter.offset)) - c.write(".category = &%s.categories[%u]," % (current_struct_name, i)) + c.write(".category_index = %u," % i) c.outdent(tab_size) c.write("}, // counter") diff --git a/src/panfrost/perf/pan_perf.c b/src/panfrost/perf/pan_perf.c index 06f81cb505d..930eae78d11 100644 --- a/src/panfrost/perf/pan_perf.c +++ b/src/panfrost/perf/pan_perf.c @@ -28,19 +28,22 @@ #include #define PAN_COUNTERS_PER_CATEGORY 64 -#define PAN_SHADER_CORE_INDEX 2 +#define PAN_SHADER_CORE_INDEX 3 uint32_t panfrost_perf_counter_read(const struct panfrost_perf_counter *counter, const struct panfrost_perf *perf) { - assert(counter->offset < perf->n_counter_values); - uint32_t ret = perf->counter_values[counter->offset]; + unsigned offset = perf->category_offset[counter->category_index]; + offset += counter->offset; + assert(offset < perf->n_counter_values); + + uint32_t ret = perf->counter_values[offset]; // If counter belongs to shader core, accumulate values for all other cores - if (counter->category == &perf->cfg->categories[PAN_SHADER_CORE_INDEX]) { + if (counter->category_index == PAN_SHADER_CORE_INDEX) { for (uint32_t core = 1; core < perf->dev->core_count; ++core) { - ret += perf->counter_values[counter->offset + PAN_COUNTERS_PER_CATEGORY * core]; + ret += perf->counter_values[offset + PAN_COUNTERS_PER_CATEGORY * core]; } } @@ -72,10 +75,17 @@ panfrost_perf_init(struct panfrost_perf *perf, struct panfrost_device *dev) unreachable("Performance counters missing!"); // Generally counter blocks are laid out in the following order: - // Job manager, tiler, L2 cache, and one or more shader cores. - uint32_t n_blocks = 3 + dev->core_count; + // Job manager, tiler, one or more L2 caches, and one or more shader cores. + unsigned l2_slices = panfrost_query_l2_slices(dev); + uint32_t n_blocks = 2 + l2_slices + dev->core_count; perf->n_counter_values = PAN_COUNTERS_PER_CATEGORY * n_blocks; perf->counter_values = ralloc_array(perf, uint32_t, perf->n_counter_values); + + /* Setup the layout */ + perf->category_offset[0] = PAN_COUNTERS_PER_CATEGORY * 0; + perf->category_offset[1] = PAN_COUNTERS_PER_CATEGORY * 1; + perf->category_offset[2] = PAN_COUNTERS_PER_CATEGORY * 2; + perf->category_offset[3] = PAN_COUNTERS_PER_CATEGORY * (2 + l2_slices); } static int diff --git a/src/panfrost/perf/pan_perf.h b/src/panfrost/perf/pan_perf.h index 1a42b7f351d..592dce71cea 100644 --- a/src/panfrost/perf/pan_perf.h +++ b/src/panfrost/perf/pan_perf.h @@ -60,10 +60,9 @@ struct panfrost_perf_counter { const char *desc; const char *symbol_name; enum panfrost_perf_counter_units units; - // Offset of this counter's value within the counters memory block + // Offset of this counter's value within the category uint32_t offset; - - const struct panfrost_perf_category *category; + unsigned category_index; }; struct panfrost_perf_category { @@ -71,6 +70,9 @@ struct panfrost_perf_category { struct panfrost_perf_counter counters[PAN_PERF_MAX_COUNTERS]; uint32_t n_counters; + + /* Offset of this category within the counters memory block */ + unsigned offset; }; struct panfrost_perf_config { @@ -88,6 +90,9 @@ struct panfrost_perf { // Memory where to dump counter values uint32_t *counter_values; uint32_t n_counter_values; + + /* Offsets of categories */ + unsigned category_offset[PAN_PERF_MAX_CATEGORIES]; }; uint32_t