From: Alyssa Rosenzweig Date: Wed, 15 Jul 2020 15:57:35 +0000 (-0400) Subject: panfrost: Identify zs_samples field X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e061bf004b536120566fbbe49111a8215e1a979b;p=mesa.git panfrost: Identify zs_samples field For MSAA depth/stencil. Signed-off-by: Alyssa Rosenzweig Part-of: --- 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");