[Mesa-dev] [PATCH 1/2] radeonsi: fix a VGT hang with primitive restart on Polaris10 and later

Marek Olšák maraeo at gmail.com
Wed Oct 17 16:29:02 UTC 2018


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

Cc: 18.1 18.2 <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeonsi/si_state_draw.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 83eb646b791..612ca910cb9 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -376,21 +376,21 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen,
 	}
 
 	if (sscreen->info.chip_class >= CIK) {
 		/* WD_SWITCH_ON_EOP has no effect on GPUs with less than
 		 * 4 shader engines. Set 1 to pass the assertion below.
 		 * The other cases are hardware requirements.
 		 *
 		 * Polaris supports primitive restart with WD_SWITCH_ON_EOP=0
 		 * for points, line strips, and tri strips.
 		 */
-		if (sscreen->info.max_se < 4 ||
+		if (sscreen->info.max_se <= 2 ||
 		    key->u.prim == PIPE_PRIM_POLYGON ||
 		    key->u.prim == PIPE_PRIM_LINE_LOOP ||
 		    key->u.prim == PIPE_PRIM_TRIANGLE_FAN ||
 		    key->u.prim == PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY ||
 		    (key->u.primitive_restart &&
 		     (sscreen->info.family < CHIP_POLARIS10 ||
 		      (key->u.prim != PIPE_PRIM_POINTS &&
 		       key->u.prim != PIPE_PRIM_LINE_STRIP &&
 		       key->u.prim != PIPE_PRIM_TRIANGLE_STRIP))) ||
 		    key->u.count_from_stream_output)
@@ -407,35 +407,41 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen,
 		 * instances are smaller than a primgroup.
 		 * Assume indirect draws always use small instances.
 		 * This is needed for good VS wave utilization.
 		 */
 		if (sscreen->info.chip_class <= VI &&
 		    sscreen->info.max_se == 4 &&
 		    key->u.multi_instances_smaller_than_primgroup)
 			wd_switch_on_eop = true;
 
 		/* Required on CIK and later. */
-		if (sscreen->info.max_se > 2 && !wd_switch_on_eop)
+		if (sscreen->info.max_se == 4 && !wd_switch_on_eop)
 			ia_switch_on_eoi = true;
 
 		/* Required by Hawaii and, for some special cases, by VI. */
 		if (ia_switch_on_eoi &&
 		    (sscreen->info.family == CHIP_HAWAII ||
 		     (sscreen->info.chip_class == VI &&
 		      (key->u.uses_gs || max_primgroup_in_wave != 2))))
 			partial_vs_wave = true;
 
 		/* Instancing bug on Bonaire. */
 		if (sscreen->info.family == CHIP_BONAIRE && ia_switch_on_eoi &&
 		    key->u.uses_instancing)
 			partial_vs_wave = true;
 
+		/* This only applies to Polaris10 and later 4 SE chips.
+		 * wd_switch_on_eop is already true on all other chips.
+		 */
+		if (!wd_switch_on_eop && key->u.primitive_restart)
+			partial_vs_wave = true;
+
 		/* If the WD switch is false, the IA switch must be false too. */
 		assert(wd_switch_on_eop || !ia_switch_on_eop);
 	}
 
 	/* If SWITCH_ON_EOI is set, PARTIAL_ES_WAVE must be set too. */
 	if (sscreen->info.chip_class <= VI && ia_switch_on_eoi)
 		partial_es_wave = true;
 
 	return S_028AA8_SWITCH_ON_EOP(ia_switch_on_eop) |
 		S_028AA8_SWITCH_ON_EOI(ia_switch_on_eoi) |
-- 
2.17.1



More information about the mesa-dev mailing list