summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_query.h
diff options
context:
space:
mode:
authorNicolai Hähnle <nhaehnle@gmail.com>2015-11-18 12:05:11 +0100
committerNicolai Hähnle <nhaehnle@gmail.com>2015-11-18 12:27:13 +0100
commitc207c55fc08a1bf3dd40e79b3aaec34afbee2e55 (patch)
treeb03993158edabc2d081a081f2ec185fdb9f817ad /src/gallium/drivers/radeon/r600_query.h
parent1d10b3d01e8af58f3c14bf39af8b592860ab36aa (diff)
downloadexternal_mesa3d-c207c55fc08a1bf3dd40e79b3aaec34afbee2e55.zip
external_mesa3d-c207c55fc08a1bf3dd40e79b3aaec34afbee2e55.tar.gz
external_mesa3d-c207c55fc08a1bf3dd40e79b3aaec34afbee2e55.tar.bz2
radeon: split hw query buffer handling from cs emit
The idea here is that driver queries implemented outside of common code will use the same query buffer handling with different logic for starting and stopping the corresponding counters. Reviewed-by: Marek Olšák <marek.olsak@amd.com> [Fixed a rebase conflict and re-tested before pushing.]
Diffstat (limited to 'src/gallium/drivers/radeon/r600_query.h')
-rw-r--r--src/gallium/drivers/radeon/r600_query.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.h b/src/gallium/drivers/radeon/r600_query.h
index baad582..c5b720b 100644
--- a/src/gallium/drivers/radeon/r600_query.h
+++ b/src/gallium/drivers/radeon/r600_query.h
@@ -33,6 +33,7 @@
struct r600_common_context;
struct r600_query;
+struct r600_query_hw;
struct r600_resource;
#define R600_QUERY_DRAW_CALLS (PIPE_QUERY_DRIVER_SPECIFIC + 0)
@@ -67,6 +68,23 @@ struct r600_query {
unsigned type;
};
+enum {
+ R600_QUERY_HW_FLAG_NO_START = (1 << 0),
+ R600_QUERY_HW_FLAG_TIMER = (1 << 1),
+};
+
+struct r600_query_hw_ops {
+ void (*prepare_buffer)(struct r600_common_context *,
+ struct r600_query_hw *,
+ struct r600_resource *);
+ void (*emit_start)(struct r600_common_context *,
+ struct r600_query_hw *,
+ struct r600_resource *buffer, uint64_t va);
+ void (*emit_stop)(struct r600_common_context *,
+ struct r600_query_hw *,
+ struct r600_resource *buffer, uint64_t va);
+};
+
struct r600_query_buffer {
/* The buffer where query results are stored. */
struct r600_resource *buf;
@@ -80,6 +98,8 @@ struct r600_query_buffer {
struct r600_query_hw {
struct r600_query b;
+ struct r600_query_hw_ops *ops;
+ unsigned flags;
/* The query buffer and how many results are in it. */
struct r600_query_buffer buffer;