[Mesa-dev] [PATCH 1/5] gallium/radeon: use unflushed fences for PIPE_QUERY_GPU_FINISHED

Marek Olšák maraeo at gmail.com
Thu Aug 11 16:16:05 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/radeon/r600_query.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index 592cec1..5825e8b 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -132,21 +132,21 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx,
 
 static bool r600_query_sw_end(struct r600_common_context *rctx,
 			      struct r600_query *rquery)
 {
 	struct r600_query_sw *query = (struct r600_query_sw *)rquery;
 
 	switch(query->b.type) {
 	case PIPE_QUERY_TIMESTAMP_DISJOINT:
 		break;
 	case PIPE_QUERY_GPU_FINISHED:
-		rctx->b.flush(&rctx->b, &query->fence, 0);
+		rctx->b.flush(&rctx->b, &query->fence, PIPE_FLUSH_DEFERRED);
 		break;
 	case R600_QUERY_DRAW_CALLS:
 		query->end_result = rctx->num_draw_calls;
 		break;
 	case R600_QUERY_SPILL_DRAW_CALLS:
 		query->end_result = rctx->num_spill_draw_calls;
 		break;
 	case R600_QUERY_COMPUTE_CALLS:
 		query->end_result = rctx->num_compute_calls;
 		break;
@@ -208,21 +208,21 @@ static bool r600_query_sw_get_result(struct r600_common_context *rctx,
 
 	switch (query->b.type) {
 	case PIPE_QUERY_TIMESTAMP_DISJOINT:
 		/* Convert from cycles per millisecond to cycles per second (Hz). */
 		result->timestamp_disjoint.frequency =
 			(uint64_t)rctx->screen->info.clock_crystal_freq * 1000;
 		result->timestamp_disjoint.disjoint = false;
 		return true;
 	case PIPE_QUERY_GPU_FINISHED: {
 		struct pipe_screen *screen = rctx->b.screen;
-		result->b = screen->fence_finish(screen, NULL, query->fence,
+		result->b = screen->fence_finish(screen, &rctx->b, query->fence,
 						 wait ? PIPE_TIMEOUT_INFINITE : 0);
 		return result->b;
 	}
 
 	case R600_QUERY_GPIN_ASIC_ID:
 		result->u32 = 0;
 		return true;
 	case R600_QUERY_GPIN_NUM_SIMD:
 		result->u32 = rctx->screen->info.num_good_compute_units;
 		return true;
-- 
2.7.4



More information about the mesa-dev mailing list