panfrost: Fix Z24 vs Z32 mixup
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 15 May 2020 23:16:56 +0000 (19:16 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 19 May 2020 18:09:26 +0000 (18:09 +0000)
We don't actually support Z32_UNORM; the format we've been using as such
is in fact Z24X8 / Z24S8. Fix that and drop Z32_UNORM.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5069>

src/gallium/drivers/panfrost/pan_mfbd.c
src/gallium/drivers/panfrost/pan_sfbd.c
src/panfrost/encoder/pan_format.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/pan_pretty_print.c

index 723d92b0067274c7c911be94d69db637b1bd65ff..bfb79dd6d3cbfe0e774b5bb17f4f7ced7cb75f69 100644 (file)
@@ -298,8 +298,6 @@ panfrost_mfbd_set_zsbuf(
 
                 if (panfrost_is_z24s8_variant(surf->format)) {
                         fbx->flags_lo |= 0x1;
-                } else if (surf->format == PIPE_FORMAT_Z32_UNORM) {
-                        /* default flags (0 in bottom place) */
                 } else if (surf->format == PIPE_FORMAT_Z32_FLOAT) {
                         fbx->flags_lo |= 0xA;
                         fb->mfbd_flags ^= 0x100;
@@ -481,7 +479,7 @@ panfrost_mfbd_fragment(struct panfrost_batch *batch, bool has_draws)
 
         /* When scanning out, the depth buffer is immediately invalidated, so
          * we don't need to waste bandwidth writing it out. This can improve
-         * performance substantially (Z32_UNORM 1080p @ 60fps is 475 MB/s of
+         * performance substantially (Z24X8_UNORM 1080p @ 60fps is 475 MB/s of
          * memory bandwidth!).
          *
          * The exception is ReadPixels, but this is not supported on GLES so we
index 9cbcbcaba4eae61999accdf8fc8720029c5759f6..7a0deaf4d39b75366e996f174036314028f91e4d 100644 (file)
@@ -173,16 +173,12 @@ panfrost_sfbd_set_zsbuf(
                 return;
 
         if (panfrost_is_z24s8_variant(surf->format)) {
-
                 /* Stencil data is interleaved with depth */
                 fb->stencil_buffer = fb->depth_buffer;
                 fb->stencil_stride = fb->depth_stride;
-        } else if (surf->format == PIPE_FORMAT_Z32_UNORM ||
-                   surf->format == PIPE_FORMAT_Z32_FLOAT) {
-
+        } else if (surf->format == PIPE_FORMAT_Z32_FLOAT) {
                 /* No stencil, nothing to do */
         } else if (surf->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) {
-
                 /* Stencil data in separate buffer */
                 struct panfrost_resource *stencil = rsrc->separate_stencil;
                 struct panfrost_slice stencil_slice = stencil->slices[level];
index c14c09758f24d2df934472afaaab3d8875182d84..021672750342df9d309f4e29d78c3a178432ef47 100644 (file)
@@ -110,9 +110,8 @@ struct panfrost_format panfrost_pipe_format_table[PIPE_FORMAT_COUNT] = {
 
         [PIPE_FORMAT_R3G3B2_UNORM]             = { MALI_RGB332_UNORM, _VT },
 
-        [PIPE_FORMAT_Z24_UNORM_S8_UINT]                = { MALI_Z32_UNORM, _TZ },
-        [PIPE_FORMAT_Z24X8_UNORM]              = { MALI_Z32_UNORM, _TZ },
-        [PIPE_FORMAT_Z32_UNORM]                        = { MALI_Z32_UNORM, _TZ },
+        [PIPE_FORMAT_Z24_UNORM_S8_UINT]                = { MALI_Z24X8_UNORM, _TZ },
+        [PIPE_FORMAT_Z24X8_UNORM]              = { MALI_Z24X8_UNORM, _TZ },
         [PIPE_FORMAT_Z32_FLOAT]                        = { MALI_R32F, _TZ },
         [PIPE_FORMAT_Z32_FLOAT_S8X24_UINT]     = { MALI_R32F, _TZ },
 
index b02d0abcde93c41d7ff00421ed40732d676dce92..bb835a13b0037627833ef71a7519a9716da0e5ac 100644 (file)
@@ -297,7 +297,7 @@ enum mali_format {
        MALI_RGB332_UNORM   = MALI_FORMAT_SPECIAL | 0xb,
        MALI_RGB233_UNORM   = MALI_FORMAT_SPECIAL | 0xc,
 
-       MALI_Z32_UNORM      = MALI_FORMAT_SPECIAL | 0xd,
+       MALI_Z24X8_UNORM    = MALI_FORMAT_SPECIAL | 0xd,
        MALI_R32_FIXED      = MALI_FORMAT_SPECIAL | 0x11,
        MALI_RG32_FIXED     = MALI_FORMAT_SPECIAL | 0x12,
        MALI_RGB32_FIXED    = MALI_FORMAT_SPECIAL | 0x13,
index a1a87fa2c2c41742fe26b2eb82938a1a8cdcf6d7..05b0d1ae4cbae583d527c639bdccc09716d5d210 100644 (file)
@@ -54,7 +54,7 @@ char *pandecode_format(enum mali_format format)
                 DEFINE_CASE(RGB10_A2I);
                 DEFINE_CASE(RGB332_UNORM);
                 DEFINE_CASE(RGB233_UNORM);
-                DEFINE_CASE(Z32_UNORM);
+                DEFINE_CASE(Z24X8_UNORM);
                 DEFINE_CASE(R32_FIXED);
                 DEFINE_CASE(RG32_FIXED);
                 DEFINE_CASE(RGB32_FIXED);