[Mesa-dev] [PATCH 17/19] etnaviv: GC7000: Move active_samplers_bits to texture

Christian Gmeiner christian.gmeiner at gmail.com
Sun Nov 5 15:26:27 UTC 2017


2017-10-30 17:17 GMT+01:00 Wladimir J. van der Laan <laanwj at gmail.com>:
> This needs to be shared between texture_plain and texture_desc.
>
> Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>

Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

> ---
>  src/gallium/drivers/etnaviv/etnaviv_emit.c    | 12 ------------
>  src/gallium/drivers/etnaviv/etnaviv_texture.c |  6 ++++++
>  src/gallium/drivers/etnaviv/etnaviv_texture.h | 11 +++++++++++
>  3 files changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c
> index 0990a37..bc0f567 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c
> @@ -249,18 +249,6 @@ etna_submit_rs_state(struct etna_context *ctx,
>     }
>  }
>
> -/* Create bit field that specifies which samplers are active and thus need to be
> - * programmed
> - * 32 bits is enough for 32 samplers. As far as I know this is the upper bound
> - * supported on any Vivante hw
> - * up to GC4000.
> - */
> -static uint32_t
> -active_samplers_bits(struct etna_context *ctx)
> -{
> -   return ctx->active_sampler_views & ctx->active_samplers;
> -}
> -
>  #define ETNA_3D_CONTEXT_SIZE  (400) /* keep this number above "Total state updates (fixed)" from gen_weave_state tool */
>
>  static unsigned
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture.c b/src/gallium/drivers/etnaviv/etnaviv_texture.c
> index 55942a9..d3fa109 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_texture.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_texture.c
> @@ -363,6 +363,12 @@ etna_texture_barrier(struct pipe_context *pctx, unsigned flags)
>     etna_set_state(ctx->stream, VIVS_GL_FLUSH_CACHE, VIVS_GL_FLUSH_CACHE_COLOR | VIVS_GL_FLUSH_CACHE_TEXTURE);
>  }
>
> +uint32_t
> +active_samplers_bits(struct etna_context *ctx)
> +{
> +   return ctx->active_sampler_views & ctx->active_samplers;
> +}
> +
>  void
>  etna_texture_init(struct pipe_context *pctx)
>  {
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture.h b/src/gallium/drivers/etnaviv/etnaviv_texture.h
> index 9d1789e..cc741a0 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_texture.h
> +++ b/src/gallium/drivers/etnaviv/etnaviv_texture.h
> @@ -34,6 +34,8 @@
>
>  #include "hw/state_3d.xml.h"
>
> +struct etna_context;
> +
>  struct etna_sampler_state {
>     struct pipe_sampler_state base;
>
> @@ -77,4 +79,13 @@ etna_texture_init(struct pipe_context *pctx);
>  struct etna_resource *
>  etna_texture_handle_incompatible(struct pipe_context *pctx, struct pipe_resource *prsc);
>
> +/* Create bit field that specifies which samplers are active and thus need to be
> + * programmed
> + * 32 bits is enough for 32 samplers. As far as I know this is the upper bound
> + * supported on any Vivante hw
> + * up to GC4000.
> + */
> +uint32_t
> +active_samplers_bits(struct etna_context *ctx);
> +
>  #endif
> --
> 2.7.4
>



-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info


More information about the mesa-dev mailing list