freedreno/a6xx: Move fd6_ifmt into fd6_blitter.c
authorKristian H. Kristensen <hoegsberg@google.com>
Thu, 2 Jul 2020 10:05:12 +0000 (03:05 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Jul 2020 06:12:22 +0000 (06:12 +0000)
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
src/gallium/drivers/freedreno/a6xx/fd6_format.h

index e90807fc340d82b203f4a69e3f32e72cc12aa4ab..d2a47f02bbacdc0f33ef6cadc95529edbfe5dd3e 100644 (file)
 #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
index 331450eb768546249117c596d4914ad7290eeb3a..9163d412bb25654a2eca387e494c97185ff71c75 100644 (file)
@@ -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)
 {