summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/etnaviv/etnaviv_resource.c
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-07-01 16:16:54 -0400
committerJonathan Marek <[email protected]>2019-07-04 14:05:18 -0400
commit95d937852e63c1bd9ce35315df781d21182db7d7 (patch)
treec7e3950e7a8bfa25b296e529c34ffb8473ff6b8a /src/gallium/drivers/etnaviv/etnaviv_resource.c
parentbc5ae6a330102a1ae4ef573539f79393e64bb2c0 (diff)
etnaviv: implement TS_MODE for GC7000L
GC7000L has a TS mode with larger tiles, which improves performance. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_resource.c')
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_resource.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index 6607e792f46..3cf45b6c803 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -85,11 +85,21 @@ etna_screen_resource_alloc_ts(struct pipe_screen *pscreen,
{
struct etna_screen *screen = etna_screen(pscreen);
size_t rt_ts_size, ts_layer_stride;
+ size_t ts_bits_per_tile, bytes_per_tile;
+ uint8_t ts_mode = TS_MODE_128B; /* only used by halti5 */
assert(!rsc->ts_bo);
+ if (screen->specs.halti >= 5) {
+ ts_bits_per_tile = 4;
+ bytes_per_tile = ts_mode == TS_MODE_256B ? 256 : 128;
+ } else {
+ ts_bits_per_tile = screen->specs.bits_per_tile;
+ bytes_per_tile = 64;
+ }
+
ts_layer_stride = align(DIV_ROUND_UP(rsc->levels[0].layer_stride,
- 64 * 8 / screen->specs.bits_per_tile),
+ bytes_per_tile * 8 / ts_bits_per_tile),
0x100 * screen->specs.pixel_pipes);
rt_ts_size = ts_layer_stride * rsc->base.array_size;
if (rt_ts_size == 0)
@@ -110,6 +120,7 @@ etna_screen_resource_alloc_ts(struct pipe_screen *pscreen,
rsc->levels[0].ts_offset = 0;
rsc->levels[0].ts_layer_stride = ts_layer_stride;
rsc->levels[0].ts_size = rt_ts_size;
+ rsc->levels[0].ts_mode = ts_mode;
/* It is important to initialize the TS, as random pattern
* can result in crashes. Do this on the CPU as this only happens once