[Mesa-dev] [PATCH 2/2] radeonsi: remove SET_PREDICATION workaround on newer firmware

Nicolai Hähnle nhaehnle at gmail.com
Mon Sep 11 15:01:35 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

We need to keep the workaround for older firmware, though.
---
 src/gallium/drivers/radeon/r600_query.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index 03ff1018a71..76307ca0662 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -1796,25 +1796,27 @@ static void r600_render_condition(struct pipe_context *ctx,
 	struct r600_common_context *rctx = (struct r600_common_context *)ctx;
 	struct r600_query_hw *rquery = (struct r600_query_hw *)query;
 	struct r600_query_buffer *qbuf;
 	struct r600_atom *atom = &rctx->render_cond_atom;
 
 	/* Compute the size of SET_PREDICATION packets. */
 	atom->num_dw = 0;
 	if (query) {
 		bool needs_workaround = false;
 
-		/* There is a firmware regression in VI which causes successive
+		/* There was a firmware regression in VI which causes successive
 		 * SET_PREDICATION packets to give the wrong answer for
 		 * non-inverted stream overflow predication.
 		 */
-		if (rctx->chip_class >= VI && !condition &&
+		if (((rctx->chip_class == VI && rctx->screen->info.pfp_fw_feature < 49) ||
+		     (rctx->chip_class == GFX9 && rctx->screen->info.pfp_fw_feature < 38)) &&
+		    !condition &&
 		    (rquery->b.type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE ||
 		     (rquery->b.type == PIPE_QUERY_SO_OVERFLOW_PREDICATE &&
 		      (rquery->buffer.previous ||
 		       rquery->buffer.results_end > rquery->result_size)))) {
 			needs_workaround = true;
 		}
 
 		if (needs_workaround && !rquery->workaround_buf) {
 			bool old_force_off = rctx->render_cond_force_off;
 			rctx->render_cond_force_off = true;
-- 
2.11.0



More information about the mesa-dev mailing list