This enables GL_AMD_performance_monitor for radeon.

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Reviewed-by: Marek Olšák <marek.ol...@amd.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 79acfc8..318ce46 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -31,6 +31,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"
@@ -670,6 +671,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)
@@ -828,6 +836,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 a08d08c..b7d7b44 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -47,6 +47,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.3.3

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

Reply via email to