summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv/etnaviv_context.c
diff options
context:
space:
mode:
authorChristian Gmeiner <[email protected]>2017-10-19 23:12:45 +0200
committerChristian Gmeiner <[email protected]>2017-10-20 12:42:40 +0200
commit282d8698ec4d792a8eeb1a4b1cd8c85b4fd8ac8d (patch)
tree205dc53696979fcfc27bf0b9dd36f6fa2e416b5b /src/gallium/drivers/etnaviv/etnaviv_context.c
parentb8c335c91b67e6bf2fa7b81fa3fb1a71c9dc540a (diff)
etnaviv: add basic infrastructure for hw queries
No hardware query is supported yet. v1 -> v2 - removed query_type from strcut etna_hw_sample_provider Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Wladimir J. van der Laan <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_context.c')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_context.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
index 67aab6a68c3..65c20d2f83a 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_context.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
@@ -34,6 +34,7 @@
#include "etnaviv_emit.h"
#include "etnaviv_fence.h"
#include "etnaviv_query.h"
+#include "etnaviv_query_hw.h"
#include "etnaviv_rasterizer.h"
#include "etnaviv_screen.h"
#include "etnaviv_shader.h"
@@ -260,6 +261,9 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
if (ctx->sampler_view[i])
resource_read(ctx, ctx->sampler_view[i]->texture);
+ list_for_each_entry(struct etna_hw_query, hq, &ctx->active_hw_queries, node)
+ resource_written(ctx, hq->prsc);
+
ctx->stats.prims_emitted += u_reduced_prims_for_vertices(info->mode, info->count);
ctx->stats.draw_calls++;
@@ -299,10 +303,16 @@ etna_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
struct etna_context *ctx = etna_context(pctx);
int out_fence_fd = -1;
+ list_for_each_entry(struct etna_hw_query, hq, &ctx->active_hw_queries, node)
+ etna_hw_query_suspend(hq, ctx);
+
etna_cmd_stream_flush2(ctx->stream, ctx->in_fence_fd,
(flags & PIPE_FLUSH_FENCE_FD) ? &out_fence_fd :
NULL);
+ list_for_each_entry(struct etna_hw_query, hq, &ctx->active_hw_queries, node)
+ etna_hw_query_resume(hq, ctx);
+
if (fence)
*fence = etna_fence_create(pctx, out_fence_fd);
}
@@ -436,6 +446,7 @@ etna_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
goto fail;
slab_create_child(&ctx->transfer_pool, &screen->transfer_pool);
+ list_inithead(&ctx->active_hw_queries);
return pctx;