diff options
author | Wladimir J. van der Laan <[email protected]> | 2017-09-30 10:11:32 +0200 |
---|---|---|
committer | Lucas Stach <[email protected]> | 2017-10-12 16:03:26 +0200 |
commit | 78ade659569ee6fe9bd244170956139f19dd8c6c (patch) | |
tree | ffcba1f85f30fc623932ef2105c427056931a3ec /src/gallium/drivers/etnaviv/etnaviv_rs.c | |
parent | 3ba5a467a56c296490e641548cbb140de0083d03 (diff) |
etnaviv: Do GC3000 resolve-in-place when possible
If an RS blit is done with source exactly the same as destination, and
the hardware supports this, do an in-place resolve. This only fills in
tiles that have not been rendered to using information from the TS.
This is the same as the blob does and potentially saves significant
bandwidth when doing i.MX6qp scanout using PRE, and when rendering to
textures (though here using sampler TS would be even better).
Signed-off-by: Wladimir J. van der Laan <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_rs.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_rs.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_rs.c b/src/gallium/drivers/etnaviv/etnaviv_rs.c index 5c108a6c7a2..c9072c2645e 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_rs.c +++ b/src/gallium/drivers/etnaviv/etnaviv_rs.c @@ -118,10 +118,21 @@ etna_compile_rs_state(struct etna_context *ctx, struct compiled_rs_state *cs, cs->RS_FILL_VALUE[3] = rs->clear_value[3]; cs->RS_EXTRA_CONFIG = VIVS_RS_EXTRA_CONFIG_AA(rs->aa) | VIVS_RS_EXTRA_CONFIG_ENDIAN(rs->endian_mode); - /* TODO: cs->RS_UNK016B0 = s->size / 64 ? - * The blob does this consistently but there seems to be no currently supported - * model that needs it. + + /* If source the same as destination, and the hardware supports this, + * do an in-place resolve to fill in unrendered tiles. */ + if (ctx->specs.single_buffer && rs->source == rs->dest && + rs->source_offset == rs->dest_offset && + rs->source_format == rs->dest_format && + rs->source_tiling == rs->dest_tiling && + rs->source_stride == rs->dest_stride && + !rs->downsample_x && !rs->downsample_y && + !rs->swap_rb && !rs->flip && + !rs->clear_mode && rs->source_padded_width) { + /* Total number of tiles (same as for autodisable) */ + cs->RS_KICKER_INPLACE = rs->source_padded_width * rs->source_padded_height / 16; + } } void |