[Mesa-dev] [PATCH 08/10] panfrost: Allocate extra data for depth buffer

Alyssa Rosenzweig alyssa at rosenzweig.io
Wed Mar 13 02:03:25 UTC 2019


It's not clear why the hardware "spills" a little bit, but if we don't
do this, we get MMU faults with linear depth buffers.

Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
 src/gallium/drivers/panfrost/pan_resource.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index d647f618ee7..a6e0cfe4687 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -197,6 +197,11 @@ panfrost_create_bo(struct panfrost_screen *screen, const struct pipe_resource *t
         if (template->height0) sz *= template->height0;
         if (template->depth0) sz *= template->depth0;
 
+        /* Depth buffers require extra space for unknown reasons */
+
+        if (template->bind & PIPE_BIND_DEPTH_STENCIL)
+                sz = sz + sz/256;
+
         /* Based on the usage, figure out what storing will be used. There are
          * various tradeoffs:
          *
-- 
2.20.1



More information about the mesa-dev mailing list