[PATCH 3/4] etnaviv: enable TS also on sampler resources
Lucas Stach
l.stach at pengutronix.de
Wed Apr 12 10:17:30 UTC 2017
Hi Wladimir,
Am Dienstag, den 11.04.2017, 19:18 +0200 schrieb Wladimir J. van der
Laan:
> On Tue, Nov 22, 2016 at 11:41:49AM +0100, Lucas Stach wrote:
> > This might require a TS flush on single pipe chips that directly
> > sample from the rendered buffer, but otherwise seems to work fine.
>
> I'm working on a gc3000 patch that will introduce single_buffer support,
> which allows directly sampling from rendered buffers, so this is not just an
> issue for old single pipe chips.
>
> So I'm not against this change, but it does complicate what I'm doing now.
>
> This is closer to the blob's behavior though which IIRC does this too.
> However what it does is tell the texture units about TSes as well, that would
> be the best solution eventually...
Shortly after I pushed those patches we hit the same issue with Wayland,
where we share the tiled render buffer with the compositor to sample
from. The solution we are currently implementing is to do a resolve to
self on resource flush. This should fix both the Wayland issue, as well
as your texturing from single buffer.
Patch for this will follow shortly.
I agree that not doing the resolve on texture usage, but telling the
sampler about the TS buffer will provide better performance, but this
optimization can be added later. For now we'll make sure that things
work correct.
Regards,
Lucas
> Wladimir
>
> >
> > Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> > ---
> > src/gallium/drivers/etnaviv/etnaviv_surface.c | 3 ---
> > 1 file changed, 3 deletions(-)
> >
> > diff --git a/src/gallium/drivers/etnaviv/etnaviv_surface.c b/src/gallium/drivers/etnaviv/etnaviv_surface.c
> > index db4846aa060d..7ac2862e12d9 100644
> > --- a/src/gallium/drivers/etnaviv/etnaviv_surface.c
> > +++ b/src/gallium/drivers/etnaviv/etnaviv_surface.c
> > @@ -64,12 +64,9 @@ etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc,
> > * indicate the tile status module bypasses the memory
> > * offset and MMU. */
> >
> > - /* XXX for now, don't do TS for render textures as this path
> > - * is not stable. */
> > if (VIV_FEATURE(ctx->screen, chipFeatures, FAST_CLEAR) &&
> > VIV_FEATURE(ctx->screen, chipMinorFeatures0, MC20) &&
> > !DBG_ENABLED(ETNA_DBG_NO_TS) && !rsc->ts_bo &&
> > - !(rsc->base.bind & (PIPE_BIND_SAMPLER_VIEW)) &&
> > (rsc->levels[level].padded_width & ETNA_RS_WIDTH_MASK) == 0 &&
> > (rsc->levels[level].padded_height & ETNA_RS_HEIGHT_MASK) == 0) {
> > etna_screen_resource_alloc_ts(pctx->screen, rsc);
> > --
> > 2.10.2
> >
> > _______________________________________________
> > etnaviv mailing list
> > etnaviv at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/etnaviv
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv
More information about the etnaviv
mailing list