Mesa (master): radeonsi: don't flush when si_eliminate_fast_color_clear is no-op

Marek Olšák mareko at kemper.freedesktop.org
Wed Feb 21 19:03:52 UTC 2018


Module: Mesa
Branch: master
Commit: b494ed168ccaf42fef32e92b64e764eba3f7a1a5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b494ed168ccaf42fef32e92b64e764eba3f7a1a5

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Jan 30 02:51:47 2018 +0100

radeonsi: don't flush when si_eliminate_fast_color_clear is no-op

---

 src/gallium/drivers/radeon/r600_texture.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index a0e91292c3..125e7ef408 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -389,8 +389,12 @@ void si_eliminate_fast_color_clear(struct r600_common_context *rctx,
 	if (ctx == sscreen->aux_context)
 		mtx_lock(&sscreen->aux_context_lock);
 
+	unsigned n = rctx->num_decompress_calls;
 	ctx->flush_resource(ctx, &rtex->resource.b.b);
-	ctx->flush(ctx, NULL, 0);
+
+	/* Flush only if any fast clear elimination took place. */
+	if (n != rctx->num_decompress_calls)
+		ctx->flush(ctx, NULL, 0);
 
 	if (ctx == sscreen->aux_context)
 		mtx_unlock(&sscreen->aux_context_lock);




More information about the mesa-commit mailing list