panfrost: Identify zs_samples field
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 15 Jul 2020 15:57:35 +0000 (11:57 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 15 Jul 2020 22:19:37 +0000 (22:19 +0000)
For MSAA depth/stencil.

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

src/gallium/drivers/panfrost/pan_mfbd.c
src/panfrost/include/panfrost-job.h
src/panfrost/pandecode/decode.c

index aea990f2104d694456049c8a16b3519214235874..e1c389c39049299aa5a929b7eae5ce5602cf6f78 100644 (file)
@@ -335,7 +335,7 @@ panfrost_mfbd_set_zsbuf(
                 } else {
                         if (is_bifrost) {
                                 fbx->zs_block = MALI_BLOCK_UNKNOWN;
-                                fbx->flags_hi |= 0x4400;
+                                fbx->flags_hi |= 0x440;
                                 fbx->flags_lo |= 0x1;
                         } else {
                                 fbx->zs_block = MALI_BLOCK_TILED;
@@ -352,7 +352,7 @@ panfrost_mfbd_set_zsbuf(
                         fb->mfbd_flags ^= 0x100;
                         fb->mfbd_flags |= 0x200;
                 } else if (surf->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT) {
-                        fbx->flags_hi |= 0x400;
+                        fbx->flags_hi |= 0x40;
                         fbx->flags_lo |= 0xA;
                         fb->mfbd_flags ^= 0x100;
                         fb->mfbd_flags |= 0x201;
index 21b52ad4ea5c1423c4c29912c6bb1919925f81c3..c6fd0647ca34f6de7c987be8518e557d3e251df6 100644 (file)
@@ -1777,7 +1777,7 @@ struct mali_render_target {
  */
 
 /* flags_hi */
-#define MALI_EXTRA_PRESENT      (0x10)
+#define MALI_EXTRA_PRESENT      (0x1)
 
 /* flags_lo */
 #define MALI_EXTRA_ZS           (0x4)
@@ -1789,7 +1789,11 @@ struct mali_framebuffer_extra  {
 
         unsigned flags_lo : 4;
         enum mali_block_format zs_block : 2;
-        unsigned flags_hi : 26;
+
+        /* Number of samples in Z/S attachment, MALI_POSITIVE. So zero for
+         * 1-sample (non-MSAA), 0x3 for MSAA 4x, etc */
+        unsigned zs_samples : 4;
+        unsigned flags_hi : 22;
 
         union {
                 /* Note: AFBC is only allowed for 24/8 combined depth/stencil. */
index 6950fe9f91374e9520341415221a88f2811a44f4..d3a0a01c882234f69a7d10c91da3906c79a437ee 100644 (file)
@@ -1245,6 +1245,7 @@ pandecode_mfbd_bfr(uint64_t gpu_va, int job_no, bool is_fragment, bool is_comput
                 pandecode_log_cont(",\n");
 
                 pandecode_prop("zs_block = %s", pandecode_block_format(fbx->zs_block));
+                pandecode_prop("zs_samples = MALI_POSITIVE(%u)", fbx->zs_samples + 1);
 
                 if (fbx->zs_block == MALI_BLOCK_AFBC) {
                         pandecode_log(".ds_afbc = {\n");