diff options
author | Jonathan Marek <[email protected]> | 2019-07-01 18:41:20 -0400 |
---|---|---|
committer | Jonathan Marek <[email protected]> | 2019-07-04 14:05:18 -0400 |
commit | 5feb8adb0fa472aaeb7f7c5a75f0de5ac71a4ae7 (patch) | |
tree | 647a6a0b57f74fb5180a70a56a1932e9f508cbc0 /src/gallium/drivers/etnaviv/etnaviv_texture.c | |
parent | f6a0d17abe854999b1ab984b4e94263b16ee0bc0 (diff) |
etnaviv: implement buffer compression
Vivante GPUs have lossless buffer compression using the tile-status bits,
which can reduce memory access and thus improve performance.
This patch only enables compression for "V4" compression GPUs, but the
implementation is tested on GC2000(V1) and GC3000(V2). V1/V2 compresssion
looks absolutely useless, so it is not enabled.
I couldn't test if this patch breaks MSAA, because it looks like MSAA is
already broken.
Signed-off-by: Jonathan Marek <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_texture.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_texture.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture.c b/src/gallium/drivers/etnaviv/etnaviv_texture.c index 9bf63ec34c4..59a0d122d59 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_texture.c +++ b/src/gallium/drivers/etnaviv/etnaviv_texture.c @@ -86,7 +86,8 @@ etna_configure_sampler_ts(struct etna_sampler_ts *sts, struct pipe_sampler_view sts->mode = lev->ts_mode; sts->TS_SAMPLER_CONFIG = VIVS_TS_SAMPLER_CONFIG_ENABLE | - VIVS_TS_SAMPLER_CONFIG_COMPRESSION_FORMAT(translate_ts_format(rsc->base.format)); + COND(lev->ts_compress_fmt >= 0, VIVS_TS_SAMPLER_CONFIG_COMPRESSION) | + VIVS_TS_SAMPLER_CONFIG_COMPRESSION_FORMAT(lev->ts_compress_fmt); sts->TS_SAMPLER_CLEAR_VALUE = lev->clear_value; sts->TS_SAMPLER_CLEAR_VALUE2 = lev->clear_value; /* To handle 64-bit formats this needs a different value */ sts->TS_SAMPLER_STATUS_BASE.bo = rsc->ts_bo; @@ -123,7 +124,7 @@ etna_can_use_sampler_ts(struct pipe_sampler_view *view, int num) return VIV_FEATURE(screen, chipMinorFeatures2, TEXTURE_TILED_READ) && num < VIVS_TS_SAMPLER__LEN && rsc->base.target != PIPE_BUFFER && - translate_ts_format(rsc->base.format) != ETNA_NO_MATCH && + (rsc->levels[0].ts_compress_fmt < 0 || screen->specs.v4_compression) && view->u.tex.first_level == 0 && MIN2(view->u.tex.last_level, rsc->base.last_level) == 0 && rsc->levels[0].ts_valid; } |