diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-04-05 18:06:08 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-05 23:26:04 +0000 |
commit | 9114ebbe798e101b6bb2b86219cfd3ba9793068f (patch) | |
tree | 21d4590efbf7ba43bbb4b128e07c55df63427e5d | |
parent | 0ab3f687c012c7e29fbb9da348bec1854ee85fd7 (diff) |
pan/bi: Add helper to debug port assignment
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4458>
-rw-r--r-- | src/panfrost/bifrost/bi_pack.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index f1eb3be52b0..8c91c0436d2 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -77,6 +77,27 @@ struct bi_registers { bool first_instruction; }; +static inline void +bi_print_ports(struct bi_registers *regs) +{ + for (unsigned i = 0; i < 2; ++i) { + if (regs->enabled[i]) + printf("port %u: %u\n", i, regs->port[i]); + } + + if (regs->write_fma || regs->write_add) { + printf("port 2 (%s): %u\n", + regs->write_fma ? "FMA" : "ADD", + regs->port[2]); + } + + if ((regs->write_fma && regs->write_add) || regs->read_port3) { + printf("port 3 (%s): %u\n", + regs->read_port3 ? "read" : "ADD", + regs->port[3]); + } +} + /* The uniform/constant slot allows loading a contiguous 64-bit immediate or * pushed uniform per bundle. Figure out which one we need in the bundle (the * scheduler needs to ensure we only have one type per bundle), validate @@ -216,7 +237,11 @@ bi_assign_port_read(struct bi_registers *regs, unsigned src) if (!regs->read_port3) { regs->port[3] = reg; regs->read_port3 = true; + return; } + + bi_print_ports(regs); + unreachable("Failed to find a free port for src"); } static struct bi_registers |