From 238190403068edf4c6a9b761095193a88bea841d Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Wed, 31 Jul 2019 20:10:14 +0200 Subject: [PATCH] etnaviv: explicitly call resource_written(..) We might end in cases where etna_acc_get_query_result(..) gets called within one draw call (aka before flushing). At this point the status of the resource was not set but gets used in etna_acc_get_query_result(..) to handle different wait cases. Fix this issue by calling resource_written(..) explicitly. Signed-off-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_context.c | 3 --- src/gallium/drivers/etnaviv/etnaviv_query_acc.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c index e91e6f11a3b..9f9c539a413 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.c +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c @@ -347,9 +347,6 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) } } - list_for_each_entry(struct etna_acc_query, aq, &ctx->active_acc_queries, node) - resource_written(ctx, aq->prsc); - ctx->stats.prims_emitted += u_reduced_prims_for_vertices(info->mode, info->count); ctx->stats.draw_calls++; diff --git a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c index 6e6fb6599ca..c025ee7144a 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_query_acc.c +++ b/src/gallium/drivers/etnaviv/etnaviv_query_acc.c @@ -59,6 +59,7 @@ occlusion_resume(struct etna_acc_query *aq, struct etna_context *ctx) r.offset = aq->samples * 8; /* 64bit value */ etna_set_state_reloc(ctx->stream, VIVS_GL_OCCLUSION_QUERY_ADDR, &r); + resource_written(ctx, aq->prsc); } static void @@ -66,6 +67,7 @@ occlusion_suspend(struct etna_acc_query *aq, struct etna_context *ctx) { /* 0x1DF5E76 is the value used by blob - but any random value will work */ etna_set_state(ctx->stream, VIVS_GL_OCCLUSION_QUERY_CONTROL, 0x1DF5E76); + resource_written(ctx, aq->prsc); } static void -- 2.30.2