[Mesa-dev] [PATCH 5/8] radeonsi: don't expose performance counters for non-existent blocks
Marek Olšák
maraeo at gmail.com
Sat Jun 9 03:16:52 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_perfcounter.c | 29 ++++++++++---------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_perfcounter.c b/src/gallium/drivers/radeonsi/si_perfcounter.c
index ad62e55f227..346d4c50044 100644
--- a/src/gallium/drivers/radeonsi/si_perfcounter.c
+++ b/src/gallium/drivers/radeonsi/si_perfcounter.c
@@ -338,87 +338,87 @@ static struct si_pc_block_base cik_SRBM = {
/* Both the number of instances and selectors varies between chips of the same
* class. We only differentiate by class here and simply expose the maximum
* number over all chips in a class.
*
* Unfortunately, GPUPerfStudio uses the order of performance counter groups
* blindly once it believes it has identified the hardware, so the order of
* blocks here matters.
*/
static struct si_pc_block groups_CIK[] = {
- { &cik_CB, 226, 4 },
+ { &cik_CB, 226},
{ &cik_CPF, 17 },
- { &cik_DB, 257, 4 },
+ { &cik_DB, 257},
{ &cik_GRBM, 34 },
{ &cik_GRBMSE, 15 },
{ &cik_PA_SU, 153 },
{ &cik_PA_SC, 395 },
{ &cik_SPI, 186 },
{ &cik_SQ, 252 },
{ &cik_SX, 32 },
{ &cik_TA, 111, 11 },
{ &cik_TCA, 39, 2 },
- { &cik_TCC, 160, 16 },
+ { &cik_TCC, 160},
{ &cik_TD, 55, 11 },
{ &cik_TCP, 154, 11 },
{ &cik_GDS, 121 },
{ &cik_VGT, 140 },
{ &cik_IA, 22 },
{ &cik_MC, 22 },
{ &cik_SRBM, 19 },
{ &cik_WD, 22 },
{ &cik_CPG, 46 },
{ &cik_CPC, 22 },
};
static struct si_pc_block groups_VI[] = {
- { &cik_CB, 405, 4 },
+ { &cik_CB, 405},
{ &cik_CPF, 19 },
- { &cik_DB, 257, 4 },
+ { &cik_DB, 257},
{ &cik_GRBM, 34 },
{ &cik_GRBMSE, 15 },
{ &cik_PA_SU, 153 },
{ &cik_PA_SC, 397 },
{ &cik_SPI, 197 },
{ &cik_SQ, 273 },
{ &cik_SX, 34 },
{ &cik_TA, 119, 16 },
{ &cik_TCA, 35, 2 },
- { &cik_TCC, 192, 16 },
+ { &cik_TCC, 192},
{ &cik_TD, 55, 16 },
{ &cik_TCP, 180, 16 },
{ &cik_GDS, 121 },
{ &cik_VGT, 147 },
{ &cik_IA, 24 },
{ &cik_MC, 22 },
{ &cik_SRBM, 27 },
{ &cik_WD, 37 },
{ &cik_CPG, 48 },
{ &cik_CPC, 24 },
};
static struct si_pc_block groups_gfx9[] = {
- { &cik_CB, 438, 4 },
+ { &cik_CB, 438},
{ &cik_CPF, 32 },
- { &cik_DB, 328, 4 },
+ { &cik_DB, 328},
{ &cik_GRBM, 38 },
{ &cik_GRBMSE, 16 },
{ &cik_PA_SU, 292 },
{ &cik_PA_SC, 491 },
{ &cik_SPI, 196 },
{ &cik_SQ, 374 },
{ &cik_SX, 208 },
{ &cik_TA, 119, 16 },
{ &cik_TCA, 35, 2 },
- { &cik_TCC, 256, 16 },
+ { &cik_TCC, 256},
{ &cik_TD, 57, 16 },
{ &cik_TCP, 85, 16 },
{ &cik_GDS, 121 },
{ &cik_VGT, 148 },
{ &cik_IA, 32 },
{ &cik_WD, 58 },
{ &cik_CPG, 59 },
{ &cik_CPC, 35 },
};
@@ -697,24 +697,27 @@ void si_init_perfcounters(struct si_screen *screen)
pc->emit_read = si_pc_emit_read;
pc->cleanup = si_pc_cleanup;
if (!si_perfcounters_init(pc, num_blocks))
goto error;
for (i = 0; i < num_blocks; ++i) {
struct si_pc_block *block = &blocks[i];
unsigned instances = block->instances;
- if (!strcmp(block->b->name, "IA")) {
- if (screen->info.max_se > 2)
- instances = 2;
- }
+ if (!strcmp(block->b->name, "CB") ||
+ !strcmp(block->b->name, "DB"))
+ instances = screen->info.max_se;
+ else if (!strcmp(block->b->name, "TCC"))
+ instances = screen->info.num_tcc_blocks;
+ else if (!strcmp(block->b->name, "IA"))
+ instances = MAX2(1, screen->info.max_se / 2);
si_perfcounters_add_block(screen, pc,
block->b->name,
block->b->flags,
block->b->num_counters,
block->selectors,
instances,
block);
}
--
2.17.1
More information about the mesa-dev
mailing list