[Mesa-dev] [PATCH v2] nv50, nvc0: Mark PIPE_QUERY_TIMESTAMP_DISJOINT as ready immediately

Tiziano Bacocco tizbac2 at gmail.com
Fri Feb 6 10:03:41 PST 2015


Without this when an application issues that query,
it would try to wait the result from the gpu, and since no query has
been actually issued, it will wait for ever

Signed-off-by: Tiziano Bacocco <tizbac2 at gmail.com>
---
 src/gallium/drivers/nouveau/nv50/nv50_query.c | 2 ++
 src/gallium/drivers/nouveau/nvc0/nvc0_query.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query.c b/src/gallium/drivers/nouveau/nv50/nv50_query.c
index e0671ce..b9c7d1e 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_query.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_query.c
@@ -231,6 +231,8 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq)
       nv50_query_get(push, q, 0, 0x0d005002 | (q->index << 5));
       break;
    case PIPE_QUERY_TIMESTAMP_DISJOINT:
+      /* This query is not issued on GPU because disjoint is forced to FALSE */
+      q->ready = TRUE;
       break;
    default:
       assert(0);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
index 3a6df9d..ec464b5 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_query.c
@@ -397,6 +397,10 @@ nvc0_query_end(struct pipe_context *pipe, struct pipe_query *pq)
       /* indexed by TFB buffer instead of by vertex stream */
       nvc0_query_get(push, q, 0x00, 0x0d005002 | (q->index << 5));
       break;
+   case PIPE_QUERY_TIMESTAMP_DISJOINT:
+      /* This query is not issued on GPU because disjoint is forced to FALSE */
+      q->state = NVC0_QUERY_STATE_READY;
+      break;
    default:
 #ifdef NOUVEAU_ENABLE_DRIVER_STATISTICS
       if (q->type >= NVC0_QUERY_DRV_STAT(0) &&
-- 
2.1.0



More information about the mesa-dev mailing list