From a373f77662c557662a675139ea6121b05c1f2b72 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 13 Apr 2017 15:09:16 -0700 Subject: [PATCH] vc4: Use a wrapper file to set VC4_BUILD_NEON instead of CFLAGS. 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 --- src/gallium/drivers/vc4/Android.mk | 2 -- src/gallium/drivers/vc4/Makefile.am | 6 ---- src/gallium/drivers/vc4/Makefile.sources | 1 + src/gallium/drivers/vc4/vc4_tiling_lt_neon.c | 30 ++++++++++++++++++++ 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 src/gallium/drivers/vc4/vc4_tiling_lt_neon.c diff --git a/src/gallium/drivers/vc4/Android.mk b/src/gallium/drivers/vc4/Android.mk index fdc06744e5a..de9d5e3f5b3 100644 --- a/src/gallium/drivers/vc4/Android.mk +++ b/src/gallium/drivers/vc4/Android.mk @@ -25,8 +25,6 @@ include $(LOCAL_PATH)/Makefile.sources include $(CLEAR_VARS) -LOCAL_CFLAGS_arm := -DVC4_BUILD_NEON - LOCAL_SRC_FILES := \ $(C_SOURCES) diff --git a/src/gallium/drivers/vc4/Makefile.am b/src/gallium/drivers/vc4/Makefile.am index b361a0c588a..0ed49b128b2 100644 --- a/src/gallium/drivers/vc4/Makefile.am +++ b/src/gallium/drivers/vc4/Makefile.am @@ -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 diff --git a/src/gallium/drivers/vc4/Makefile.sources b/src/gallium/drivers/vc4/Makefile.sources index 10de3436126..442d7a56178 100644 --- a/src/gallium/drivers/vc4/Makefile.sources +++ b/src/gallium/drivers/vc4/Makefile.sources @@ -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 index 00000000000..7ba66ae4cdf --- /dev/null +++ b/src/gallium/drivers/vc4/vc4_tiling_lt_neon.c @@ -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" -- 2.30.2