Mesa (master): nvc0: fix wrong max value for driver queries

Ilia Mirkin imirkin at kemper.freedesktop.org
Tue Mar 10 00:51:05 UTC 2015


Module: Mesa
Branch: master
Commit: e5cd42ed9abadac8be085eea67049dc1e19ade09
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e5cd42ed9abadac8be085eea67049dc1e19ade09

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Sun Mar  8 17:18:07 2015 +0100

nvc0: fix wrong max value for driver queries

The maximum value of a Gallium HUD's panel is automatically adjusted
when the current value is greater than the max. If we set the
pipe_query_driver_info::max_value to UINT64_MAX, the maximum value is
never adjusted and this results in a flat line instead of a pretty curve
which is correctly scaled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/nvc0/nvc0_query.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index ec464b5..f21deea 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 = ~0ULL;
+      info->max_value = 0;
       info->uses_byte_units = !!strstr(info->name, "bytes");
       return 1;
    } else
@@ -1427,15 +1427,14 @@ 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) ?
-            ~0ULL : 100;
+         info->max_value = (id < NVE4_PM_QUERY_METRIC_MP_OCCUPANCY) ? 0 : 100;
          info->uses_byte_units = FALSE;
          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 = ~0ULL;
+         info->max_value = 0;
          info->uses_byte_units = FALSE;
          return 1;
       }




More information about the mesa-commit mailing list