diff options
author | Vadim Girlin <[email protected]> | 2011-07-16 04:58:58 +0400 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2011-07-18 08:53:47 -0400 |
commit | 9b3ec69cf4b079fbe16293d8fbe13016f0d74951 (patch) | |
tree | a118e02d02f4216c3c8cb15a98ead7508f026a51 /src/gallium | |
parent | 3093cbaad9962df8ad35f2c1c42d6b1259381498 (diff) |
r600g: fix corner case checks for the queries
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_hw_context.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/winsys/r600/drm/r600_hw_context.c b/src/gallium/winsys/r600/drm/r600_hw_context.c index 55f1d4cf07e..07bd544d1a0 100644 --- a/src/gallium/winsys/r600/drm/r600_hw_context.c +++ b/src/gallium/winsys/r600/drm/r600_hw_context.c @@ -1748,9 +1748,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query) r600_context_flush(ctx); } - /* if it's new OQ (not resume) */ - if (query->type == PIPE_QUERY_OCCLUSION_COUNTER && - query->results_start == query->results_end) { + if (query->type == PIPE_QUERY_OCCLUSION_COUNTER) { /* Count queries emitted without flushes, and flush if more than * half of buffer used, to avoid overwriting results which may be * still in use. */ @@ -1763,7 +1761,7 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query) } new_results_end = query->results_end + query->result_size; - if (new_results_end > query->buffer_size) + if (new_results_end >= query->buffer_size) new_results_end = 0; /* collect current results if query buffer is full */ @@ -1862,7 +1860,7 @@ void r600_query_predication(struct r600_context *ctx, struct r600_query *query, /* find count of the query data blocks */ count = query->buffer_size + query->results_end - query->results_start; - if (count > query->buffer_size) count-=query->buffer_size; + if (count >= query->buffer_size) count-=query->buffer_size; count /= query->result_size; if (ctx->pm4_cdwords + 5 * count > ctx->pm4_ndwords) |