From 1180e61a1bb52d8fdf99185ca2c3042e7f686594 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 23 Feb 2015 18:03:02 +0100 Subject: [PATCH] r600g,radeonsi: fix streamout after pipeline stats have been used MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EVENT_TYPE_PIPELINESTAT_STOP disables streamout queries too. Luckily, pipeline stats are enabled by default, so we don't even have to emit EVENT_TYPE_PIPELINESTAT_START. Tested on Hawaii, Bonaire, Redwood, RV730. Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeon/r600_pipe_common.h | 1 - src/gallium/drivers/radeon/r600_query.c | 13 +------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index a5c7bd351ca..43efaa34b4c 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -361,7 +361,6 @@ struct r600_common_context { /* Queries. */ /* The list of active queries. Only one query of each type can be active. */ int num_occlusion_queries; - int num_pipelinestat_queries; /* Keep track of non-timer queries, because they should be suspended * during context flushing. * The timer queries (TIME_ELAPSED) shouldn't be suspended. */ diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index 8d80612b68e..6a35ab8190a 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -200,11 +200,6 @@ static void r600_emit_query_begin(struct r600_common_context *ctx, struct r600_q radeon_emit(cs, 0); break; case PIPE_QUERY_PIPELINE_STATISTICS: - if (!ctx->num_pipelinestat_queries) { - radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0)); - radeon_emit(cs, EVENT_TYPE(EVENT_TYPE_PIPELINESTAT_START) | EVENT_INDEX(0)); - } - ctx->num_pipelinestat_queries++; radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 2, 0)); radeon_emit(cs, EVENT_TYPE(EVENT_TYPE_SAMPLE_PIPELINESTAT) | EVENT_INDEX(2)); radeon_emit(cs, va); @@ -265,12 +260,6 @@ static void r600_emit_query_end(struct r600_common_context *ctx, struct r600_que radeon_emit(cs, 0); break; case PIPE_QUERY_PIPELINE_STATISTICS: - assert(ctx->num_pipelinestat_queries > 0); - ctx->num_pipelinestat_queries--; - if (!ctx->num_pipelinestat_queries) { - radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 0, 0)); - radeon_emit(cs, EVENT_TYPE(EVENT_TYPE_PIPELINESTAT_STOP) | EVENT_INDEX(0)); - } va += query->buffer.results_end + query->result_size/2; radeon_emit(cs, PKT3(PKT3_EVENT_WRITE, 2, 0)); radeon_emit(cs, EVENT_TYPE(EVENT_TYPE_SAMPLE_PIPELINESTAT) | EVENT_INDEX(2)); @@ -380,7 +369,7 @@ static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned q case PIPE_QUERY_PIPELINE_STATISTICS: /* 11 values on EG, 8 on R600. */ query->result_size = (rctx->chip_class >= EVERGREEN ? 11 : 8) * 16; - query->num_cs_dw = 8; + query->num_cs_dw = 6; break; /* Non-GPU queries and queries not requiring a buffer. */ case PIPE_QUERY_TIMESTAMP_DISJOINT: -- 2.30.2