Mesa (master): gallium: add pipe_screen::get_driver_query_group_info
Martin Peres
mperes at kemper.freedesktop.org
Tue May 5 21:17:10 UTC 2015
Module: Mesa
Branch: master
Commit: f137f5c691f5bd97a8b7f881f1f6837bff0ebc7a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f137f5c691f5bd97a8b7f881f1f6837bff0ebc7a
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Fri Jul 4 11:24:02 2014 +0200
gallium: add pipe_screen::get_driver_query_group_info
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 at gmail.com>
Reviewed-by: Martin Peres <martin.peres at free.fr>
---
src/gallium/docs/source/screen.rst | 10 ++++++++++
src/gallium/include/pipe/p_defines.h | 14 ++++++++++++++
src/gallium/include/pipe/p_screen.h | 11 +++++++++++
3 files changed, 35 insertions(+)
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index 4386bcf..68931cf 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -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.
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 67f48e4..c1e660e 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -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
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index 21e7dd3..98b2159 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -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);
+
};
More information about the mesa-commit
mailing list