summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-08-09 15:12:30 -0700
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2019-08-14 16:42:40 -0700
commit6ed384322455dcac9df724aab1840119ab14f0a3 (patch)
treea076ad2d46ec550341ae7bcd404fa6962435834a
parent716be7862e85da132df832650b30124bd8a83493 (diff)
pan/mfbd: Stuff in RT count
Fixes DATA_INVALID_FAULTs with multiple render targets. We do always allocate space for 4 cbufs just to keep things sane. This may not be strictly necessary. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-rw-r--r--src/gallium/drivers/panfrost/pan_mfbd.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c
index 1f504294bda..bae3429afae 100644
--- a/src/gallium/drivers/panfrost/pan_mfbd.c
+++ b/src/gallium/drivers/panfrost/pan_mfbd.c
@@ -349,7 +349,7 @@ panfrost_mfbd_upload(
struct bifrost_framebuffer *fb,
struct bifrost_fb_extra *fbx,
struct bifrost_render_target *rts,
- unsigned cbufs)
+ unsigned rt_count)
{
off_t offset = 0;
@@ -361,7 +361,7 @@ panfrost_mfbd_upload(
size_t total_sz =
sizeof(struct bifrost_framebuffer) +
(has_extra ? sizeof(struct bifrost_fb_extra) : 0) +
- sizeof(struct bifrost_render_target) * cbufs;
+ sizeof(struct bifrost_render_target) * 4;
struct panfrost_transfer m_f_trans =
panfrost_allocate_transient(ctx, total_sz);
@@ -373,12 +373,17 @@ panfrost_mfbd_upload(
if (has_extra)
UPLOAD(m_f_trans, offset, fbx, total_sz);
- for (unsigned c = 0; c < cbufs; ++c) {
+ for (unsigned c = 0; c < 4; ++c) {
UPLOAD(m_f_trans, offset, &rts[c], total_sz);
}
/* Return pointer suitable for the fragment section */
- return m_f_trans.gpu | MALI_MFBD | (has_extra ? 2 : 0);
+ unsigned tag =
+ MALI_MFBD |
+ (has_extra ? 0x2 : 0x0) |
+ (MALI_POSITIVE(rt_count) << 2);
+
+ return m_f_trans.gpu | tag;
}
#undef UPLOAD
@@ -483,8 +488,5 @@ panfrost_mfbd_fragment(struct panfrost_context *ctx, bool has_draws)
}
}
- /* We always upload at least one (dummy) cbuf */
- unsigned cbufs = MAX2(ctx->pipe_framebuffer.nr_cbufs, 1);
-
- return panfrost_mfbd_upload(ctx, &fb, &fbx, rts, cbufs);
+ return panfrost_mfbd_upload(ctx, &fb, &fbx, rts, rt_descriptors);
}