From e6ae0e9b953616fed894e02b9b8c2a52f269b0be Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Thu, 28 Oct 2021 18:59:33 +0200 Subject: [PATCH] freedreno/a6xx: Emit GRAS_LRZ_MRT_BUF_INFO_0 Analogous to the previous commit, this fixes the case where turnip sets this reg to a media (yuv) format and then a gallium job is run next. Fixes: 9c895e13 ("tu: Emit GRAS_LRZ_MRT_BUF_INFO_0") Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_gmem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c index 49107398943..ed8f4f387ca 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_gmem.c @@ -79,6 +79,7 @@ emit_mrt(struct fd_ringbuffer *ring, struct pipe_framebuffer_state *pfb, unsigned i; unsigned max_layer_index = 0; + enum a6xx_format mrt0_format = 0; for (i = 0; i < pfb->nr_cbufs; i++) { enum a3xx_color_swap swap = WZYX; @@ -134,8 +135,13 @@ emit_mrt(struct fd_ringbuffer *ring, struct pipe_framebuffer_state *pfb, OUT_PKT4(ring, REG_A6XX_RB_MRT_FLAG_BUFFER(i), 3); fd6_emit_flag_reference(ring, rsc, psurf->u.tex.level, psurf->u.tex.first_layer); + + if (i == 0) + mrt0_format = format; } + OUT_REG(ring, A6XX_GRAS_LRZ_MRT_BUF_INFO_0(.color_format = mrt0_format)); + OUT_REG(ring, A6XX_RB_SRGB_CNTL(.dword = srgb_cntl)); OUT_REG(ring, A6XX_SP_SRGB_CNTL(.dword = srgb_cntl));