summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2014-07-07 23:49:14 +0200
committerMartin Peres <[email protected]>2015-05-06 00:03:35 +0300
commit546ec980f850fee067fd1dddad19a8dfd6b7e672 (patch)
treee1dc8e58f75d3f0ba8b39c68a5e03e36c855421c /src/gallium/drivers/nouveau
parentd5b2832c1151337d37217a30bcb55d7f90dd1b47 (diff)
gallium: replace pipe_driver_query_info::max_value by a union
This allows queries to return different numeric types. Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Martin Peres <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_query.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index 5be150ea11c..477ca8027ca 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -1418,7 +1418,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->max_value = 0;
+ info->max_value.u64 = 0;
if (strstr(info->name, "bytes"))
info->type = PIPE_DRIVER_QUERY_TYPE_BYTES;
return 1;
@@ -1428,20 +1428,21 @@ 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->max_value = (id < NVE4_PM_QUERY_METRIC_MP_OCCUPANCY) ? 0 : 100;
+ info->max_value.u64 =
+ (id < NVE4_PM_QUERY_METRIC_MP_OCCUPANCY) ? 0 : 100;
return 1;
} else
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->max_value = 0;
+ info->max_value.u64 = 0;
return 1;
}
}
/* user asked for info about non-existing query */
info->name = "this_is_not_the_query_you_are_looking_for";
info->query_type = 0xdeadd01d;
- info->max_value = 0;
+ info->max_value.u64 = 0;
return 0;
}