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

Author: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Date:   Wed Dec  2 23:52:07 2015 +0100

nvc0: expose a group of performance metrics for SM30 (Kepler)

This allows to monitor these performance metrics through
GL_AMD_performance_monitor.

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>

---

 src/gallium/drivers/nouveau/nvc0/nvc0_query.c           |    8 +++++++-
 src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c |    2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index d992b10..3845d61 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -187,7 +187,7 @@ nvc0_screen_get_driver_query_group_info(struct pipe_screen 
*pscreen,
    if (screen->base.device->drm_version >= 0x01000101) {
       if (screen->compute) {
          if (screen->base.class_3d == NVE4_3D_CLASS) {
-            count++;
+            count += 2;
          } else
          if (screen->base.class_3d < NVE4_3D_CLASS) {
             count += 2;
@@ -222,6 +222,12 @@ nvc0_screen_get_driver_query_group_info(struct pipe_screen 
*pscreen,
    } else
    if (id == NVC0_HW_METRIC_QUERY_GROUP) {
       if (screen->compute) {
+          if (screen->base.class_3d == NVE4_3D_CLASS) {
+            info->name = "Performance metrics";
+            info->max_active_queries = 1;
+            info->num_queries = NVE4_HW_METRIC_QUERY_COUNT;
+            return 1;
+         } else
          if (screen->base.class_3d < NVE4_3D_CLASS) {
             info->name = "Performance metrics";
             info->max_active_queries = 1;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c 
b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c
index 756ba4e..12fb609 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c
@@ -587,7 +587,7 @@ nvc0_hw_metric_get_driver_query_info(struct nvc0_screen 
*screen, unsigned id,
          if (screen->base.class_3d == NVE4_3D_CLASS) {
             info->name = nve4_hw_metric_names[id];
             info->query_type = NVE4_HW_METRIC_QUERY(id);
-            info->group_id = -1;
+            info->group_id = NVC0_HW_METRIC_QUERY_GROUP;
             return 1;
          } else
          if (class_3d < NVE4_3D_CLASS) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to