Mesa (master): radeonsi: set CB_DISABLE if the color mask is 0

Marek Olšák mareko at kemper.freedesktop.org
Wed Dec 18 00:20:37 UTC 2013


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Tue Dec 17 13:27:56 2013 +0100

radeonsi: set CB_DISABLE if the color mask is 0

Also needed for the DB in-place decompression according to hw docs.

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

---

 src/gallium/drivers/radeonsi/si_state.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 5c18538..5274eff 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -252,20 +252,18 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
 	struct si_state_blend *blend = CALLOC_STRUCT(si_state_blend);
 	struct si_pm4_state *pm4 = &blend->pm4;
 
-	uint32_t color_control;
+	uint32_t color_control = 0;
 
 	if (blend == NULL)
 		return NULL;
 
 	blend->alpha_to_one = state->alpha_to_one;
 
-	color_control = S_028808_MODE(mode);
 	if (state->logicop_enable) {
 		color_control |= S_028808_ROP3(state->logicop_func | (state->logicop_func << 4));
 	} else {
 		color_control |= S_028808_ROP3(0xcc);
 	}
-	si_pm4_set_reg(pm4, R_028808_CB_COLOR_CONTROL, color_control);
 
 	si_pm4_set_reg(pm4, R_028B70_DB_ALPHA_TO_MASK,
 		       S_028B70_ALPHA_TO_MASK_ENABLE(state->alpha_to_coverage) |
@@ -310,6 +308,13 @@ static void *si_create_blend_state_mode(struct pipe_context *ctx,
 		si_pm4_set_reg(pm4, R_028780_CB_BLEND0_CONTROL + i * 4, blend_cntl);
 	}
 
+	if (blend->cb_target_mask) {
+		color_control |= S_028808_MODE(mode);
+	} else {
+		color_control |= S_028808_MODE(V_028808_CB_DISABLE);
+	}
+	si_pm4_set_reg(pm4, R_028808_CB_COLOR_CONTROL, color_control);
+
 	return blend;
 }
 




More information about the mesa-commit mailing list