summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv/etnaviv_context.c
diff options
context:
space:
mode:
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;