From d624118cc9ec2436ee1326aa9dc08d5b3ca2f272 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 3 Jul 2020 09:20:44 -0400 Subject: [PATCH] pan/mdg: Allow ignoring move mode Ensures we can gaurantee we'll pick something, which matters for depth/stencil export. Signed-off-by: Alyssa Rosenzweig Fixes: de41c4c103d ("pan/mdg: Prioritize non-moves on VADD/VLUT") Tested-by: Icecream95 Part-of: --- src/panfrost/midgard/midgard_schedule.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/panfrost/midgard/midgard_schedule.c b/src/panfrost/midgard/midgard_schedule.c index c5a4dea67f9..144134746d9 100644 --- a/src/panfrost/midgard/midgard_schedule.c +++ b/src/panfrost/midgard/midgard_schedule.c @@ -341,9 +341,9 @@ struct midgard_predicate { unsigned no_mask; unsigned dest; - /* For VADD/VLUT whether to only/never schedule imov/fmov instructions - * This allows non-move instructions to get priority on each unit */ - bool moves; + /* Whether to not-care/only/never schedule imov/fmov instructions This + * allows non-move instructions to get priority on each unit */ + unsigned move_mode; /* For load/store: how many pipeline registers are in use? The two * scheduled instructions cannot use more than the 256-bits of pipeline @@ -673,7 +673,8 @@ mir_choose_instruction( if (alu && !branch && !(mir_has_unit(instructions[i], unit))) continue; - if ((unit == UNIT_VLUT || unit == UNIT_VADD) && (predicate->moves != is_move)) + /* 0: don't care, 1: no moves, 2: only moves */ + if (predicate->move_mode && ((predicate->move_mode - 1) != is_move)) continue; if (branch && !instructions[i]->compact_branch) @@ -1189,14 +1190,17 @@ mir_schedule_alu( mir_choose_alu(&smul, instructions, liveness, worklist, len, &predicate, UNIT_SMUL); - for (unsigned moves = 0; moves < 2; ++moves) { - predicate.moves = moves; + for (unsigned mode = 1; mode < 3; ++mode) { + predicate.move_mode = mode; predicate.no_mask = writeout ? (1 << 3) : 0; mir_choose_alu(&vlut, instructions, liveness, worklist, len, &predicate, UNIT_VLUT); predicate.no_mask = 0; mir_choose_alu(&vadd, instructions, liveness, worklist, len, &predicate, UNIT_VADD); } + /* Reset */ + predicate.move_mode = 0; + mir_update_worklist(worklist, len, instructions, vlut); mir_update_worklist(worklist, len, instructions, vadd); mir_update_worklist(worklist, len, instructions, smul); -- 2.30.2