summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2015-05-21 20:06:19 +0200
committerSamuel Pitoiset <[email protected]>2015-05-22 11:39:23 +0200
commit867fd2b5f586085c137af264e3eb640094e88526 (patch)
treefc444b34a6dd1803d9f6412c842b871f8655c0de /src
parent6921ea42a17c715c4b5b2d0092f9b9f4df42b10c (diff)
nv50: fix 64-bit queries with HUD, based on nvc0
A sequence number is written for 32-bits queries to make sure they are ready, but not for 64-bits queries. Instead, we have to use a fence in order to fix the HUD because it doesn't wait until the result is ready. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_query.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_query.c b/src/gallium/drivers/nouveau/nv50/nv50_query.c
index 6690aa282eb..a3c88411199 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_query.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_query.c
@@ -46,6 +46,7 @@ struct nv50_query {
boolean flushed;
boolean is64bit;
struct nouveau_mm_allocation *mm;
+ struct nouveau_fence *fence;
};
#define NV50_QUERY_ALLOC_SPACE 256
@@ -92,6 +93,7 @@ static void
nv50_query_destroy(struct pipe_context *pipe, struct pipe_query *pq)
{
nv50_query_allocate(nv50_context(pipe), nv50_query(pq), 0);
+ nouveau_fence_ref(NULL, &nv50_query(pq)->fence);
FREE(nv50_query(pq));
}
@@ -260,12 +262,22 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq)
break;
}
q->ready = q->flushed = FALSE;
+
+ if (q->is64bit)
+ nouveau_fence_ref(nv50->screen->base.fence.current, &q->fence);
}
static INLINE boolean
nv50_query_ready(struct nv50_query *q)
{
- return q->ready || (!q->is64bit && (q->data[0] == q->sequence));
+ if (q->is64bit) {
+ if (nouveau_fence_signalled(q->fence))
+ return TRUE;
+ } else {
+ if (q->data[0] == q->sequence)
+ return TRUE;
+ }
+ return FALSE;
}
static boolean