From aef230bfe93fe6ae607adbeef7b7a37ce6969514 Mon Sep 17 00:00:00 2001
From: "Lukas F. Hartmann" <lukas@mntre.com>
Date: Mon, 7 Sep 2020 14:42:26 +0200
Subject: [PATCH] mkuserland2.sh: remove etnaviv patch that is now upstream

---
 reform2-imx8mq/mkuserland2.sh | 84 -----------------------------------
 1 file changed, 84 deletions(-)

diff --git a/reform2-imx8mq/mkuserland2.sh b/reform2-imx8mq/mkuserland2.sh
index 8a94cfe..b5c8062 100755
--- a/reform2-imx8mq/mkuserland2.sh
+++ b/reform2-imx8mq/mkuserland2.sh
@@ -43,90 +43,6 @@ patch -p1 <<ENDPATCH
        return false;
 ENDPATCH
 
-# MNT patch that fixes disabling of early-z in etnaviv (mesa gitlab MR 5456)
-patch -p1 <<ENDPATCH
-diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
-index a9c34171..3b0cdbba 100644
---- a/src/gallium/drivers/etnaviv/etnaviv_context.c
-+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
-@@ -394,9 +394,6 @@ etna_reset_gpu_state(struct etna_context *ctx)
- 
-    etna_set_state(stream, VIVS_GL_API_MODE, VIVS_GL_API_MODE_OPENGL);
-    etna_set_state(stream, VIVS_GL_VERTEX_ELEMENT_CONFIG, 0x00000001);
--   /* blob sets this to 0x40000031 on GC7000, seems to make no difference,
--    * but keep it in mind if depth behaves strangely. */
--   etna_set_state(stream, VIVS_RA_EARLY_DEPTH, 0x00000031);
-    etna_set_state(stream, VIVS_PA_W_CLIP_LIMIT, 0x34000001);
-    etna_set_state(stream, VIVS_PA_FLAGS, 0x00000000); /* blob sets ZCONVERT_BYPASS on GC3000+, this messes up z for us */
-    etna_set_state(stream, VIVS_PA_VIEWPORT_UNK00A80, 0x38a01404);
-diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c
-index de36aeb7..a98c0146 100644
---- a/src/gallium/drivers/etnaviv/etnaviv_emit.c
-+++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c
-@@ -428,6 +428,7 @@ etna_emit_state(struct etna_context *ctx)
-       /*01400*/ EMIT_STATE(PE_DEPTH_CONFIG, (etna_zsa_state(ctx->zsa)->PE_DEPTH_CONFIG |
-                                              ctx->framebuffer.PE_DEPTH_CONFIG) &
-                                             ctx->shader_state.PE_DEPTH_CONFIG);
-+      /*00E08*/ EMIT_STATE(RA_EARLY_DEPTH, etna_zsa_state(ctx->zsa)->RA_DEPTH_CONFIG);
-    }
-    if (unlikely(dirty & (ETNA_DIRTY_VIEWPORT))) {
-       /*01404*/ EMIT_STATE(PE_DEPTH_NEAR, ctx->viewport.PE_DEPTH_NEAR);
-diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c
-index efafd123..e25d78dd 100644
---- a/src/gallium/drivers/etnaviv/etnaviv_state.c
-+++ b/src/gallium/drivers/etnaviv/etnaviv_state.c
-@@ -250,9 +250,7 @@ etna_set_framebuffer_state(struct pipe_context *pctx,
-          depth_format |
-          COND(depth_supertiled, VIVS_PE_DEPTH_CONFIG_SUPER_TILED) |
-          VIVS_PE_DEPTH_CONFIG_DEPTH_MODE_Z |
--         VIVS_PE_DEPTH_CONFIG_UNK18 | /* something to do with clipping? */
--         COND(screen->specs.halti >= 5, VIVS_PE_DEPTH_CONFIG_DISABLE_ZS) /* Needs to be enabled on GC7000, otherwise depth writes hang w/ TS - apparently it does something else now */
--         ;
-+         VIVS_PE_DEPTH_CONFIG_UNK18; /* something to do with clipping? */
-       /* VIVS_PE_DEPTH_CONFIG_ONLY_DEPTH */
-       /* merged with depth_stencil_alpha */
- 
-diff --git a/src/gallium/drivers/etnaviv/etnaviv_zsa.c b/src/gallium/drivers/etnaviv/etnaviv_zsa.c
-index afff6b7d..a0dec96e 100644
---- a/src/gallium/drivers/etnaviv/etnaviv_zsa.c
-+++ b/src/gallium/drivers/etnaviv/etnaviv_zsa.c
-@@ -110,7 +110,8 @@ etna_zsa_state_create(struct pipe_context *pctx,
-       COND(so->depth.writemask, VIVS_PE_DEPTH_CONFIG_WRITE_ENABLE) |
-       COND(early_z, VIVS_PE_DEPTH_CONFIG_EARLY_Z) |
-       /* this bit changed meaning with HALTI5: */
--      COND(disable_zs && screen->specs.halti < 5, VIVS_PE_DEPTH_CONFIG_DISABLE_ZS);
-+      COND((disable_zs && screen->specs.halti < 5) || ((early_z || disable_zs) && VIV_FEATURE(screen, chipMinorFeatures5, RA_WRITE_DEPTH)), VIVS_PE_DEPTH_CONFIG_DISABLE_ZS);
-+
-    cs->PE_ALPHA_OP =
-       COND(so->alpha.enabled, VIVS_PE_ALPHA_OP_ALPHA_TEST) |
-       VIVS_PE_ALPHA_OP_ALPHA_FUNC(so->alpha.func) |
-@@ -137,6 +138,13 @@ etna_zsa_state_create(struct pipe_context *pctx,
-          VIVS_PE_STENCIL_CONFIG_EXT2_WRITE_MASK_BACK(stencil_back->writemask);
-    }
- 
-+   /* blob sets this to 0x40000031 on GC7000, seems to make no difference,
-+    * but keep it in mind if depth behaves strangely. */
-+   cs->RA_DEPTH_CONFIG = 0x00000031;
-+   if (VIV_FEATURE(screen, chipMinorFeatures5, RA_WRITE_DEPTH) && !disable_zs && !early_z) {
-+      cs->RA_DEPTH_CONFIG = 0x11000031;
-+   }
-+
-    /* XXX does alpha/stencil test affect PE_COLOR_FORMAT_OVERWRITE? */
-    return cs;
- }
-diff --git a/src/gallium/drivers/etnaviv/etnaviv_zsa.h b/src/gallium/drivers/etnaviv/etnaviv_zsa.h
-index 061a5f46..dfa1b572 100644
---- a/src/gallium/drivers/etnaviv/etnaviv_zsa.h
-+++ b/src/gallium/drivers/etnaviv/etnaviv_zsa.h
-@@ -39,6 +39,7 @@ struct etna_zsa_state {
-    uint32_t PE_STENCIL_CONFIG[2];
-    uint32_t PE_STENCIL_CONFIG_EXT;
-    uint32_t PE_STENCIL_CONFIG_EXT2[2];
-+   uint32_t RA_DEPTH_CONFIG;
- 
- };
- 
-ENDPATCH
 ninja -C build install
 cd ..
 
-- 
GitLab