diff options
author | Christoph Bumiller <[email protected]> | 2012-07-12 13:59:52 +0200 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2012-07-13 17:28:00 +0200 |
commit | 9ed65301e044711de0db51b4986085fca170d764 (patch) | |
tree | e83ec0d3f359713913086a38742d2f6300b169c3 /src/gallium/drivers/nv50/nv50_query.c | |
parent | 426a23af147720ae3b89995ffee792a29e8ae2db (diff) |
nouveau: implement missing timer query functionality
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_query.c')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_query.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c index 8e62c5f11bc..f9ac33d2623 100644 --- a/src/gallium/drivers/nv50/nv50_query.c +++ b/src/gallium/drivers/nv50/nv50_query.c @@ -215,11 +215,15 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq) nv50_query_get(push, q, 0x00, 0x05805002); nv50_query_get(push, q, 0x10, 0x06805002); break; + case PIPE_QUERY_TIMESTAMP: + q->sequence++; + /* fall through */ case PIPE_QUERY_TIMESTAMP_DISJOINT: case PIPE_QUERY_TIME_ELAPSED: nv50_query_get(push, q, 0, 0x00005002); break; case PIPE_QUERY_GPU_FINISHED: + q->sequence++; nv50_query_get(push, q, 0, 0x1000f010); break; case NVA0_QUERY_STREAM_OUTPUT_BUFFER_OFFSET: @@ -229,7 +233,7 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq) assert(0); break; } - q->flushed = FALSE; + q->ready = q->flushed = FALSE; } static INLINE boolean @@ -280,9 +284,12 @@ nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq, res64[0] = data64[0] - data64[4]; res64[1] = data64[2] - data64[6]; break; + case PIPE_QUERY_TIMESTAMP: + res64[0] = data64[1]; + break; case PIPE_QUERY_TIMESTAMP_DISJOINT: /* u32 sequence, u32 0, u64 time */ res64[0] = 1000000000; - res8[8] = (data64[0] == data64[2]) ? FALSE : TRUE; + res8[8] = (data64[1] == data64[3]) ? FALSE : TRUE; break; case PIPE_QUERY_TIME_ELAPSED: res64[0] = data64[1] - data64[3]; |