aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-12-14 09:09:08 -0800
committerRob Clark <[email protected]>2019-12-14 09:12:39 -0800
commit1bf3837395b07793baa48fd71689701d4ea55e38 (patch)
treed82cd4b7bd5bb6688aee9fd3232bda3c893714d6 /src/gallium/drivers/freedreno
parentce52b49348111d6e6277d1899d39440228ceaed8 (diff)
freedreno/a6xx: fix OUT_REG() vs growable cmdstream
BEGIN_RING() could decide we can't fit the next packet in the current cmdstream segment, and grow a new segment. So we need to grab ring->cur *after* BEGIN_RING(), otherwise we are writing cmdstream past the end of the previous segment. Fixes: bdd98b892f3 ("freedreno: New struct packing macros") Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_pack.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_pack.h b/src/gallium/drivers/freedreno/a6xx/fd6_pack.h
index 84b232e74a2..f5f8e2ca5f7 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_pack.h
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_pack.h
@@ -76,12 +76,12 @@ struct fd_reg_pair {
do { \
const struct fd_reg_pair regs[] = { __VA_ARGS__ }; \
unsigned count = ARRAY_SIZE(regs); \
- uint32_t *p = ring->cur; \
\
STATIC_ASSERT(count > 0); \
STATIC_ASSERT(count <= 16); \
\
BEGIN_RING(ring, count + 1); \
+ uint32_t *p = ring->cur; \
*p++ = CP_TYPE4_PKT | count | \
(_odd_parity_bit(count) << 7) | \
((regs[0].reg & 0x3ffff) << 8) | \