/* for custom non-GPU queries */
uint64_t begin_result;
uint64_t end_result;
+ /* Fence for GPU_FINISHED. */
+ struct pipe_fence_handle *fence;
};
/* Non-GPU queries. */
switch (type) {
case PIPE_QUERY_TIMESTAMP_DISJOINT:
+ case PIPE_QUERY_GPU_FINISHED:
case R600_QUERY_DRAW_CALLS:
case R600_QUERY_REQUESTED_VRAM:
case R600_QUERY_REQUESTED_GTT:
}
ctx->ws->buffer_unmap(buf->cs_buf);
break;
- case PIPE_QUERY_GPU_FINISHED:
case PIPE_QUERY_TIME_ELAPSED:
case PIPE_QUERY_TIMESTAMP:
break;
radeon_emit(cs, va);
radeon_emit(cs, (va >> 32UL) & 0xFF);
break;
- case PIPE_QUERY_GPU_FINISHED:
- break;
default:
assert(0);
}
query->result_size = 16 * rctx->max_db;
query->num_cs_dw = 6;
break;
- case PIPE_QUERY_GPU_FINISHED:
- query->num_cs_dw = 2;
break;
case PIPE_QUERY_TIME_ELAPSED:
query->result_size = 16;
query->result_size = (rctx->chip_class >= EVERGREEN ? 11 : 8) * 16;
query->num_cs_dw = 8;
break;
- /* Non-GPU queries. */
+ /* Non-GPU queries and queries not requiring a buffer. */
case PIPE_QUERY_TIMESTAMP_DISJOINT:
+ case PIPE_QUERY_GPU_FINISHED:
case R600_QUERY_DRAW_CALLS:
case R600_QUERY_REQUESTED_VRAM:
case R600_QUERY_REQUESTED_GTT:
switch (rquery->type) {
case PIPE_QUERY_TIMESTAMP_DISJOINT:
return;
+ case PIPE_QUERY_GPU_FINISHED:
+ rctx->rings.gfx.flush(rctx, RADEON_FLUSH_ASYNC, &rquery->fence);
+ return;
case R600_QUERY_DRAW_CALLS:
rquery->end_result = rctx->num_draw_calls;
return;
boolean wait,
union pipe_query_result *result)
{
+ struct pipe_screen *screen = ctx->b.screen;
unsigned results_base = 0;
char *map;
(uint64_t)ctx->screen->info.r600_clock_crystal_freq * 1000;
result->timestamp_disjoint.disjoint = FALSE;
return TRUE;
+ case PIPE_QUERY_GPU_FINISHED:
+ result->b = screen->fence_finish(screen, query->fence,
+ wait ? PIPE_TIMEOUT_INFINITE : 0);
+ return result->b;
case R600_QUERY_DRAW_CALLS:
case R600_QUERY_REQUESTED_VRAM:
case R600_QUERY_REQUESTED_GTT:
results_base += 16;
}
break;
- case PIPE_QUERY_GPU_FINISHED:
- result->b = TRUE;
- break;
case PIPE_QUERY_TIME_ELAPSED:
while (results_base != qbuf->results_end) {
result->u64 +=