From 6e75f2172b5cc9298dee6f17e55bed60ce0c15fb Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Fri, 29 Nov 2019 09:44:43 +0100 Subject: [PATCH] etnaviv: update resource status after flushing Currently piglit spec@arb_occlusion_query@occlusion_query_conform spins for ever as the resource status is never reset. See etna_hw_get_query_result(..) for more details. Fixes: 1456aa61cc5 ("etnaviv: Rework resource status tracking") CC: Signed-off-by: Christian Gmeiner Tested-by: Marek Vasut --- src/gallium/drivers/etnaviv/etnaviv_context.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c index 5f455c4412a..5652107f4dc 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_context.c +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c @@ -460,6 +460,10 @@ etna_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence, _mesa_set_remove_key(rsc->pending_ctx, ctx); + /* if resource has no pending ctx's reset its status */ + if (_mesa_set_next_entry(rsc->pending_ctx, NULL) == NULL) + rsc->status &= ~ETNA_PENDING_READ; + pipe_resource_reference(&referenced, NULL); } _mesa_set_clear(ctx->used_resources_read, NULL); @@ -470,6 +474,10 @@ etna_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence, _mesa_set_remove_key(rsc->pending_ctx, ctx); + /* if resource has no pending ctx's reset its status */ + if (_mesa_set_next_entry(rsc->pending_ctx, NULL) == NULL) + rsc->status &= ~ETNA_PENDING_WRITE; + pipe_resource_reference(&referenced, NULL); } _mesa_set_clear(ctx->used_resources_write, NULL); -- 2.30.2