Mesa (main): freedreno/a6xx: Emit GRAS_LRZ_MRT_BUF_INFO_0

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 28 22:39:07 UTC 2021


Module: Mesa
Branch: main
Commit: e6ae0e9b953616fed894e02b9b8c2a52f269b0be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6ae0e9b953616fed894e02b9b8c2a52f269b0be

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Thu Oct 28 18:59:33 2021 +0200

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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13578>

---

 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));
 



More information about the mesa-commit mailing list