summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2014-12-09 17:00:32 +0900
committerEmil Velikov <emil.l.velikov@gmail.com>2015-01-04 21:06:41 +0000
commit6ecffc89fd985e102ea5859f13499326ad77a38c (patch)
treeb89dfa6296e8cbf21ac9d4b694446717049fa3d1
parent4b1332dbf83c4cf769cbd2be83d0f3009af7b3e6 (diff)
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@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> (cherry picked from commit b3057f8097f88d9072df6d9c09bcc8c039b88a7c)
-rw-r--r--src/gallium/drivers/radeonsi/si_state.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 31df2e0dbbf..3f786511ba5 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3207,8 +3207,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 {