From: Marek Olšák <[email protected]>

ported from AMDVLK.

Cc: 18.3 <[email protected]>
---
 src/gallium/drivers/radeonsi/si_state_draw.c | 25 +++++++++++---------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c 
b/src/gallium/drivers/radeonsi/si_state_draw.c
index d0b2e18b4ea..dd670f3f670 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -343,34 +343,25 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen,
                if (key->u.tess_uses_prim_id)
                        ia_switch_on_eoi = true;
 
                /* Bug with tessellation and GS on Bonaire and older 2 SE 
chips. */
                if ((sscreen->info.family == CHIP_TAHITI ||
                     sscreen->info.family == CHIP_PITCAIRN ||
                     sscreen->info.family == CHIP_BONAIRE) &&
                    key->u.uses_gs)
                        partial_vs_wave = true;
 
-               /* Needed for 028B6C_DISTRIBUTION_MODE != 0 */
+               /* Needed for 028B6C_DISTRIBUTION_MODE != 0. (implies >= VI) */
                if (sscreen->has_distributed_tess) {
                        if (key->u.uses_gs) {
-                               if (sscreen->info.chip_class <= VI)
+                               if (sscreen->info.chip_class == VI)
                                        partial_es_wave = true;
-
-                               /* GPU hang workaround. */
-                               if (sscreen->info.family == CHIP_TONGA ||
-                                   sscreen->info.family == CHIP_FIJI ||
-                                   sscreen->info.family == CHIP_POLARIS10 ||
-                                   sscreen->info.family == CHIP_POLARIS11 ||
-                                   sscreen->info.family == CHIP_POLARIS12 ||
-                                   sscreen->info.family == CHIP_VEGAM)
-                                       partial_vs_wave = true;
                        } else {
                                partial_vs_wave = true;
                        }
                }
        }
 
        /* This is a hardware requirement. */
        if (key->u.line_stipple_enabled ||
            (sscreen->debug_flags & DBG(SWITCH_ON_EOP))) {
                ia_switch_on_eop = true;
@@ -412,20 +403,32 @@ si_get_init_multi_vgt_param(struct si_screen *sscreen,
                 */
                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 == 4 && !wd_switch_on_eop)
                        ia_switch_on_eoi = true;
 
+               /* HW engineers suggested that PARTIAL_VS_WAVE_ON should be set
+                * to work around a GS hang.
+                */
+               if (key->u.uses_gs &&
+                   (sscreen->info.family == CHIP_TONGA ||
+                    sscreen->info.family == CHIP_FIJI ||
+                    sscreen->info.family == CHIP_POLARIS10 ||
+                    sscreen->info.family == CHIP_POLARIS11 ||
+                    sscreen->info.family == CHIP_POLARIS12 ||
+                    sscreen->info.family == CHIP_VEGAM))
+                       partial_vs_wave = 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)
-- 
2.17.1

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to