diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-07-31 15:49:30 -0700 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-08-01 16:23:03 -0700 |
commit | 73c40d6bbbffc5d13e0e3ce823fa349286382c77 (patch) | |
tree | 757ce86e5bf3eef5ad9beb85a4e57d6782b21dfe | |
parent | 464799932797e9605f14b8c955c5f581db68a016 (diff) |
pan/midgard: Use standard list traversal to find initial tag
Fixes a hang (and abort) on empty shaders, which you shouldn't have
anyway but better safe than sorry. DCE going on the fritz is no reason
to freeze the system.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/panfrost/midgard/midgard_compile.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index d36caa3193d..a35b43faee7 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2229,19 +2229,16 @@ midgard_get_first_tag_from_block(compiler_context *ctx, unsigned block_idx) unsigned first_tag = 0; - do { - midgard_bundle *initial_bundle = util_dynarray_element(&initial_block->bundles, midgard_bundle, 0); + mir_foreach_block_from(ctx, initial_block, v) { + midgard_bundle *initial_bundle = + util_dynarray_element(&v->bundles, midgard_bundle, 0); if (initial_bundle) { first_tag = initial_bundle->tag; break; } + } - /* Initial block is empty, try the next block */ - initial_block = list_first_entry(&(initial_block->link), midgard_block, link); - } while(initial_block != NULL); - - assert(first_tag); return first_tag; } |