diff options
-rw-r--r-- | src/freedreno/fdl/fd6_layout.c | 33 | ||||
-rw-r--r-- | src/freedreno/fdl/freedreno_layout.h | 1 |
2 files changed, 21 insertions, 13 deletions
diff --git a/src/freedreno/fdl/fd6_layout.c b/src/freedreno/fdl/fd6_layout.c index 661d7574e8b..62700ad61b6 100644 --- a/src/freedreno/fdl/fd6_layout.c +++ b/src/freedreno/fdl/fd6_layout.c @@ -36,26 +36,27 @@ * missing 96/128 CPP for 8x MSAA with 32_32_32/32_32_32_32 */ static const struct { + unsigned basealign; unsigned pitchalign; unsigned heightalign; uint8_t ubwc_blockwidth; uint8_t ubwc_blockheight; } tile_alignment[] = { - [1] = { 128, 32, 16, 4 }, - [2] = { 128, 16, 16, 4 }, - [3] = { 64, 32 }, - [4] = { 64, 16, 16, 4 }, - [6] = { 64, 16 }, - [8] = { 64, 16, 8, 4, }, - [12] = { 64, 16 }, - [16] = { 64, 16, 4, 4, }, - [24] = { 64, 16 }, - [32] = { 64, 16, 4, 2 }, - [48] = { 64, 16 }, - [64] = { 64, 16 }, + [1] = { 64, 128, 32, 16, 4 }, + [2] = { 128, 128, 16, 16, 4 }, + [3] = { 256, 64, 32 }, + [4] = { 256, 64, 16, 16, 4 }, + [6] = { 256, 64, 16 }, + [8] = { 256, 64, 16, 8, 4, }, + [12] = { 256, 64, 16 }, + [16] = { 256, 64, 16, 4, 4, }, + [24] = { 256, 64, 16 }, + [32] = { 256, 64, 16, 4, 2 }, + [48] = { 256, 64, 16 }, + [64] = { 256, 64, 16 }, /* special cases for r8g8: */ - [0] = { 64, 32, 16, 4 }, + [0] = { 256, 64, 32, 16, 4 }, }; #define RGB_TILE_WIDTH_ALIGNMENT 64 @@ -117,6 +118,12 @@ fdl6_layout(struct fdl_layout *layout, debug_assert(ta < ARRAY_SIZE(tile_alignment)); debug_assert(tile_alignment[ta].pitchalign); + if (layout->tile_mode) { + layout->base_align = tile_alignment[ta].basealign; + } else { + layout->base_align = 64; + } + for (uint32_t level = 0; level < mip_levels; level++) { struct fdl_slice *slice = &layout->slices[level]; struct fdl_slice *ubwc_slice = &layout->ubwc_slices[level]; diff --git a/src/freedreno/fdl/freedreno_layout.h b/src/freedreno/fdl/freedreno_layout.h index f20a3056c2c..e9bc3bdb371 100644 --- a/src/freedreno/fdl/freedreno_layout.h +++ b/src/freedreno/fdl/freedreno_layout.h @@ -114,6 +114,7 @@ struct fdl_layout { enum pipe_format format; uint32_t size; /* Size of the whole image, in bytes. */ + uint32_t base_align; /* Alignment of the base address, in bytes. */ }; static inline uint32_t |