nvc0: ensure the query's fence has been emitted in nvc0_hw_query_fifo_wait

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@gmail.com>
[imirkin: use nouveau_fence_emit instead]
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
Rhys Perry 2018-04-05 22:31:25 +01:00 committed by Ilia Mirkin
parent 90bb2d7152
commit 98d15e0550

View file

@ -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)
nouveau_fence_emit(hq->fence);
if (q->type == PIPE_QUERY_SO_OVERFLOW_PREDICATE) offset += 0x20;
PUSH_SPACE(push, 5);