diff options
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_query.c | 11 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_screen.c | 2 |
2 files changed, 10 insertions, 3 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]; diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index c7344a1a382..3d510ea5f35 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -128,6 +128,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_VERTEX_COLOR_UNCLAMPED: case PIPE_CAP_VERTEX_COLOR_CLAMPED: return 1; + case PIPE_CAP_QUERY_TIMESTAMP: case PIPE_CAP_TIMER_QUERY: case PIPE_CAP_OCCLUSION_QUERY: return 1; @@ -172,7 +173,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY: case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY: - case PIPE_CAP_QUERY_TIMESTAMP: return 0; default: NOUVEAU_ERR("unknown PIPE_CAP %d\n", param); |