From 7af037fc1186ede7e0277d87201b64dbd8be19cc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 19 Feb 2021 08:58:02 -0500 Subject: [PATCH] panfrost: Fix infinite loop spilling At least this way failed RA will crash (by having no spill node to pick) instead? Seen in dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.21 on Bifrost. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/util/lcra.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/panfrost/util/lcra.c b/src/panfrost/util/lcra.c index d922972..4965282 100644 --- a/src/panfrost/util/lcra.c +++ b/src/panfrost/util/lcra.c @@ -224,7 +224,9 @@ lcra_count_constraints(struct lcra_state *l, unsigned i) signed lcra_get_best_spill_node(struct lcra_state *l) { - float best_benefit = -1.0; + /* If there are no constraints on a node, do not pick it to spill under + * any circumstance, or else we would hang rather than fail RA */ + float best_benefit = 0.0; signed best_node = -1; for (unsigned i = 0; i < l->node_count; ++i) { -- 2.7.4