[Mesa-dev] [PATCH 10/15] radeon: implement pipe_screen::get_driver_query_group_info v4

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Jul 11 11:23:07 PDT 2014


This enables GL_AMD_performance_monitor for radeon.

V2:
 - s/pipe_context/pipe_screen in the commit msg

V3:
 - use util_get_driver_query_group_info

V4:
 - add R600_QUERY_COUNT in r600_pipe_common.h

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/drivers/radeon/r600_pipe_common.c | 9 +++++++++
 src/gallium/drivers/radeon/r600_pipe_common.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index bcddde1..5bd7763 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -30,6 +30,7 @@
 #include "util/u_memory.h"
 #include "util/u_format_s3tc.h"
 #include "util/u_upload_mgr.h"
+#include "util/u_query.h"
 #include "vl/vl_decoder.h"
 #include "vl/vl_video_buffer.h"
 #include "radeon/radeon_video.h"
@@ -566,6 +567,13 @@ static int r600_get_driver_query_info(struct pipe_screen *screen,
 	return 1;
 }
 
+static int r600_get_driver_query_group_info(struct pipe_screen *screen,
+                  unsigned index,
+                  struct pipe_driver_query_group_info *info)
+{
+	return util_get_driver_query_group_info(index, R600_QUERY_COUNT, info);
+}
+
 static void r600_fence_reference(struct pipe_screen *screen,
 				 struct pipe_fence_handle **ptr,
 				 struct pipe_fence_handle *fence)
@@ -724,6 +732,7 @@ bool r600_common_screen_init(struct r600_common_screen *rscreen,
 	rscreen->b.get_compute_param = r600_get_compute_param;
 	rscreen->b.get_paramf = r600_get_paramf;
 	rscreen->b.get_driver_query_info = r600_get_driver_query_info;
+	rscreen->b.get_driver_query_group_info = r600_get_driver_query_group_info;
 	rscreen->b.get_timestamp = r600_get_timestamp;
 	rscreen->b.fence_finish = r600_fence_finish;
 	rscreen->b.fence_reference = r600_fence_reference;
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index d82adf5..87ea111 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -46,6 +46,7 @@
 #define R600_RESOURCE_FLAG_FLUSHED_DEPTH	(PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
 #define R600_RESOURCE_FLAG_FORCE_TILING		(PIPE_RESOURCE_FLAG_DRV_PRIV << 2)
 
+#define R600_QUERY_COUNT         8
 #define R600_QUERY_DRAW_CALLS		(PIPE_QUERY_DRIVER_SPECIFIC + 0)
 #define R600_QUERY_REQUESTED_VRAM	(PIPE_QUERY_DRIVER_SPECIFIC + 1)
 #define R600_QUERY_REQUESTED_GTT	(PIPE_QUERY_DRIVER_SPECIFIC + 2)
-- 
2.0.0



More information about the mesa-dev mailing list