mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 00:30:11 +01:00
pan/mdg: Fix out-of-order execution
We can go up to 15 instructions out of order (performance fix) but we can't go past a branch (bug fix). Fixes:30a393f458("pan/mdg: Enable out-of-order execution after texture ops") Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19762> (cherry picked from commit044428211c)
This commit is contained in:
parent
9154a88b11
commit
074803832b
3 changed files with 13 additions and 9 deletions
|
|
@ -1471,7 +1471,7 @@
|
|||
"description": "pan/mdg: Fix out-of-order execution",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "30a393f4581079ced1ac05d6b74c7408fbe26f83"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -937,8 +937,8 @@ __attribute__((__packed__))
|
|||
* be any dependency (the blob appears to forbid even accessing other
|
||||
* channels of a given texture register). */
|
||||
|
||||
unsigned out_of_order : 2;
|
||||
unsigned unknown4 : 10;
|
||||
unsigned out_of_order : 4;
|
||||
unsigned unknown4 : 8;
|
||||
|
||||
/* In immediate mode, each offset field is an immediate range [0, 7].
|
||||
*
|
||||
|
|
|
|||
|
|
@ -414,10 +414,11 @@ mir_pack_swizzle_tex(midgard_instruction *ins)
|
|||
/* TODO: bias component */
|
||||
}
|
||||
|
||||
/* Up to 3 { ALU, LDST } bundles can execute in parallel with a texture op.
|
||||
/*
|
||||
* Up to 15 { ALU, LDST } bundles can execute in parallel with a texture op.
|
||||
* Given a texture op, lookahead to see how many such bundles we can flag for
|
||||
* OoO execution */
|
||||
|
||||
* OoO execution
|
||||
*/
|
||||
static bool
|
||||
mir_can_run_ooo(midgard_block *block, midgard_bundle *bundle,
|
||||
unsigned dependency)
|
||||
|
|
@ -430,11 +431,14 @@ mir_can_run_ooo(midgard_block *block, midgard_bundle *bundle,
|
|||
if (!IS_ALU(bundle->tag) && bundle->tag != TAG_LOAD_STORE_4)
|
||||
return false;
|
||||
|
||||
/* Ensure there is no read-after-write dependency */
|
||||
|
||||
for (unsigned i = 0; i < bundle->instruction_count; ++i) {
|
||||
midgard_instruction *ins = bundle->instructions[i];
|
||||
|
||||
/* No branches, jumps, or discards */
|
||||
if (ins->compact_branch)
|
||||
return false;
|
||||
|
||||
/* No read-after-write data dependencies */
|
||||
mir_foreach_src(ins, s) {
|
||||
if (ins->src[s] == dependency)
|
||||
return false;
|
||||
|
|
@ -450,7 +454,7 @@ mir_pack_tex_ooo(midgard_block *block, midgard_bundle *bundle, midgard_instructi
|
|||
{
|
||||
unsigned count = 0;
|
||||
|
||||
for (count = 0; count < 3; ++count) {
|
||||
for (count = 0; count < 15; ++count) {
|
||||
if (!mir_can_run_ooo(block, bundle + count + 1, ins->dest))
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue