summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2013-03-29 13:50:44 +0100
committerChristoph Bumiller <[email protected]>2013-04-03 12:54:43 +0200
commit6bca4e7085b5ce76ae065f40df39f6e3481d7475 (patch)
treea5d4b6820f6d03dfcbd02e063391ba65e0f3f2c1 /src/gallium/drivers/nvc0
parent3d2790cead7eb744341e8b1708b7a6d03524768d (diff)
nvc0: use fence to check state of queries that don't write sequence
This still isn't optimal, since the fence will signal a bit late, but better than checking on the bo, which may never be ready if it is shared (which is likely).
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_query.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_query.c b/src/gallium/drivers/nvc0/nvc0_query.c
index 5c4431e5af5..cd0dacd821b 100644
--- a/src/gallium/drivers/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nvc0/nvc0_query.c
@@ -46,6 +46,7 @@ struct nvc0_query {
boolean is64bit;
uint8_t rotate;
int nesting; /* only used for occlusion queries */
+ struct nouveau_fence *fence;
struct nouveau_mm_allocation *mm;
};
@@ -98,6 +99,7 @@ static void
nvc0_query_destroy(struct pipe_context *pipe, struct pipe_query *pq)
{
nvc0_query_allocate(nvc0_context(pipe), nvc0_query(pq), 0);
+ nouveau_fence_ref(NULL, &nvc0_query(pq)->fence);
FREE(nvc0_query(pq));
}
@@ -337,13 +339,15 @@ nvc0_query_end(struct pipe_context *pipe, struct pipe_query *pq)
nve4_mp_pm_query_end(nvc0, q);
break;
}
+ if (q->is64bit)
+ nouveau_fence_ref(nvc0->screen->base.fence.current, &q->fence);
}
static INLINE void
nvc0_query_update(struct nouveau_client *cli, struct nvc0_query *q)
{
if (q->is64bit) {
- if (!nouveau_bo_map(q->bo, NOUVEAU_BO_RD | NOUVEAU_BO_NOBLOCK, cli))
+ if (nouveau_fence_signalled(q->fence))
q->state = NVC0_QUERY_STATE_READY;
} else {
if (q->data[0] == q->sequence)