From 7684808f9ce2da944be3ca9cc1ac4661d9b167fb Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 28 Oct 2011 19:24:16 +0200 Subject: r600g: remove one pointless flush It's not useful for anything. The rest of the patch is just a cleanup resulting from some of the variables being no longer used. There are no piglit regressions. --- src/gallium/drivers/r600/r600.h | 6 +----- src/gallium/drivers/r600/r600_blit.c | 2 +- src/gallium/drivers/r600/r600_hw_context.c | 21 ++------------------- 3 files changed, 4 insertions(+), 25 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/r600/r600.h b/src/gallium/drivers/r600/r600.h index f58549afb4d..9367651b5f3 100644 --- a/src/gallium/drivers/r600/r600.h +++ b/src/gallium/drivers/r600/r600.h @@ -176,10 +176,6 @@ struct r600_query { unsigned results_end; /* Size of the result */ unsigned result_size; - /* Count of new queries started in one stream without flushing */ - unsigned queries_emitted; - /* State flags */ - boolean flushed; /* The buffer where query results are stored. It's used as a ring, * data blocks for current query are stored sequentially from * results_start to results_end, with wrapping on the buffer end */ @@ -258,7 +254,7 @@ boolean r600_context_query_result(struct r600_context *ctx, void r600_query_begin(struct r600_context *ctx, struct r600_query *query); void r600_query_end(struct r600_context *ctx, struct r600_query *query); void r600_context_queries_suspend(struct r600_context *ctx); -void r600_context_queries_resume(struct r600_context *ctx, boolean flushed); +void r600_context_queries_resume(struct r600_context *ctx); void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation, int flag_wait); void r600_context_emit_fence(struct r600_context *ctx, struct r600_resource *fence, diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c index 3eba0ad0636..9326dc657ff 100644 --- a/src/gallium/drivers/r600/r600_blit.c +++ b/src/gallium/drivers/r600/r600_blit.c @@ -96,7 +96,7 @@ static void r600_blitter_end(struct pipe_context *ctx) rctx->saved_render_cond_mode); rctx->saved_render_cond = NULL; } - r600_context_queries_resume(&rctx->ctx, FALSE); + r600_context_queries_resume(&rctx->ctx); } static unsigned u_num_layers(struct pipe_resource *r, unsigned level) diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index ca245f01002..70fab0bab7e 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -1519,7 +1519,7 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags) r600_init_cs(ctx); /* resume queries */ - r600_context_queries_resume(ctx, TRUE); + r600_context_queries_resume(ctx); /* set all valid group as dirty so they get reemited on * next draw command @@ -1617,18 +1617,6 @@ void r600_query_begin(struct r600_context *ctx, struct r600_query *query) r600_context_flush(ctx, RADEON_FLUSH_ASYNC); } - 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. */ - if (query->flushed) { - query->queries_emitted = 1; - } else { - if (++query->queries_emitted > query->buffer->b.b.b.width0 / query->result_size / 2) - r600_context_flush(ctx, RADEON_FLUSH_ASYNC); - } - } - new_results_end = query->results_end + query->result_size; if (new_results_end >= query->buffer->b.b.b.width0) new_results_end = 0; @@ -1711,8 +1699,6 @@ void r600_query_end(struct r600_context *ctx, struct r600_query *query) if (query->results_end >= query->buffer->b.b.b.width0) query->results_end = 0; - query->flushed = FALSE; - ctx->num_query_running--; } @@ -1840,14 +1826,11 @@ void r600_context_queries_suspend(struct r600_context *ctx) } } -void r600_context_queries_resume(struct r600_context *ctx, boolean flushed) +void r600_context_queries_resume(struct r600_context *ctx) { struct r600_query *query; LIST_FOR_EACH_ENTRY(query, &ctx->active_query_list, list) { - if (flushed) - query->flushed = TRUE; - r600_query_begin(ctx, query); } } -- cgit v1.2.3