freedreno/registers: Add pipe to perfcntr group

With concurrent binning, some counter reads or SEL reg programming needs
to happen explicitly on the BR or BV ring.  For the most part if there
is a "BV_FOO" counter group that should be on the BV ring and the
corresponding "FOO" group on the BR ring.  There are a few exceptions
like "CP" vs "BV_CP" which have different SEL reg offsets for BR vs BV,
rather than the same offsets that should be accessed via the appropriate
aperture.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
This commit is contained in:
Rob Clark 2026-04-13 10:24:03 -07:00 committed by Marge Bot
parent 90d3c48326
commit 2093153ba4
2 changed files with 9 additions and 3 deletions

View file

@ -70,6 +70,7 @@ struct fd_perfcntr_countable {
/* Describes an entire counter group: */
struct fd_perfcntr_group {
const char *name;
int pipe;
unsigned num_counters;
const struct fd_perfcntr_counter *counters;
unsigned num_countables;
@ -78,8 +79,10 @@ struct fd_perfcntr_group {
const struct fd_perfcntr_group *fd_perfcntrs(const struct fd_dev_id *id, unsigned *count);
#define GROUP(_name, _counters, _countables) { \
.name = _name, .num_counters = ARRAY_SIZE(_counters), \
#define GROUP(_name, _pipe, _counters, _countables) { \
.name = _name, \
.pipe = _pipe, \
.num_counters = ARRAY_SIZE(_counters), \
.counters = _counters, .num_countables = ARRAY_SIZE(_countables), \
.countables = _countables, \
}

View file

@ -1149,8 +1149,11 @@ def dump_perfcntrs(args):
for group in groups:
name = group['name']
name_low = name.lower()
pipe = 'NONE'
if 'pipe' in group:
pipe = group['pipe']
print(" GROUP(\"%s\", %s_counters, %s_countables)," % (name, name_low, name_low))
print(" GROUP(\"%s\", PIPE_%s, %s_counters, %s_countables)," % (name, pipe, name_low, name_low))
print("};")
print("const unsigned " + chip.lower() + "_num_perfcntr_groups = ARRAY_SIZE(" + chip.lower() + "_perfcntr_groups);")