From 0e513ccca484c9086bdc13181e64c71fb8641649 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 27 Aug 2019 12:36:42 +0200 Subject: [PATCH] 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 --- src/panfrost/midgard/midgard_schedule.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 68b7a0b..b8d9b5e 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); } -- 2.7.4