From 211cc2550c86cfd78abaf8bff9ac91ed506983d7 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 30 Jun 2020 16:49:52 -0400 Subject: [PATCH] panfrost: Set layer_stride for multisampled rendering Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_mfbd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c index 274fff45aaa..6acaf3d3859 100644 --- a/src/gallium/drivers/panfrost/pan_mfbd.c +++ b/src/gallium/drivers/panfrost/pan_mfbd.c @@ -211,6 +211,15 @@ panfrost_mfbd_set_cbuf( assert(surf->u.tex.last_layer == first_layer); int stride = rsrc->slices[level].stride; + /* Only set layer_stride for MSAA rendering */ + + unsigned nr_samples = surf->nr_samples; + + if (!nr_samples) + nr_samples = surf->texture->nr_samples; + + unsigned layer_stride = (nr_samples > 1) ? rsrc->slices[level].size0 : 0; + mali_ptr base = panfrost_get_texture_address(rsrc, level, first_layer, 0); rt->format = panfrost_mfbd_format(surf); @@ -226,6 +235,7 @@ panfrost_mfbd_set_cbuf( rt->framebuffer = base; rt->framebuffer_stride = stride / 16; + rt->layer_stride = layer_stride; } else if (rsrc->layout == MALI_TEXTURE_TILED) { if (is_bifrost) { rt->format.unk3 |= 0x8; @@ -235,12 +245,14 @@ panfrost_mfbd_set_cbuf( rt->framebuffer = base; rt->framebuffer_stride = stride; + rt->layer_stride = layer_stride; } else if (rsrc->layout == MALI_TEXTURE_AFBC) { rt->format.block = MALI_BLOCK_AFBC; unsigned header_size = rsrc->slices[level].header_size; rt->framebuffer = base + header_size; + rt->layer_stride = layer_stride; rt->afbc.metadata = base; rt->afbc.stride = 0; rt->afbc.flags = MALI_AFBC_FLAGS; -- 2.30.2