diff options
author | Eric Anholt <[email protected]> | 2018-01-22 09:14:25 +0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-02-02 16:50:02 -0800 |
commit | 2e746bc63d1ab56c6006f328c21a77dc69d0b9a8 (patch) | |
tree | abda559ab31fc18187638c4572b5f02535ff9948 /src/gallium/drivers/vc5/vc5_resource.c | |
parent | 6a862b0de711955902d4d58f1b0c6063e76207a6 (diff) |
broadcom/vc5: Enable UIF XOR on textures.
This should increase performance by reducing SDRAM bank conflicts when
crossing between UIF columns (particularly on power-of-two height
textures).
The uif_xor_disable setup is dropped, since we need to allow XOR on lower
miplevels even when level 0 is XOR. The level 0 force UIF and level 0 XOR
flags should handle setting XOR properly on imported buffers.
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_resource.c')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_resource.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc5/vc5_resource.c b/src/gallium/drivers/vc5/vc5_resource.c index 40697ce6de2..157eb1c1013 100644 --- a/src/gallium/drivers/vc5/vc5_resource.c +++ b/src/gallium/drivers/vc5/vc5_resource.c @@ -435,8 +435,6 @@ vc5_setup_slices(struct vc5_resource *rsc) level_width = align(level_width, 2 * uif_block_w); level_height = align(level_height, uif_block_h); } else { - slice->tiling = VC5_TILING_UIF_NO_XOR; - /* We align the width to a 4-block column of * UIF blocks, but we only align height to UIF * blocks. @@ -449,6 +447,19 @@ vc5_setup_slices(struct vc5_resource *rsc) slice->ub_pad = vc5_get_ub_pad(rsc, level_height); level_height += slice->ub_pad * uif_block_h; + + /* If the padding set us to to be aligned to + * the page cache size, then the HW will use + * the XOR bit on odd columns to get us + * perfectly misaligned + */ + if ((level_height / uif_block_h) % + (VC5_PAGE_CACHE_SIZE / + VC5_UIFBLOCK_ROW_SIZE) == 0) { + slice->tiling = VC5_TILING_UIF_XOR; + } else { + slice->tiling = VC5_TILING_UIF_NO_XOR; + } } } |