diff options
author | Christian Gmeiner <[email protected]> | 2018-03-25 22:30:06 +0200 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2018-04-08 22:23:38 +0200 |
commit | c320b158f516276fed27b793e5d77b78015a2b9b (patch) | |
tree | 932d0d83f5576d21ff77ead6c48ad4c82a217ea7 /src/gallium/drivers | |
parent | 5a3b744ed254226810469e404f2ae00a6cd0682b (diff) |
etnaviv: add query_group_info for perfmon counters
Signed-off-by: Christian Gmeiner <[email protected]>
Tested-by: Chris Healy <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_query_pm.c | 45 | ||||
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_query_pm.h | 5 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_pm.c b/src/gallium/drivers/etnaviv/etnaviv_query_pm.c index 04d43c39818..981cfd2c4d1 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_pm.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_pm.c @@ -46,6 +46,17 @@ struct etna_perfmon_config const struct etna_perfmon_source *source; }; +static const char *group_names[] = { + [ETNA_QUERY_HI_GROUP_ID] = "HI", + [ETNA_QUERY_PE_GROUP_ID] = "PE", + [ETNA_QUERY_SH_GROUP_ID] = "SH", + [ETNA_QUERY_PA_GROUP_ID] = "PA", + [ETNA_QUERY_SE_GROUP_ID] = "SE", + [ETNA_QUERY_RA_GROUP_ID] = "RA", + [ETNA_QUERY_TX_GROUP_ID] = "TX", + [ETNA_QUERY_MC_GROUP_ID] = "MC", +}; + static const struct etna_perfmon_config query_config[] = { { .name = "hi-total-cyles", @@ -631,3 +642,37 @@ etna_pm_get_driver_query_info(struct pipe_screen *pscreen, unsigned index, return 1; } + +static +unsigned query_count(unsigned group) +{ + unsigned count = 0; + + for (unsigned i = 0; i < ARRAY_SIZE(query_config); i++) + if (query_config[i].group_id == group) + count++; + + assert(count); + + return count; +} + +int +etna_pm_get_driver_query_group_info(struct pipe_screen *pscreen, + unsigned index, + struct pipe_driver_query_group_info *info) +{ + if (!info) + return ARRAY_SIZE(group_names); + + if (index >= ARRAY_SIZE(group_names)) + return 0; + + unsigned count = query_count(index); + + info->name = group_names[index]; + info->max_active_queries = count; + info->num_queries = count; + + return 1; +} diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_pm.h b/src/gallium/drivers/etnaviv/etnaviv_query_pm.h index 23d125f2f7a..e80310cabf8 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_pm.h +++ b/src/gallium/drivers/etnaviv/etnaviv_query_pm.h @@ -121,4 +121,9 @@ int etna_pm_get_driver_query_info(struct pipe_screen *pscreen, unsigned index, struct pipe_driver_query_info *info); +int +etna_pm_get_driver_query_group_info(struct pipe_screen *pscreen, + unsigned index, + struct pipe_driver_query_group_info *info); + #endif |