summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a3xx
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-04-21 09:50:30 -0400
committerRob Clark <[email protected]>2017-04-22 10:03:01 -0400
commitdf63ff4d8248d81ecb8d0f3059bf2c67431e6f2f (patch)
tree6bdc94b7326d0367ebdf6b5579fca13e19997ff4 /src/gallium/drivers/freedreno/a3xx
parent2faf227ec2e22c7a37e0a54783a3f0a0062ac852 (diff)
freedreno: make hw-query a helper
For a5xx (and actually some queries on a4xx) we can accumulate results in the cmdstream, so we don't need this elaborate mechanism of tracking per-tile query results. So make it into vfuncs so generation specific backend can use it when it makes sense. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_context.c5
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_query.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_context.c b/src/gallium/drivers/freedreno/a3xx/fd3_context.c
index dac59418df0..b432f593e0f 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_context.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_context.c
@@ -26,6 +26,7 @@
* Rob Clark <[email protected]>
*/
+#include "freedreno_query_hw.h"
#include "fd3_context.h"
#include "fd3_blend.h"
@@ -51,6 +52,8 @@ fd3_context_destroy(struct pipe_context *pctx)
u_upload_destroy(fd3_ctx->border_color_uploader);
+ fd_hw_query_fini(pctx);
+
fd_context_destroy(pctx);
}
@@ -95,6 +98,8 @@ fd3_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
if (!pctx)
return NULL;
+ fd_hw_query_init(pctx);
+
fd3_ctx->vs_pvt_mem = fd_bo_new(screen->dev, 0x2000,
DRM_FREEDRENO_GEM_TYPE_KMEM);
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_query.c b/src/gallium/drivers/freedreno/a3xx/fd3_query.c
index cce165c0410..cde42c37313 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_query.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_query.c
@@ -133,6 +133,13 @@ static const struct fd_hw_sample_provider occlusion_predicate = {
void fd3_query_context_init(struct pipe_context *pctx)
{
+ struct fd_context *ctx = fd_context(pctx);
+
+ ctx->create_query = fd_hw_create_query;
+ ctx->query_prepare = fd_hw_query_prepare;
+ ctx->query_prepare_tile = fd_hw_query_prepare_tile;
+ ctx->query_set_stage = fd_hw_query_set_stage;
+
fd_hw_query_register_provider(pctx, &occlusion_counter);
fd_hw_query_register_provider(pctx, &occlusion_predicate);
}