From 6f28a4449a82da7717b9c25d8e7ed74762e97f99 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 5 Jan 2021 19:06:53 -0500 Subject: [PATCH] pan/bi: Fix dependency wait calculation Unconditional branches have a successor in the first slot only. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/bifrost/bi_pack.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index 4ad5b1da920..098a3780f98 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -708,7 +708,10 @@ bi_pack(bi_context *ctx, struct util_dynarray *emission) * the last clause of the block (the clause with the branch) */ bi_clause *succ_clause = block->base.successors[1] ? - bi_next_clause(ctx, block->base.successors[0], NULL) : NULL; + bi_next_clause(ctx, block->base.successors[1], NULL) : NULL; + + if (!succ_clause && block->base.successors[0]) + succ_clause = bi_next_clause(ctx, block->base.successors[0], NULL); bi_foreach_clause_in_block(block, clause) { bool is_last = clause->link.next == &block->clauses;