Mesa (master): freedreno/a6xx: Move fd6_ifmt into fd6_blitter.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 14 06:27:38 UTC 2020


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

Author: Kristian H. Kristensen <hoegsberg at google.com>
Date:   Thu Jul  2 03:05:12 2020 -0700

freedreno/a6xx: Move fd6_ifmt into fd6_blitter.c

It's only used in this file.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5717>

---

 src/gallium/drivers/freedreno/a6xx/fd6_blitter.c | 68 ++++++++++++++++++++++++
 src/gallium/drivers/freedreno/a6xx/fd6_format.h  | 68 ------------------------
 2 files changed, 68 insertions(+), 68 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
index e90807fc340..d2a47f02bba 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
@@ -39,6 +39,74 @@
 #include "fd6_resource.h"
 #include "fd6_pack.h"
 
+static inline enum a6xx_2d_ifmt
+fd6_ifmt(enum a6xx_format fmt)
+{
+	switch (fmt) {
+	case FMT6_A8_UNORM:
+	case FMT6_8_UNORM:
+	case FMT6_8_SNORM:
+	case FMT6_8_8_UNORM:
+	case FMT6_8_8_SNORM:
+	case FMT6_8_8_8_8_UNORM:
+	case FMT6_8_8_8_X8_UNORM:
+	case FMT6_8_8_8_8_SNORM:
+	case FMT6_4_4_4_4_UNORM:
+	case FMT6_5_5_5_1_UNORM:
+	case FMT6_5_6_5_UNORM:
+		return R2D_UNORM8;
+
+	case FMT6_32_UINT:
+	case FMT6_32_SINT:
+	case FMT6_32_32_UINT:
+	case FMT6_32_32_SINT:
+	case FMT6_32_32_32_32_UINT:
+	case FMT6_32_32_32_32_SINT:
+		return R2D_INT32;
+
+	case FMT6_16_UINT:
+	case FMT6_16_SINT:
+	case FMT6_16_16_UINT:
+	case FMT6_16_16_SINT:
+	case FMT6_16_16_16_16_UINT:
+	case FMT6_16_16_16_16_SINT:
+	case FMT6_10_10_10_2_UINT:
+		return R2D_INT16;
+
+	case FMT6_8_UINT:
+	case FMT6_8_SINT:
+	case FMT6_8_8_UINT:
+	case FMT6_8_8_SINT:
+	case FMT6_8_8_8_8_UINT:
+	case FMT6_8_8_8_8_SINT:
+	case FMT6_Z24_UNORM_S8_UINT:
+	case FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8:
+		return R2D_INT8;
+
+	case FMT6_16_UNORM:
+	case FMT6_16_SNORM:
+	case FMT6_16_16_UNORM:
+	case FMT6_16_16_SNORM:
+	case FMT6_16_16_16_16_UNORM:
+	case FMT6_16_16_16_16_SNORM:
+	case FMT6_32_FLOAT:
+	case FMT6_32_32_FLOAT:
+	case FMT6_32_32_32_32_FLOAT:
+		return R2D_FLOAT32;
+
+	case FMT6_16_FLOAT:
+	case FMT6_16_16_FLOAT:
+	case FMT6_16_16_16_16_FLOAT:
+	case FMT6_11_11_10_FLOAT:
+	case FMT6_10_10_10_2_UNORM_DEST:
+		return R2D_FLOAT16;
+
+	default:
+		unreachable("bad format");
+		return 0;
+	}
+}
+
 /* Make sure none of the requested dimensions extend beyond the size of the
  * resource.  Not entirely sure why this happens, but sometimes it does, and
  * w/ 2d blt doesn't have wrap modes like a sampler, so force those cases
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_format.h b/src/gallium/drivers/freedreno/a6xx/fd6_format.h
index 331450eb768..9163d412bb2 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_format.h
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_format.h
@@ -49,74 +49,6 @@ uint32_t fd6_tex_const_0(struct pipe_resource *prsc,
 					  unsigned swizzle_r, unsigned swizzle_g,
 					  unsigned swizzle_b, unsigned swizzle_a);
 
-static inline enum a6xx_2d_ifmt
-fd6_ifmt(enum a6xx_format fmt)
-{
-	switch (fmt) {
-	case FMT6_A8_UNORM:
-	case FMT6_8_UNORM:
-	case FMT6_8_SNORM:
-	case FMT6_8_8_UNORM:
-	case FMT6_8_8_SNORM:
-	case FMT6_8_8_8_8_UNORM:
-	case FMT6_8_8_8_X8_UNORM:
-	case FMT6_8_8_8_8_SNORM:
-	case FMT6_4_4_4_4_UNORM:
-	case FMT6_5_5_5_1_UNORM:
-	case FMT6_5_6_5_UNORM:
-		return R2D_UNORM8;
-
-	case FMT6_32_UINT:
-	case FMT6_32_SINT:
-	case FMT6_32_32_UINT:
-	case FMT6_32_32_SINT:
-	case FMT6_32_32_32_32_UINT:
-	case FMT6_32_32_32_32_SINT:
-		return R2D_INT32;
-
-	case FMT6_16_UINT:
-	case FMT6_16_SINT:
-	case FMT6_16_16_UINT:
-	case FMT6_16_16_SINT:
-	case FMT6_16_16_16_16_UINT:
-	case FMT6_16_16_16_16_SINT:
-	case FMT6_10_10_10_2_UINT:
-		return R2D_INT16;
-
-	case FMT6_8_UINT:
-	case FMT6_8_SINT:
-	case FMT6_8_8_UINT:
-	case FMT6_8_8_SINT:
-	case FMT6_8_8_8_8_UINT:
-	case FMT6_8_8_8_8_SINT:
-	case FMT6_Z24_UNORM_S8_UINT:
-	case FMT6_Z24_UNORM_S8_UINT_AS_R8G8B8A8:
-		return R2D_INT8;
-
-	case FMT6_16_UNORM:
-	case FMT6_16_SNORM:
-	case FMT6_16_16_UNORM:
-	case FMT6_16_16_SNORM:
-	case FMT6_16_16_16_16_UNORM:
-	case FMT6_16_16_16_16_SNORM:
-	case FMT6_32_FLOAT:
-	case FMT6_32_32_FLOAT:
-	case FMT6_32_32_32_32_FLOAT:
-		return R2D_FLOAT32;
-
-	case FMT6_16_FLOAT:
-	case FMT6_16_16_FLOAT:
-	case FMT6_16_16_16_16_FLOAT:
-	case FMT6_11_11_10_FLOAT:
-	case FMT6_10_10_10_2_UNORM_DEST:
-		return R2D_FLOAT16;
-
-	default:
-		unreachable("bad format");
-		return 0;
-	}
-}
-
 static inline uint32_t
 fd6_resource_swap(struct fd_resource *rsc, enum pipe_format format)
 {



More information about the mesa-commit mailing list