Mesa (master): panfrost: Identify zs_samples field

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 15 22:34:42 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Jul 15 11:57:35 2020 -0400

panfrost: Identify zs_samples field

For MSAA depth/stencil.

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

---

 src/gallium/drivers/panfrost/pan_mfbd.c | 4 ++--
 src/panfrost/include/panfrost-job.h     | 8 ++++++--
 src/panfrost/pandecode/decode.c         | 1 +
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c
index aea990f2104..e1c389c3904 100644
--- a/src/gallium/drivers/panfrost/pan_mfbd.c
+++ b/src/gallium/drivers/panfrost/pan_mfbd.c
@@ -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;
diff --git a/src/panfrost/include/panfrost-job.h b/src/panfrost/include/panfrost-job.h
index 21b52ad4ea5..c6fd0647ca3 100644
--- a/src/panfrost/include/panfrost-job.h
+++ b/src/panfrost/include/panfrost-job.h
@@ -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. */
diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c
index 6950fe9f913..d3a0a01c882 100644
--- a/src/panfrost/pandecode/decode.c
+++ b/src/panfrost/pandecode/decode.c
@@ -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");



More information about the mesa-commit mailing list