vc4: Use a wrapper file to set VC4_BUILD_NEON instead of CFLAGS.
authorEric Anholt <eric@anholt.net>
Thu, 13 Apr 2017 22:09:16 +0000 (15:09 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 2 May 2017 20:35:23 +0000 (13:35 -0700)
Android.mk was setting the flag across the entire driver, so we didn't
have non-NEON versions getting built.  This was going to be a problem with
the next commit, when I start auto-detecting NEON support and use the
non-NEON version when appropriate.

Reviewed-by: Rob Herring <robh@kernel.org>
src/gallium/drivers/vc4/Android.mk
src/gallium/drivers/vc4/Makefile.am
src/gallium/drivers/vc4/Makefile.sources
src/gallium/drivers/vc4/vc4_tiling_lt_neon.c [new file with mode: 0644]

index fdc06744e5abda49e905474089dceb0f5fc349ec..de9d5e3f5b3c534d3ec3a39b4a4b35b701c7678e 100644 (file)
@@ -25,8 +25,6 @@ include $(LOCAL_PATH)/Makefile.sources
 
 include $(CLEAR_VARS)
 
-LOCAL_CFLAGS_arm := -DVC4_BUILD_NEON
-
 LOCAL_SRC_FILES := \
        $(C_SOURCES)
 
index b361a0c588a8d8bcc7c3063c7b2d6bdcf4fcad54..0ed49b128b2dbc54c43f1752d4ebdac23ae25cf7 100644 (file)
@@ -41,10 +41,4 @@ libvc4_la_SOURCES = $(C_SOURCES)
 libvc4_la_LIBADD = $(SIM_LIB) $(VC4_LIBS)
 libvc4_la_LDFLAGS = $(SIM_LDFLAGS)
 
-noinst_LTLIBRARIES += libvc4_neon.la
-libvc4_la_LIBADD += libvc4_neon.la
-
-libvc4_neon_la_SOURCES = vc4_tiling_lt.c
-libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -DVC4_BUILD_NEON
-
 EXTRA_DIST = kernel/README
index 10de343612603915f3c8937a48337a5e9c2692fb..442d7a5617826c553c95a35ec8c015ac47a09380 100644 (file)
@@ -56,6 +56,7 @@ C_SOURCES := \
        vc4_state.c \
        vc4_tiling.c \
        vc4_tiling_lt.c \
+       vc4_tiling_lt_neon.c \
        vc4_tiling.h \
        vc4_uniforms.c \
        $()
diff --git a/src/gallium/drivers/vc4/vc4_tiling_lt_neon.c b/src/gallium/drivers/vc4/vc4_tiling_lt_neon.c
new file mode 100644 (file)
index 0000000..7ba66ae
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2017 Broadcom
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/* Wrapper file for building vc4_tiling_lt.c with the "build NEON assembly if
+ * possible" flag set, since Android.mk doesn't have a way to set CFLAGS for a
+ * single file.
+ */
+
+#define VC4_BUILD_NEON
+#include "vc4_tiling_lt.c"