[Mesa-dev] [PATCH 2/2] radeonsi: try to fix IA_MULTI_VGT_PARAM programming

Marek Olšák maraeo at gmail.com
Wed Oct 30 00:45:49 CET 2013


From: Marek Olšák <marek.olsak at amd.com>

This doesn't make any difference on Bonaire, but it might help on Hawaii.
---
 src/gallium/drivers/radeonsi/si_state.c      | 1 +
 src/gallium/drivers/radeonsi/si_state.h      | 1 +
 src/gallium/drivers/radeonsi/si_state_draw.c | 8 ++++++--
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index fd935ab..f6400d8 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -525,6 +525,7 @@ static void *si_create_rs_state(struct pipe_context *ctx,
 	rs->two_side = state->light_twoside;
 	rs->multisample_enable = state->multisample;
 	rs->clip_plane_enable = state->clip_plane_enable;
+	rs->line_stipple_enable = state->line_stipple_enable;
 
 	polygon_dual_mode = (state->fill_front != PIPE_POLYGON_MODE_FILL ||
 				state->fill_back != PIPE_POLYGON_MODE_FILL);
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index 8d53cc0..f3d4023 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -46,6 +46,7 @@ struct si_state_rasterizer {
 	bool			flatshade;
 	bool			two_side;
 	bool			multisample_enable;
+	bool			line_stipple_enable;
 	unsigned		sprite_coord_enable;
 	unsigned		pa_sc_line_stipple;
 	unsigned		pa_su_sc_mode_cntl;
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 823f9c3..c138bdd 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -324,14 +324,18 @@ static bool si_update_draw_info_state(struct r600_context *rctx,
 	}
 
 	if (rctx->b.chip_class >= CIK) {
+		struct si_state_rasterizer *rs = rctx->queued.named.rasterizer;
 		bool wd_switch_on_eop = prim == V_008958_DI_PT_POLYGON ||
 					prim == V_008958_DI_PT_LINELOOP ||
 					prim == V_008958_DI_PT_TRIFAN ||
 					prim == V_008958_DI_PT_TRISTRIP_ADJ ||
-					info->primitive_restart;
+					info->primitive_restart ||
+					(rs ? rs->line_stipple_enable : false);
+		/* If the WD switch is false, the IA switch must be false too. */
+		bool ia_switch_on_eop = wd_switch_on_eop;
 
 		si_pm4_set_reg(pm4, R_028AA8_IA_MULTI_VGT_PARAM,
-			       S_028AA8_SWITCH_ON_EOP(1) |
+			       S_028AA8_SWITCH_ON_EOP(ia_switch_on_eop) |
 			       S_028AA8_PARTIAL_VS_WAVE_ON(1) |
 			       S_028AA8_PRIMGROUP_SIZE(63) |
 			       S_028AA8_WD_SWITCH_ON_EOP(wd_switch_on_eop));
-- 
1.8.1.2



More information about the mesa-dev mailing list