radeonsi: fix primitive restart gpu hang for pre gfx10

PAL always set WD_SWITCH_ON_EOP for pre gfx10 when primitve
restart is enabled to prevent gpu hang.

It only happens when specific index stream with primitive
restart. Since we don't know what's the exact problem,
just follow PAL to disable 4x primitive rate when primitive
restart is enabled.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14629
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 7d73ea20ec)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
This commit is contained in:
Qiang Yu 2026-01-13 21:32:41 +08:00 committed by Dylan Baker
parent 3f25467638
commit 05211f419b
2 changed files with 2 additions and 8 deletions

View file

@ -394,7 +394,7 @@
"description": "radeonsi: fix primitive restart gpu hang for pre gfx10",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -749,17 +749,11 @@ static unsigned si_get_init_multi_vgt_param(struct si_screen *sscreen, union si_
/* 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 <= 2 || key->u.prim == MESA_PRIM_POLYGON ||
key->u.prim == MESA_PRIM_LINE_LOOP || key->u.prim == MESA_PRIM_TRIANGLE_FAN ||
key->u.prim == MESA_PRIM_TRIANGLE_STRIP_ADJACENCY ||
(key->u.primitive_restart &&
(sscreen->info.family < CHIP_POLARIS10 ||
(key->u.prim != MESA_PRIM_POINTS && key->u.prim != MESA_PRIM_LINE_STRIP &&
key->u.prim != MESA_PRIM_TRIANGLE_STRIP))) ||
key->u.primitive_restart ||
key->u.count_from_stream_output)
wd_switch_on_eop = true;