[Mesa-dev] [PATCH 15/15] nvc0: init all default values of pipe_driver_query_info

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jul 11 11:23:12 PDT 2014


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index fcca1cb..6f9a1e6 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -1409,6 +1409,14 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
    if (!info)
       return count;
 
+   /* Init default values. */
+   info->name = "this_is_not_the_query_you_are_looking_for";
+   info->query_type = 0xdeadd01d;
+   info->group_id = 0;
+   info->max_value.u64 = 0;
+   info->uses_byte_units = FALSE;
+   info->type = PIPE_DRIVER_QUERY_TYPE_UINT64;
+
 #ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
    if (id < NVC0_QUERY_DRV_STAT_COUNT) {
       info->name = nvc0_drv_stat_names[id];
@@ -1426,7 +1434,6 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
          info->group_id = NVC0_QUERY_PM_GROUP;
          info->max_value.u64 = (id < NVE4_PM_QUERY_METRIC_MP_OCCUPANCY) ?
             ~0ULL : 100;
-         info->uses_byte_units = FALSE;
          return 1;
       } else
       if (screen->compute) {
@@ -1434,16 +1441,10 @@ nvc0_screen_get_driver_query_info(struct pipe_screen *pscreen,
          info->query_type = NVC0_PM_QUERY(id - NVC0_QUERY_DRV_STAT_COUNT);
          info->group_id = NVC0_QUERY_PM_GROUP;
          info->max_value.u64 = ~0ULL;
-         info->uses_byte_units = FALSE;
          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->group_id = 0;
-   info->max_value.u64 = 0;
-   info->uses_byte_units = FALSE;
    return 0;
 }
 
-- 
2.0.0



More information about the mesa-dev mailing list