Mesa (10.4): radeonsi: Don' t modify PA_SC_RASTER_CONFIG register value if rb_mask == 0

Emil Velikov evelikov at kemper.freedesktop.org
Sun Jan 4 22:07:03 UTC 2015


Module: Mesa
Branch: 10.4
Commit: 1f42230fa7271c99c9819a71a932c48a2eeb69c8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f42230fa7271c99c9819a71a932c48a2eeb69c8

Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Tue Dec  9 17:00:32 2014 +0900

radeonsi: Don't modify PA_SC_RASTER_CONFIG register value if rb_mask == 0

E.g. this could happen on older kernels which don't support the
RADEON_INFO_SI_BACKEND_ENABLED_MASK query yet. The code in
si_write_harvested_raster_configs() doesn't deal with this correctly and
would probably mangle the value badly.

Cc: "10.4 10.3" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
(cherry picked from commit b3057f8097f88d9072df6d9c09bcc8c039b88a7c)

---

 src/gallium/drivers/radeonsi/si_state.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index fc84422..edd179e 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3281,8 +3281,10 @@ void si_init_config(struct si_context *sctx)
 			break;
 		}
 
-		/* Always use the default config when all backends are enabled. */
-		if (rb_mask && util_bitcount(rb_mask) >= num_rb) {
+		/* Always use the default config when all backends are enabled
+		 * (or when we failed to determine the enabled backends).
+		 */
+		if (!rb_mask || util_bitcount(rb_mask) >= num_rb) {
 			si_pm4_set_reg(pm4, R_028350_PA_SC_RASTER_CONFIG,
 				       raster_config);
 		} else {




More information about the mesa-commit mailing list