[PATCH 06/11] etnaviv: also update textures from external resources
Lucas Stach
l.stach at pengutronix.de
Wed Jun 28 14:14:45 UTC 2017
Am Mittwoch, den 28.06.2017, 16:10 +0200 schrieb Lucas Stach:
> Am Mittwoch, den 28.06.2017, 16:07 +0200 schrieb Wladimir J. van der
> Laan:
> > On Fri, Jun 23, 2017 at 05:50:23PM +0200, Lucas Stach wrote:
> > > This reworks the logic in etna_update_sampler_source to select the
> > > newest resource view for updating the texture view. This should make
> > > the logic easier to follow and fixes texture updates from imported
> > > dma-bufs.
> >
> > Comment in-line
> >
> > > Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> > > ---
> > > src/gallium/drivers/etnaviv/etnaviv_texture.c | 23 +++++++++++++++--------
> > > 1 file changed, 15 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture.c b/src/gallium/drivers/etnaviv/etnaviv_texture.c
> > > index df77829078c0..b7e424f89bba 100644
> > > --- a/src/gallium/drivers/etnaviv/etnaviv_texture.c
> > > +++ b/src/gallium/drivers/etnaviv/etnaviv_texture.c
> > > @@ -113,16 +113,23 @@ etna_delete_sampler_state(struct pipe_context *pctx, void *ss)
> > > static void
> > > etna_update_sampler_source(struct pipe_sampler_view *view)
> > > {
> > > + struct etna_resource *base = etna_resource(view->texture);
> > > + struct etna_resource *to = base, *from = base;
> > >
> > > + if (base->external && etna_resource_newer(etna_resource(base->external), base))
> > > + from = etna_resource(base->external);
> > > +
> > > + if (base->texture)
> > > + to = etna_resource(base->texture);
> > > +
> > > + if ((to != from) && etna_resource_older(to, from)) {
> > > + etna_copy_resource(view->context, &to->base, &from->base, 0,
> > > + view->texture->last_level);
> > > + to->seqno = from->seqno;
> > > + } else if ((to == from) && etna_resource_needs_flush(to)) {
> > > + etna_copy_resource(view->context, &to->base, &from->base, 0,
> >
> > Why do this copy if to==from?
>
> Tile-status resolve. We currently don't support sampler TS (which is
> probably worth implementing, as it has potentially large performance
> gains for the render to texture cases).
Addendum: etna_resource_needs_flush() returns false for sampler only
resources, which don't have TS allocated, so we aren't doing the resolve
unnecessarily.
Regards,
Lucas
More information about the etnaviv
mailing list