Mesa (master): panfrost: Document "depth-buffer writeback" bit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 12 02:40:33 UTC 2019


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

Author: Alyssa Rosenzweig <alyssa at rosenzweig.io>
Date:   Sat Mar  9 00:12:07 2019 +0000

panfrost: Document "depth-buffer writeback" bit

This bit, if set, causes the depth buffer to be copied from GPU tile
memory to the provided depth buffer in main memory. If not set, the GPU
will not access the main memory (saving considerable memory bandwidth if
depth results are not actually used).

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>

---

 src/gallium/drivers/panfrost/include/panfrost-job.h | 8 ++++++++
 src/gallium/drivers/panfrost/pan_context.c          | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
index d719325d07b..28ba3f85ad4 100644
--- a/src/gallium/drivers/panfrost/include/panfrost-job.h
+++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
@@ -1457,6 +1457,14 @@ struct bifrost_fb_extra {
 } __attribute__((packed));
 
 /* flags for unk3 */
+
+/* Enables writing depth results back to main memory (rather than keeping them
+ * on-chip in the tile buffer and then discarding) */
+
+#define MALI_MFBD_DEPTH_WRITE (1 << 10)
+
+/* The MFBD contains the extra bifrost_fb_extra section */
+
 #define MALI_MFBD_EXTRA (1 << 13)
 
 struct bifrost_framebuffer {
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 9d89a8978ae..59095ae0203 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -257,7 +257,7 @@ panfrost_set_fragment_target(struct panfrost_context *ctx)
 
                         ctx->fragment_extra.unk = 0x435; /* General 0x400 in all unks. 0x5 for depth/stencil. 0x10 for AFBC encoded depth stencil. Unclear where the 0x20 is from */
 
-                        ctx->fragment_mfbd.unk3 |= 0x400;
+                        ctx->fragment_mfbd.unk3 |= MALI_MFBD_DEPTH_WRITE;
                 }
         }
 




More information about the mesa-commit mailing list