freedreno: add a7xx perfcounter support

Add performance counting support for a7xx in Freedreno, providing the
available performance counter groups along with the lists of countables
that can be counted through related counters.

All the collected countable names and values are provided in enum
definitions, even when the names indicate some countables being reserved.
The perfcounter groups don't include those reserved values.

The countable selection command stream in fdperf is enabled for a7xx,
sharing the same command stream created for 5th- and 6th-gen devices.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27483>
This commit is contained in:
Zan Dobersek
2024-03-22 15:55:21 +01:00
committed by Marge Bot
parent 5fb8ab62d2
commit d17e9994e4
6 changed files with 3057 additions and 6 deletions
File diff suppressed because it is too large Load Diff
+1
View File
@@ -259,6 +259,7 @@ select_counter(struct counter_group *group, int ctr, int countable_val)
break;
case 5:
case 6:
case 7:
OUT_PKT7(ring, CP_WAIT_FOR_IDLE, 0);
if (group->group->counters[ctr].enable) {
@@ -37,6 +37,9 @@ extern const unsigned a5xx_num_perfcntr_groups;
extern const struct fd_perfcntr_group a6xx_perfcntr_groups[];
extern const unsigned a6xx_num_perfcntr_groups;
extern const struct fd_perfcntr_group a7xx_perfcntr_groups[];
extern const unsigned a7xx_num_perfcntr_groups;
const struct fd_perfcntr_group *
fd_perfcntrs(const struct fd_dev_id *id, unsigned *count)
{
@@ -50,6 +53,9 @@ fd_perfcntrs(const struct fd_dev_id *id, unsigned *count)
case 6:
*count = a6xx_num_perfcntr_groups;
return a6xx_perfcntr_groups;
case 7:
*count = a7xx_num_perfcntr_groups;
return a7xx_perfcntr_groups;
default:
*count = 0;
return NULL;
+9 -5
View File
@@ -99,22 +99,26 @@ struct fd_perfcntr_group {
const struct fd_perfcntr_group *fd_perfcntrs(const struct fd_dev_id *id, unsigned *count);
#define COUNTER(_sel, _lo, _hi) { \
.select_reg = REG(_sel), .counter_reg_lo = REG(_lo), \
.counter_reg_hi = REG(_hi), \
#define COUNTER_BASE(_sel, _lo, _hi) { \
.select_reg = _sel, .counter_reg_lo = _lo, .counter_reg_hi = _hi, \
}
#define COUNTER(_sel, _lo, _hi) COUNTER_BASE(REG(_sel), REG(_lo), REG(_hi))
#define COUNTER2(_sel, _lo, _hi, _en, _clr) { \
.select_reg = REG(_sel), .counter_reg_lo = REG(_lo), \
.counter_reg_hi = REG(_hi), .enable = REG(_en), .clear = REG(_clr), \
}
#define COUNTABLE(_selector, _query_type, _result_type) { \
.name = #_selector, .selector = _selector, \
#define COUNTABLE_BASE(_sel_name, _sel, _query_type, _result_type ) { \
.name = _sel_name, .selector = _sel, \
.query_type = FD_PERFCNTR_TYPE_##_query_type, \
.result_type = FD_PERFCNTR_RESULT_TYPE_##_result_type, \
}
#define COUNTABLE(_selector, _query_type, _result_type) \
COUNTABLE_BASE(#_selector, _selector, _query_type, _result_type)
#define GROUP(_name, _counters, _countables) { \
.name = _name, .num_counters = ARRAY_SIZE(_counters), \
.counters = _counters, .num_countables = ARRAY_SIZE(_countables), \
+1
View File
@@ -22,6 +22,7 @@ libfreedreno_perfcntrs_files = files(
'fd2_perfcntr.c',
'fd5_perfcntr.c',
'fd6_perfcntr.c',
'fd7_perfcntr.c',
'freedreno_dt.c',
'freedreno_dt.h',
'freedreno_perfcntr.c',
File diff suppressed because it is too large Load Diff