Mesa (master): panfrost: Fix a list_assert() in schedule_block()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 13 10:16:42 UTC 2019


Module: Mesa
Branch: master
Commit: 0e513ccca484c9086bdc13181e64c71fb8641649
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e513ccca484c9086bdc13181e64c71fb8641649

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Tue Aug 27 12:36:42 2019 +0200

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 <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>

---

 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 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);
         }
 




More information about the mesa-commit mailing list