diff options
author | Wladimir J. van der Laan <[email protected]> | 2017-04-14 09:44:27 +0200 |
---|---|---|
committer | Christian Gmeiner <[email protected]> | 2017-04-15 00:34:13 +0200 |
commit | 6a8d5ab932e525f16e744b4f13c4f6a7fa636ecf (patch) | |
tree | c2dfeb758f82b9d9371dcd906f28a6652bcb49b2 /src/gallium/drivers/etnaviv/etnaviv_surface.c | |
parent | 1dcb1d49254dabd3989ad4ec5004b540683529b2 (diff) |
etnaviv: SINGLE_BUFFER support on GC3000
This patch adds support for the SINGLE_BUFFER feature on GC3000
GPUs, which allows rendering to a single buffer using multiple pixel
pipes.
This feature is always used when it is available, which means that
multi-tiled formats are no longer being used in that case, and all
buffers will be normal (super)tiled. This mimics the behavior of the
blob on GC3000.
- Because the same format can be used to render to and texture from,
this avoids an extra resolve pass when rendering to texture.
- i.MX6qp includes a PRE which can scan-out directly from tiled formats,
avoiding untiling overhead.
Signed-off-by: Wladimir J. van der Laan <[email protected]>
Reviewed-by: Christian Gmeiner <[email protected]>
Diffstat (limited to 'src/gallium/drivers/etnaviv/etnaviv_surface.c')
-rw-r--r-- | src/gallium/drivers/etnaviv/etnaviv_surface.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_surface.c b/src/gallium/drivers/etnaviv/etnaviv_surface.c index 7ac2862e12d..1db9b40a510 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_surface.c +++ b/src/gallium/drivers/etnaviv/etnaviv_surface.c @@ -91,12 +91,18 @@ etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc, struct etna_resource_level *lev = &rsc->levels[level]; /* Setup template relocations for this surface */ - surf->reloc[0].bo = rsc->bo; - surf->reloc[0].offset = surf->surf.offset; - surf->reloc[0].flags = 0; - surf->reloc[1].bo = rsc->bo; - surf->reloc[1].offset = surf->surf.offset + lev->stride * lev->padded_height / 2; - surf->reloc[1].flags = 0; + for (unsigned pipe = 0; pipe < ctx->specs.pixel_pipes; ++pipe) { + surf->reloc[pipe].bo = rsc->bo; + surf->reloc[pipe].offset = surf->surf.offset; + surf->reloc[pipe].flags = 0; + } + + /* In single buffer mode, both pixel pipes must point to the same address, + * for multi-tiled surfaces on the other hand the second pipe is expected to + * point halfway the image vertically. + */ + if (rsc->layout & ETNA_LAYOUT_BIT_MULTI) + surf->reloc[1].offset = surf->surf.offset + lev->stride * lev->padded_height / 2; if (surf->surf.ts_size) { unsigned int layer_offset = layer * surf->surf.ts_layer_stride; |