[Mesa-dev] [PATCH 04/11] nvc0: use of pipe_driver_query_info::group_id
Samuel Pitoiset
samuel.pitoiset at gmail.com
Sat Jul 5 11:49:08 PDT 2014
This adds two groups of queries.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 4 ++++
src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index 50cef1e..9f40256 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -1409,6 +1409,7 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
if (id < NVC0_QUERY_DRV_STAT_COUNT) {
info->name = nvc0_drv_stat_names[id];
info->query_type = NVC0_QUERY_DRV_STAT(id);
+ info->group_id = NVC0_QUERY_DRV_STAT_GROUP;
info->max_value = ~0ULL;
info->uses_byte_units = !!strstr(info->name, "bytes");
return 1;
@@ -1418,6 +1419,7 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
if (screen->base.class_3d >= NVE4_3D_CLASS) {
info->name = nve4_pm_query_names[id - NVC0_QUERY_DRV_STAT_COUNT];
info->query_type = NVE4_PM_QUERY(id - NVC0_QUERY_DRV_STAT_COUNT);
+ info->group_id = NVC0_QUERY_PM_GROUP;
info->max_value = (id < NVE4_PM_QUERY_METRIC_MP_OCCUPANCY) ?
~0ULL : 100;
info->uses_byte_units = FALSE;
@@ -1426,6 +1428,7 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
if (screen->compute) {
info->name = nvc0_pm_query_names[id - NVC0_QUERY_DRV_STAT_COUNT];
info->query_type = NVC0_PM_QUERY(id - NVC0_QUERY_DRV_STAT_COUNT);
+ info->group_id = NVC0_QUERY_PM_GROUP;
info->max_value = ~0ULL;
info->uses_byte_units = FALSE;
return 1;
@@ -1434,6 +1437,7 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
/* user asked for info about non-existing query */
info->name = "this_is_not_the_query_you_are_looking_for";
info->query_type = 0xdeadd01d;
+ info->group_id = 0;
info->max_value = 0;
info->uses_byte_units = FALSE;
return 0;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
index 4802057..fc3b73c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
@@ -88,6 +88,11 @@ nvc0_screen(struct pipe_screen *screen)
return (struct nvc0_screen *)screen;
}
+/*
+ * Performance counter groups:
+ */
+#define NVC0_QUERY_DRV_STAT_GROUP 0
+#define NVC0_QUERY_PM_GROUP 1
/* Performance counter queries:
*/
--
2.0.0
More information about the mesa-dev
mailing list