From: Michel Dänzer Date: Tue, 9 Dec 2014 08:00:32 +0000 (+0900) Subject: radeonsi: Don't modify PA_SC_RASTER_CONFIG register value if rb_mask == 0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b3057f8097f88d9072df6d9c09bcc8c039b88a7c;p=mesa.git 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" Reviewed-by: Marek Olšák Reviewed-by: Tom Stellard --- diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 097c31cc943..5a417b0211c 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3032,8 +3032,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 {