panfrost: Tweak zsbuf magic numbers for Bifrost
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 26 May 2020 22:19:19 +0000 (18:19 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 27 May 2020 20:49:43 +0000 (16:49 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5232>

src/gallium/drivers/panfrost/pan_mfbd.c

index db7205528a97b2ee4611356a6e303055c4606aa0..2212f6a301fcf60f8115028c2304dc6343f4f336 100644 (file)
@@ -250,6 +250,8 @@ panfrost_mfbd_set_zsbuf(
         struct mali_framebuffer_extra *fbx,
         struct pipe_surface *surf)
 {
+        struct panfrost_device *dev = pan_device(surf->context->screen);
+        bool is_bifrost = dev->quirks & IS_BIFROST;
         struct panfrost_resource *rsrc = pan_resource(surf->texture);
 
         unsigned level = surf->u.tex.level;
@@ -292,7 +294,14 @@ panfrost_mfbd_set_zsbuf(
                         fbx->zs_block = MALI_BLOCK_LINEAR;
                         fbx->ds_linear.depth_stride = stride / 16;
                 } else {
-                        fbx->zs_block = MALI_BLOCK_TILED;
+                        if (is_bifrost) {
+                                fbx->zs_block = MALI_BLOCK_UNKNOWN;
+                                fbx->flags_hi |= 0x4400;
+                                fbx->flags_lo |= 0x1;
+                        } else {
+                                fbx->zs_block = MALI_BLOCK_TILED;
+                        }
+
                         fbx->ds_linear.depth_stride = stride;
                 }