summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_mfbd.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-21 14:54:44 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-25 13:39:17 -0700
commit3609b50a64430d9eaefd3473d9ad96910e87002c (patch)
tree5d1767cd8f1dbc3f03f8954ff5d37a14e63bbd0b /src/gallium/drivers/panfrost/pan_mfbd.c
parentaea3f0ac1d1e281b5d2f2100acad87810ed309c0 (diff)
panfrost: Merge AFBC slab with BO backing
Rather than tracking AFBC memory "specially", just use the same codepath as linear and tiled. Less things to mess up, I figure. This allows us to use the standard setup_slices() call with AFBC resources, allowing mipmapped AFBC resources. Unfortunately, we do have to disable AFBC (and checksumming) in the meantime to avoid functional regressions, as we don't know _a priori_ if we'll need to access a resource from software (which is not yet hooked up with AFBC) and we don't yet have routines to switch the layout of a BO at runtime. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_mfbd.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_mfbd.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gallium/drivers/panfrost/pan_mfbd.c b/src/gallium/drivers/panfrost/pan_mfbd.c
index c082d0b91a3..0ebfecc1200 100644
--- a/src/gallium/drivers/panfrost/pan_mfbd.c
+++ b/src/gallium/drivers/panfrost/pan_mfbd.c
@@ -112,15 +112,15 @@ panfrost_mfbd_set_cbuf(
rt->framebuffer = rsrc->bo->gpu + offset;
rt->framebuffer_stride = stride;
} else if (rsrc->bo->layout == PAN_AFBC) {
- assert(level == 0);
- rt->afbc.metadata = rsrc->bo->afbc_slab.gpu;
- rt->afbc.stride = 0;
- rt->afbc.unk = 0x30009;
-
rt->format.block = MALI_MFBD_BLOCK_AFBC;
- mali_ptr afbc_main = rsrc->bo->afbc_slab.gpu + rsrc->bo->afbc_metadata_size;
- rt->framebuffer = afbc_main;
+ mali_ptr base = rsrc->bo->gpu + offset;
+ unsigned header_size = rsrc->bo->slices[level].header_size;
+
+ rt->framebuffer = base + header_size;
+ rt->afbc.metadata = base;
+ rt->afbc.stride = 0;
+ rt->afbc.unk = 0x30009;
/* TODO: Investigate shift */
rt->framebuffer_stride = stride << 1;
@@ -144,7 +144,9 @@ panfrost_mfbd_set_zsbuf(
unsigned offset = rsrc->bo->slices[level].offset;
if (rsrc->bo->layout == PAN_AFBC) {
- assert(level == 0);
+ mali_ptr base = rsrc->bo->gpu + offset;
+ unsigned header_size = rsrc->bo->slices[level].header_size;
+
fb->mfbd_flags |= MALI_MFBD_EXTRA;
fbx->flags =
@@ -154,11 +156,10 @@ panfrost_mfbd_set_zsbuf(
MALI_EXTRA_ZS |
0x1; /* unknown */
- fbx->ds_afbc.depth_stencil_afbc_metadata = rsrc->bo->afbc_slab.gpu;
+ fbx->ds_afbc.depth_stencil = base + header_size;
+ fbx->ds_afbc.depth_stencil_afbc_metadata = base;
fbx->ds_afbc.depth_stencil_afbc_stride = 0;
- fbx->ds_afbc.depth_stencil = rsrc->bo->afbc_slab.gpu + rsrc->bo->afbc_metadata_size;
-
fbx->ds_afbc.zero1 = 0x10009;
fbx->ds_afbc.padding = 0x1000;
} else if (rsrc->bo->layout == PAN_LINEAR) {