aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_perfcntr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_perfcntr.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_perfcntr.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_perfcntr.h b/src/gallium/drivers/freedreno/freedreno_perfcntr.h
index 79759307a34..0cc5485ff12 100644
--- a/src/gallium/drivers/freedreno/freedreno_perfcntr.h
+++ b/src/gallium/drivers/freedreno/freedreno_perfcntr.h
@@ -68,5 +68,33 @@ struct fd_perfcntr_group {
const struct fd_perfcntr_countable *countables;
};
+#define COUNTER(_sel, _lo, _hi) { \
+ .select_reg = REG(_sel), \
+ .counter_reg_lo = REG(_lo), \
+ .counter_reg_hi = 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, \
+ .query_type = PIPE_DRIVER_QUERY_TYPE_ ## _query_type, \
+ .result_type = PIPE_DRIVER_QUERY_RESULT_TYPE_ ## _result_type, \
+}
+
+#define GROUP(_name, _counters, _countables) { \
+ .name = _name, \
+ .num_counters = ARRAY_SIZE(_counters), \
+ .counters = _counters, \
+ .num_countables = ARRAY_SIZE(_countables), \
+ .countables = _countables, \
+}
#endif /* FREEDRENO_PERFCNTR_H_ */