gallium: add pipe_screen::get_driver_query_group_info
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 4 Jul 2014 09:24:02 +0000 (11:24 +0200)
committerMartin Peres <martin.peres@linux.intel.com>
Tue, 5 May 2015 21:03:35 +0000 (00:03 +0300)
Driver queries are organized as a single hierarchy where queries are
categorized into groups. Each group has a list of queries and a maximum
number of queries that can be sampled. The list of available groups can
be obtained using pipe_screen::get_driver_query_group_info.

This will be used by GL_AMD_performance monitor.

v2: add group type (CPU/GPU)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Martin Peres <martin.peres@free.fr>
src/gallium/docs/source/screen.rst
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_screen.h

index 4386bcfb5accb941e6a4b16c750ca56275b747b5..68931cf35196c5953285841efa6a5c2870c15ad0 100644 (file)
@@ -588,3 +588,13 @@ query at the specified **index** is returned in **info**.
 The function returns non-zero on success.
 The driver-specific query is described with the pipe_driver_query_info
 structure.
+
+get_driver_query_group_info
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Return a driver-specific query group. If the **info** parameter is NULL,
+the number of available groups is returned.  Otherwise, the driver
+query group at the specified **index** is returned in **info**.
+The function returns non-zero on success.
+The driver-specific query group is described with the
+pipe_driver_query_group_info structure.
index 67f48e42936b090d115ea703c4f1890a579bf6d2..c1e660e899cb0257bd75c31ad5b9bac37ddb5be6 100644 (file)
@@ -752,6 +752,12 @@ union pipe_color_union
    unsigned int ui[4];
 };
 
+enum pipe_driver_query_group_type
+{
+   PIPE_DRIVER_QUERY_GROUP_TYPE_CPU = 0,
+   PIPE_DRIVER_QUERY_GROUP_TYPE_GPU = 1,
+};
+
 struct pipe_driver_query_info
 {
    const char *name;
@@ -760,6 +766,14 @@ struct pipe_driver_query_info
    boolean uses_byte_units; /* whether the result is in bytes */
 };
 
+struct pipe_driver_query_group_info
+{
+   const char *name;
+   enum pipe_driver_query_group_type type;
+   unsigned max_active_queries;
+   unsigned num_queries;
+};
+
 #ifdef __cplusplus
 }
 #endif
index 21e7dd35ec0bf967edbf07b74124a7ddca7779a8..98b2159defe8d11385c91424f96adf14d937301f 100644 (file)
@@ -236,6 +236,17 @@ struct pipe_screen {
                                 unsigned index,
                                 struct pipe_driver_query_info *info);
 
+   /**
+    * Returns a driver-specific query group.
+    *
+    * If \p info is NULL, the number of available groups is returned.
+    * Otherwise, the driver query group at the specified \p index is returned
+    * in \p info. The function returns non-zero on success.
+    */
+   int (*get_driver_query_group_info)(struct pipe_screen *screen,
+                                      unsigned index,
+                                      struct pipe_driver_query_group_info *info);
+
 };