diff options
Diffstat (limited to 'src/gallium/drivers/nouveau/nv30/nv30_query.c')
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nv30_query.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_query.c b/src/gallium/drivers/nouveau/nv30/nv30_query.c index aa9a12f..a047e15 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_query.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_query.c @@ -152,6 +152,7 @@ nv30_query_begin(struct pipe_context *pipe, struct pipe_query *pq) struct nv30_query *q = nv30_query(pq); struct nouveau_pushbuf *push = nv30->base.pushbuf; + pipe_mutex_lock(nv30->screen->base.push_mutex); switch (q->type) { case PIPE_QUERY_TIME_ELAPSED: q->qo[0] = nv30_query_object_new(nv30->screen); @@ -161,7 +162,7 @@ nv30_query_begin(struct pipe_context *pipe, struct pipe_query *pq) } break; case PIPE_QUERY_TIMESTAMP: - return true; + break; default: BEGIN_NV04(push, NV30_3D(QUERY_RESET), 1); PUSH_DATA (push, q->report); @@ -172,6 +173,7 @@ nv30_query_begin(struct pipe_context *pipe, struct pipe_query *pq) BEGIN_NV04(push, SUBC_3D(q->enable), 1); PUSH_DATA (push, 1); } + pipe_mutex_unlock(nv30->screen->base.push_mutex); return true; } @@ -183,6 +185,7 @@ nv30_query_end(struct pipe_context *pipe, struct pipe_query *pq) struct nv30_query *q = nv30_query(pq); struct nouveau_pushbuf *push = nv30->base.pushbuf; + pipe_mutex_lock(nv30->screen->base.push_mutex); q->qo[1] = nv30_query_object_new(screen); if (q->qo[1]) { BEGIN_NV04(push, NV30_3D(QUERY_GET), 1); @@ -194,6 +197,7 @@ nv30_query_end(struct pipe_context *pipe, struct pipe_query *pq) PUSH_DATA (push, 0); } PUSH_KICK (push); + pipe_mutex_unlock(nv30->screen->base.push_mutex); return true; } @@ -248,9 +252,11 @@ nv40_query_render_condition(struct pipe_context *pipe, nv30->render_cond_mode = mode; nv30->render_cond_cond = condition; + pipe_mutex_lock(nv30->screen->base.push_mutex); if (!pq) { BEGIN_NV04(push, SUBC_3D(0x1e98), 1); PUSH_DATA (push, 0x01000000); + pipe_mutex_unlock(nv30->screen->base.push_mutex); return; } @@ -262,6 +268,7 @@ nv40_query_render_condition(struct pipe_context *pipe, BEGIN_NV04(push, SUBC_3D(0x1e98), 1); PUSH_DATA (push, 0x02000000 | q->qo[1]->hw->start); + pipe_mutex_unlock(nv30->screen->base.push_mutex); } static void |