[Mesa-dev] [PATCH 1/2] nvc0: ensure the query's fence has been emitted in nvco_hw_query_fifo_wait

Rhys Perry pendingchaos02 at gmail.com
Thu Apr 5 21:31:25 UTC 2018


If the fence has not been emitted, hq->fence->sequence would be zero. This
would result in the semaphore never being triggered, blocking all later
commands in the pushbuf.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
---
 src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
index 83a57fa011..75a2d7f172 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query_hw.c
@@ -611,6 +611,10 @@ nvc0_hw_query_fifo_wait(struct nvc0_context *nvc0, struct nvc0_query *q)
    struct nvc0_hw_query *hq = nvc0_hw_query(q);
    unsigned offset = hq->offset;
 
+   /* ensure the query's fence has been emitted */
+   if (hq->is64bit && hq->fence->state<NOUVEAU_FENCE_STATE_EMITTED)
+      PUSH_KICK(push);
+
    if (q->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE) offset += 0x20;
 
    PUSH_SPACE(push, 5);
-- 
2.14.3



More information about the mesa-dev mailing list