From 8222840e3f8fdd71b934709930c6237b3aa3a171 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 11 Jul 2022 19:34:05 +0200 Subject: [PATCH] r600: limit loops when trying to merge alu groups On Cayman bank_swizzle[4] is never counted up, so add an additional condition to make sure the loop is finished at one point. This is a hot-fix, the logic below should be improved. Signed-off-by: Gert Wollny Reviewed-by: Filip Gawin Part-of: --- src/gallium/drivers/r600/r600_asm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index 954af066307..b7319ab6871 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -593,6 +593,7 @@ static int check_and_set_bank_swizzle(const struct r600_bytecode *bc, int i, r = 0, forced = 1; boolean scalar_only = bc->gfx_level == CAYMAN ? false : true; int max_slots = bc->gfx_level == CAYMAN ? 4 : 5; + int max_checks = max_slots * 1000; for (i = 0; i < max_slots; i++) { if (slots[i]) { @@ -618,8 +619,8 @@ static int check_and_set_bank_swizzle(const struct r600_bytecode *bc, bank_swizzle[i] = slots[i]->bank_swizzle; bank_swizzle[4] = SQ_ALU_SCL_210; - while(bank_swizzle[4] <= SQ_ALU_SCL_221) { + while(bank_swizzle[4] <= SQ_ALU_SCL_221 && max_checks--) { init_bank_swizzle(&bs); if (scalar_only == false) { for (i = 0; i < 4; i++) {