From: Boris Brezillon Date: Tue, 27 Aug 2019 10:36:42 +0000 (+0200) Subject: panfrost: Fix a list_assert() in schedule_block() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0e513ccca484c9086bdc13181e64c71fb8641649;p=mesa.git panfrost: Fix a list_assert() in schedule_block() list_for_each_entry() does not allow modifying the current item pointer. Let's rework the skip-instructions logic in schedule_block() to not break this rule. Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig --- diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 68b7a0b2fe4..b8d9b5ec9be 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -630,8 +630,13 @@ schedule_block(compiler_context *ctx, midgard_block *block) block->quadword_count = 0; + int skip = 0; mir_foreach_instr_in_block(block, ins) { - int skip; + if (skip) { + skip--; + continue; + } + midgard_bundle bundle = schedule_bundle(ctx, block, ins, &skip); util_dynarray_append(&block->bundles, midgard_bundle, bundle); @@ -640,9 +645,6 @@ schedule_block(compiler_context *ctx, midgard_block *block) ctx->blend_constant_offset = offset * 0x10; } - while(skip--) - ins = mir_next_op(ins); - block->quadword_count += quadword_size(bundle.tag); }