nvc0: expose a group of performance metrics on Fermi
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 28 Oct 2015 10:20:36 +0000 (11:20 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 29 Oct 2015 22:01:29 +0000 (23:01 +0100)
This allows to monitor those performance metrics through
GL_AMD_performance_monitor.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/nouveau/nvc0/nvc0_query.c
src/gallium/drivers/nouveau/nvc0/nvc0_query.h
src/gallium/drivers/nouveau/nvc0/nvc0_query_hw_metric.c

index e4752e2dbc594c959f34327478d701f338ffdb29..f53921092a53f55dc822479d6b60acc7616e4537 100644 (file)
@@ -28,6 +28,7 @@
 #include "nvc0/nvc0_query.h"
 #include "nvc0/nvc0_query_sw.h"
 #include "nvc0/nvc0_query_hw.h"
+#include "nvc0/nvc0_query_hw_metric.h"
 #include "nvc0/nvc0_query_hw_sm.h"
 
 static struct pipe_query *
@@ -188,7 +189,7 @@ nvc0_screen_get_driver_query_group_info(struct pipe_screen *pscreen,
             count++;
          } else
          if (screen->base.class_3d < NVE4_3D_CLASS) {
-            count++;
+            count += 2;
          }
       }
    }
@@ -218,6 +219,17 @@ nvc0_screen_get_driver_query_group_info(struct pipe_screen *pscreen,
             return 1;
          }
       }
+   } else
+   if (id == NVC0_HW_METRIC_QUERY_GROUP) {
+      if (screen->compute) {
+         if (screen->base.class_3d < NVE4_3D_CLASS) {
+            info->name = "Performance metrics";
+            info->type = PIPE_DRIVER_QUERY_GROUP_TYPE_GPU;
+            info->max_active_queries = 1;
+            info->num_queries = NVC0_HW_METRIC_QUERY_COUNT;
+            return 1;
+         }
+      }
    }
 #ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
    else if (id == NVC0_SW_QUERY_DRV_STAT_GROUP) {
index 6883ab6ab9d50937c5bff9dc930cc6c327f662a6..c46361c31aa2933614e5ceeae27138ab95e3bba2 100644 (file)
@@ -32,7 +32,8 @@ nvc0_query(struct pipe_query *pipe)
  * Driver queries groups:
  */
 #define NVC0_HW_SM_QUERY_GROUP       0
-#define NVC0_SW_QUERY_DRV_STAT_GROUP 1
+#define NVC0_HW_METRIC_QUERY_GROUP   1
+#define NVC0_SW_QUERY_DRV_STAT_GROUP 2
 
 void nvc0_init_query_functions(struct nvc0_context *);
 
index 25aa09be42a8c540f0c8ed79ac3cf1361d635064..fb2806a805efc94519cda4cc918eadc9a5231354 100644 (file)
@@ -431,7 +431,7 @@ nvc0_hw_metric_get_driver_query_info(struct nvc0_screen *screen, unsigned id,
             id = nvc0_hw_metric_get_next_query_id(queries, id);
             info->name = nvc0_hw_metric_names[id];
             info->query_type = NVC0_HW_METRIC_QUERY(id);
-            info->group_id = -1;
+            info->group_id = NVC0_HW_METRIC_QUERY_GROUP;
             return 1;
          }
       }