[PATCH 4/4] etnaviv: hook up linear texture sampling support

Christian Gmeiner christian.gmeiner at gmail.com
Mon Jan 28 09:26:11 UTC 2019


Hi Lucas,

Am Fr., 25. Jan. 2019 um 17:02 Uhr schrieb Lucas Stach <l.stach at pengutronix.de>:
>
> Hi Christian,
>
> Am Montag, den 21.01.2019, 07:50 +0100 schrieb Christian Gmeiner:
> > If the GPU supports linear sampling, linear addressing mode
> > will be used as default.
> >
> > > Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> > ---
> >  src/gallium/drivers/etnaviv/etnaviv_resource.c | 10 +++++++---
> >  src/gallium/drivers/etnaviv/etnaviv_texture.c  |  4 +++-
> >  2 files changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> > index 9a7ebf3064e..7d24b1f03bd 100644
> > --- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
> > +++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
> > @@ -318,9 +318,9 @@ etna_resource_create(struct pipe_screen *pscreen,
> >  {
> >     struct etna_screen *screen = etna_screen(pscreen);
> >
> > -   /* Figure out what tiling and address mode to use -- for now, assume that
> > -    * texture cannot be linear. there is a capability LINEAR_TEXTURE_SUPPORT
> > -    * (supported on gc880 and gc2000 at least), but not sure how it works.
> > +   /* Figure out what tiling and address mode to use.
> > +    * Textures are TILED or LINEAR. If LINEAR_TEXTURE_SUPPORT capability is
> > +    * available LINEAR gets prefered.
> >      * Buffers always have LINEAR layout.
> >      */
> >     unsigned layout = ETNA_LAYOUT_LINEAR;
> > @@ -334,6 +334,10 @@ etna_resource_create(struct pipe_screen *pscreen,
> >
> >        if (util_format_is_compressed(templat->format))
> >           layout = ETNA_LAYOUT_LINEAR;
> > +      else if (VIV_FEATURE(screen, chipMinorFeatures1, LINEAR_TEXTURE_SUPPORT)) {
> > +         layout = ETNA_LAYOUT_LINEAR;
> > +         mode = ETNA_ADDRESSING_MODE_LINEAR;
> > +      }
> >     } else if (templat->target != PIPE_BUFFER) {
> >        bool want_multitiled = false;
> >        bool want_supertiled = screen->specs.can_supertile;
> > diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture.c b/src/gallium/drivers/etnaviv/etnaviv_texture.c
> > index 3993e31cec1..b06f20531fd 100644
> > --- a/src/gallium/drivers/etnaviv/etnaviv_texture.c
> > +++ b/src/gallium/drivers/etnaviv/etnaviv_texture.c
> > @@ -172,7 +172,9 @@ etna_resource_sampler_compatible(struct etna_resource *res)
> >     if (res->layout == ETNA_LAYOUT_SUPER_TILED && VIV_FEATURE(screen, chipMinorFeatures2, SUPERTILED_TEXTURE))
> >        return true;
> >
> > -   /* TODO: LINEAR_TEXTURE_SUPPORT */
> > +   /* This GPU supports texturing from linear textures? */
> > +   if (res->layout == ETNA_LAYOUT_LINEAR && VIV_FEATURE(screen, chipMinorFeatures1, LINEAR_TEXTURE_SUPPORT))
> > +      return true;
>
> In order to avoid this sitting on the ML for too long while mostly
> looking good: how would you feel about squashing this last hunk into
> the previous patch and dropping the other parts of this patch for now?
>

Great idea.

> This way we could have most of the stuff in master and do further
> experiments about the performance implications later on. If you want to
> do this, patches 1-3 are:
>
> Reviewed-by: Lucas Stach <l.stach at pengutronix.de>
>

Pushed.

-- 
Thanks
--
Christian Gmeiner, MSc

https://christian-gmeiner.info


More information about the etnaviv mailing list