aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2019-06-10 12:04:21 -0700
committerKristian H. Kristensen <[email protected]>2019-09-18 16:59:10 -0700
commit2251a4345b1d9ebbf1defe533e16a2633d5127ef (patch)
tree983653d23cbe0e4ba6ac5668d6a6c1a7dfa67fb2
parentcc4fe81145388085448c76db2bea8463a2991729 (diff)
freedreno/a6xx: Write multiple regs for SP_VS_OUT_REG and SP_VS_VPC_DST_REG
Compute the number of writes up front. Signed-off-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_program.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
index 26be370833d..3a1c0a411f9 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
@@ -352,11 +352,11 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_screen *screen,
setup_stream_out(state, vs, &l);
}
- for (i = 0, j = 0; (i < 16) && (j < l.cnt); i++) {
+ debug_assert(l.cnt < 32);
+ OUT_PKT4(ring, REG_A6XX_SP_VS_OUT_REG(0), DIV_ROUND_UP(l.cnt, 2));
+ for (j = 0; j < l.cnt; ) {
uint32_t reg = 0;
- OUT_PKT4(ring, REG_A6XX_SP_VS_OUT_REG(i), 1);
-
reg |= A6XX_SP_VS_OUT_REG_A_REGID(l.var[j].regid);
reg |= A6XX_SP_VS_OUT_REG_A_COMPMASK(l.var[j].compmask);
j++;
@@ -368,11 +368,10 @@ setup_stateobj(struct fd_ringbuffer *ring, struct fd_screen *screen,
OUT_RING(ring, reg);
}
- for (i = 0, j = 0; (i < 8) && (j < l.cnt); i++) {
+ OUT_PKT4(ring, REG_A6XX_SP_VS_VPC_DST_REG(0), DIV_ROUND_UP(l.cnt, 4));
+ for (j = 0; j < l.cnt; ) {
uint32_t reg = 0;
- OUT_PKT4(ring, REG_A6XX_SP_VS_VPC_DST_REG(i), 1);
-
reg |= A6XX_SP_VS_VPC_DST_REG_OUTLOC0(l.var[j++].loc);
reg |= A6XX_SP_VS_VPC_DST_REG_OUTLOC1(l.var[j++].loc);
reg |= A6XX_SP_VS_VPC_DST_REG_OUTLOC2(l.var[j++].loc);