summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2014-07-26 02:56:00 +0200
committerCarl Worth <cworth@cworth.org>2014-07-30 22:09:45 -0700
commit6ff3da25090ff62d501653636100c7f470f6f290 (patch)
tree68581096e398b13d44cd32696d59ffdf2075bf18 /src/gallium/drivers
parent378def4cab1b2aad070b51ba2e10d590d1ff1722 (diff)
radeonsi: fix a hang with instancing on Hawaii
This fixes "piglit/bin/arb_transform_feedback2-draw-auto instanced". Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 3d9e87406cfaf4a2bfef5b4bae50af94d1cc424f)
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 0676b154fae..df0aed15ee3 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -33,6 +33,7 @@
#include "util/u_format.h"
#include "util/u_index_modify.h"
#include "util/u_memory.h"
+#include "util/u_prim.h"
#include "util/u_upload_mgr.h"
/*
@@ -425,11 +426,24 @@ static bool si_update_draw_info_state(struct si_context *sctx,
(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;
+ unsigned primgroup_size = 64;
+
+ /* Hawaii hangs if instancing is enabled and each instance
+ * is smaller than a prim group and WD_SWITCH_ON_EOP is 0.
+ * We don't know that for indirect drawing, so treat it as
+ * always problematic. */
+ if (sctx->b.family == CHIP_HAWAII &&
+ (info->indirect ||
+ (info->instance_count > 1 &&
+ u_prims_for_vertices(info->mode, info->count) < primgroup_size))) {
+ wd_switch_on_eop = true;
+ ia_switch_on_eop = true;
+ }
si_pm4_set_reg(pm4, R_028AA8_IA_MULTI_VGT_PARAM,
S_028AA8_SWITCH_ON_EOP(ia_switch_on_eop) |
S_028AA8_PARTIAL_VS_WAVE_ON(1) |
- S_028AA8_PRIMGROUP_SIZE(63) |
+ S_028AA8_PRIMGROUP_SIZE(primgroup_size - 1) |
S_028AA8_WD_SWITCH_ON_EOP(wd_switch_on_eop));
si_pm4_set_reg(pm4, R_028B74_VGT_DISPATCH_DRAW_INDEX,
ib->index_size == 4 ? 0xFC000000 : 0xFC00);