summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a4xx
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/a4xx
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/a4xx')
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_context.c5
-rw-r--r--src/gallium/drivers/freedreno/a4xx/fd4_query.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_context.c b/src/gallium/drivers/freedreno/a4xx/fd4_context.c
index 291df2d03fc..db292af8be1 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_context.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_context.c
@@ -26,6 +26,7 @@
* Rob Clark <[email protected]>
*/
+#include "freedreno_query_hw.h"
#include "fd4_context.h"
#include "fd4_blend.h"
@@ -51,6 +52,8 @@ fd4_context_destroy(struct pipe_context *pctx)
u_upload_destroy(fd4_ctx->border_color_uploader);
+ fd_hw_query_fini(pctx);
+
fd_context_destroy(pctx);
}
@@ -95,6 +98,8 @@ fd4_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
if (!pctx)
return NULL;
+ fd_hw_query_init(pctx);
+
fd4_ctx->vs_pvt_mem = fd_bo_new(screen->dev, 0x2000,
DRM_FREEDRENO_GEM_TYPE_KMEM);
diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_query.c b/src/gallium/drivers/freedreno/a4xx/fd4_query.c
index 3ae3971dc5f..f7b385d552d 100644
--- a/src/gallium/drivers/freedreno/a4xx/fd4_query.c
+++ b/src/gallium/drivers/freedreno/a4xx/fd4_query.c
@@ -275,6 +275,13 @@ static const struct fd_hw_sample_provider timestamp = {
void fd4_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);
fd_hw_query_register_provider(pctx, &time_elapsed);