diff options
author | Eric Anholt <[email protected]> | 2014-11-26 12:44:19 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-12-01 11:00:23 -0800 |
commit | 3fe4d8e1e39b47c9c5c4bfdd87300abd0c336a7e (patch) | |
tree | 5ac8c5cee06176519262f90dabb3d304c120f655 /src/gallium/drivers/vc4/vc4_qpu.c | |
parent | 6958c404caf3f4b2219ef686e2beeeaf48664905 (diff) |
vc4: Introduce scheduling of QPU instructions.
This doesn't reschedule much currently, just tries to fit things into the
regfile A/B write-versus-read slots (the cause of the improvements in
shader-db), and hide texture fetch latency by scheduling setup early and
results collection late (haven't performance tested it). This
infrastructure will be important for doing instruction pairing, though.
shader-db2 results:
total instructions in shared programs: 61874 -> 59583 (-3.70%)
instructions in affected programs: 50677 -> 48386 (-4.52%)
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qpu.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qpu.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qpu.c b/src/gallium/drivers/vc4/vc4_qpu.c index 093ca077e6d..723b3613665 100644 --- a/src/gallium/drivers/vc4/vc4_qpu.c +++ b/src/gallium/drivers/vc4/vc4_qpu.c @@ -22,6 +22,7 @@ */ #include <stdbool.h> +#include "vc4_qir.h" #include "vc4_qpu.h" static uint64_t @@ -267,3 +268,14 @@ qpu_inst_is_tlb(uint64_t inst) sig == QPU_SIG_COLOR_LOAD || sig == QPU_SIG_WAIT_FOR_SCOREBOARD); } + +void +qpu_serialize_one_inst(struct vc4_compile *c, uint64_t inst) +{ + if (c->qpu_inst_count >= c->qpu_inst_size) { + c->qpu_inst_size = MAX2(16, c->qpu_inst_size * 2); + c->qpu_insts = realloc(c->qpu_insts, + c->qpu_inst_size * sizeof(uint64_t)); + } + c->qpu_insts[c->qpu_inst_count++] = inst; +} |