Mesa (master): etnaviv: move state based texture structs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 4 19:58:00 UTC 2020


Module: Mesa
Branch: master
Commit: 7c687d221d1dbe04d3ce9d4774505f57b143ddf6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c687d221d1dbe04d3ce9d4774505f57b143ddf6

Author: Christian Gmeiner <christian.gmeiner at gmail.com>
Date:   Fri Jan  3 09:11:08 2020 +0100

etnaviv: move state based texture structs

This moves the state based texture structs and their helpers
into the only user.

Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Reviewed-by: Jonathan Marek <jonathan at marek.ca>

---

 .../drivers/etnaviv/etnaviv_texture_state.c        | 42 +++++++++++++++++++
 .../drivers/etnaviv/etnaviv_texture_state.h        | 49 ----------------------
 2 files changed, 42 insertions(+), 49 deletions(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
index 6b112206b01..84d0e00be00 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_texture_state.c
@@ -39,6 +39,48 @@
 
 #include "drm-uapi/drm_fourcc.h"
 
+struct etna_sampler_state {
+   struct pipe_sampler_state base;
+
+   /* sampler offset +4*sampler, interleave when committing state */
+   uint32_t TE_SAMPLER_CONFIG0;
+   uint32_t TE_SAMPLER_CONFIG1;
+   uint32_t TE_SAMPLER_LOD_CONFIG;
+   uint32_t TE_SAMPLER_3D_CONFIG;
+   uint32_t NTE_SAMPLER_BASELOD;
+   unsigned min_lod, max_lod, max_lod_min;
+};
+
+static inline struct etna_sampler_state *
+etna_sampler_state(struct pipe_sampler_state *samp)
+{
+   return (struct etna_sampler_state *)samp;
+}
+
+struct etna_sampler_view {
+   struct pipe_sampler_view base;
+
+   /* sampler offset +4*sampler, interleave when committing state */
+   uint32_t TE_SAMPLER_CONFIG0;
+   uint32_t TE_SAMPLER_CONFIG0_MASK;
+   uint32_t TE_SAMPLER_CONFIG1;
+   uint32_t TE_SAMPLER_3D_CONFIG;
+   uint32_t TE_SAMPLER_SIZE;
+   uint32_t TE_SAMPLER_LOG_SIZE;
+   uint32_t TE_SAMPLER_ASTC0;
+   uint32_t TE_SAMPLER_LINEAR_STRIDE[VIVS_TE_SAMPLER_LINEAR_STRIDE__LEN];
+   struct etna_reloc TE_SAMPLER_LOD_ADDR[VIVS_TE_SAMPLER_LOD_ADDR__LEN];
+   unsigned min_lod, max_lod; /* 5.5 fixp */
+
+   struct etna_sampler_ts ts;
+};
+
+static inline struct etna_sampler_view *
+etna_sampler_view(struct pipe_sampler_view *view)
+{
+   return (struct etna_sampler_view *)view;
+}
+
 static void *
 etna_create_sampler_state_state(struct pipe_context *pipe,
                           const struct pipe_sampler_state *ss)
diff --git a/src/gallium/drivers/etnaviv/etnaviv_texture_state.h b/src/gallium/drivers/etnaviv/etnaviv_texture_state.h
index df40f12ca8f..359ae1928bd 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_texture_state.h
+++ b/src/gallium/drivers/etnaviv/etnaviv_texture_state.h
@@ -27,57 +27,8 @@
 #ifndef H_ETNAVIV_TEXTURE_PLAIN
 #define H_ETNAVIV_TEXTURE_PLAIN
 
-#include "drm/etnaviv_drmif.h"
-
 #include "etnaviv_texture.h"
 
-#include "pipe/p_context.h"
-#include "pipe/p_state.h"
-
-#include "hw/state_3d.xml.h"
-
-struct etna_sampler_state {
-   struct pipe_sampler_state base;
-
-   /* sampler offset +4*sampler, interleave when committing state */
-   uint32_t TE_SAMPLER_CONFIG0;
-   uint32_t TE_SAMPLER_CONFIG1;
-   uint32_t TE_SAMPLER_LOD_CONFIG;
-   uint32_t TE_SAMPLER_3D_CONFIG;
-   uint32_t NTE_SAMPLER_BASELOD;
-   unsigned min_lod, max_lod, max_lod_min;
-};
-
-static inline struct etna_sampler_state *
-etna_sampler_state(struct pipe_sampler_state *samp)
-{
-   return (struct etna_sampler_state *)samp;
-}
-
-struct etna_sampler_view {
-   struct pipe_sampler_view base;
-
-   /* sampler offset +4*sampler, interleave when committing state */
-   uint32_t TE_SAMPLER_CONFIG0;
-   uint32_t TE_SAMPLER_CONFIG0_MASK;
-   uint32_t TE_SAMPLER_CONFIG1;
-   uint32_t TE_SAMPLER_3D_CONFIG;
-   uint32_t TE_SAMPLER_SIZE;
-   uint32_t TE_SAMPLER_LOG_SIZE;
-   uint32_t TE_SAMPLER_ASTC0;
-   uint32_t TE_SAMPLER_LINEAR_STRIDE[VIVS_TE_SAMPLER_LINEAR_STRIDE__LEN];
-   struct etna_reloc TE_SAMPLER_LOD_ADDR[VIVS_TE_SAMPLER_LOD_ADDR__LEN];
-   unsigned min_lod, max_lod; /* 5.5 fixp */
-
-   struct etna_sampler_ts ts;
-};
-
-static inline struct etna_sampler_view *
-etna_sampler_view(struct pipe_sampler_view *view)
-{
-   return (struct etna_sampler_view *)view;
-}
-
 /* Initialize context for "plain" (non-descriptor, state-based) texture views
  * and descriptors */
 void




More information about the mesa-commit mailing list