From 546ec980f850fee067fd1dddad19a8dfd6b7e672 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Mon, 7 Jul 2014 23:49:14 +0200 Subject: gallium: replace pipe_driver_query_info::max_value by a union MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows queries to return different numeric types. Signed-off-by: Samuel Pitoiset Reviewed-by: Marek Olšák Reviewed-by: Martin Peres --- src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/nouveau/nvc0') 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; } -- cgit v1.2.3