diff options
author | Eric Anholt <[email protected]> | 2019-11-21 14:53:58 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-12-11 04:24:18 +0000 |
commit | 97be9503bb1aba3017b1ff682e14f9a6c60d91a0 (patch) | |
tree | aa76661f95fd2e5d3beb93da3a3bec726819ae61 /src/gallium/drivers/freedreno | |
parent | 69d7782b155b72707d95a2f6b0c0776afbb888e3 (diff) |
freedreno: Drop the extra offset field for mipmap slices.
We can just bake the UBWC-goes-first delta into the slices at setup time.
I did have to fix up the resource shadowing swap path to swap the slice
fields, as it was missing and regressed the format reinterpets otherwise.
Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_resource.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_resource.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c index 4acb80f1508..8b5e79c4ae8 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_resource.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_resource.c @@ -262,8 +262,12 @@ fd6_fill_ubwc_buffer_sizes(struct fd_resource *rsc) * because it is what the kernel expects for scanout. For non-2D we * could just use a separate UBWC buffer.. */ + for (int level = 0; level <= prsc->last_level; level++) { + struct fdl_slice *slice = fd_resource_slice(rsc, level); + slice->offset += meta_size; + } + rsc->layout.ubwc_offset = 0; - rsc->layout.offset = meta_size; rsc->layout.ubwc_pitch = meta_stride; rsc->layout.ubwc_size = meta_size >> 2; /* in dwords??? */ rsc->layout.tile_mode = TILE6_3; diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index c17bd365f1a..3e74e0c5a00 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -223,7 +223,8 @@ fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc, /* TODO valid_buffer_range?? */ swap(rsc->bo, shadow->bo); swap(rsc->write_batch, shadow->write_batch); - swap(rsc->layout.offset, shadow->layout.offset); + for (int level = 0; level <= prsc->last_level; level++) + swap(rsc->layout.slices[level], shadow->layout.slices[level]); swap(rsc->layout.ubwc_offset, shadow->layout.ubwc_offset); swap(rsc->layout.ubwc_pitch, shadow->layout.ubwc_pitch); swap(rsc->layout.ubwc_size, shadow->layout.ubwc_size); |