diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-09-22 09:01:07 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-09-30 08:40:13 -0400 |
commit | 72a03bcafae8903339329ee74ba4cdd0c75b2814 (patch) | |
tree | 071cf610481d885acbae0c9ee02d5d3255238281 /src | |
parent | b5396369d2f4cc4bbff3bd2bf0639257ffb6fde5 (diff) |
pan/midgard: Add mir_choose_bundle helper
It's not always obvious what the optimal bundle type should be. Let's
break out the logic to decide.
Currently set for purely in-order operation.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/panfrost/midgard/midgard_schedule.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index 8f324805cdb..969460235d1 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -861,6 +861,31 @@ mir_choose_instruction( return instructions[best_index]; } +/* Still, we don't choose instructions in a vacuum. We need a way to choose the + * best bundle type (ALU, load/store, texture). Nondestructive. */ + +static unsigned +mir_choose_bundle( + midgard_instruction **instructions, + BITSET_WORD *worklist, unsigned count) +{ + /* At the moment, our algorithm is very simple - use the bundle of the + * best instruction, regardless of what else could be scheduled + * alongside it. This is not optimal but it works okay for in-order */ + + struct midgard_predicate predicate = { + .tag = ~0, + .destructive = false + }; + + midgard_instruction *chosen = mir_choose_instruction(instructions, worklist, count, &predicate); + + if (chosen) + return chosen->type; + else + return ~0; +} + /* Schedule a single block by iterating its instruction to create bundles. * While we go, tally about the bundle sizes to compute the block size. */ |