diff --git a/src/gallium/drivers/vc4/Android.mk b/src/gallium/drivers/vc4/Android.mk index 8b19e520778..34b957aa9d8 100644 --- a/src/gallium/drivers/vc4/Android.mk +++ b/src/gallium/drivers/vc4/Android.mk @@ -28,6 +28,10 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := \ $(C_SOURCES) +ifeq ($(ARCH_ARM_HAVE_NEON),true) +LOCAL_SRC_FILES += $(NEON_C_SOURCES) +endif + LOCAL_GENERATED_SOURCES := $(MESA_GEN_NIR_H) LOCAL_C_INCLUDES := \ $(MESA_TOP)/include/drm-uapi diff --git a/src/gallium/drivers/vc4/Makefile.am b/src/gallium/drivers/vc4/Makefile.am index 576f9b3ad1d..46f3577b06e 100644 --- a/src/gallium/drivers/vc4/Makefile.am +++ b/src/gallium/drivers/vc4/Makefile.am @@ -39,6 +39,14 @@ noinst_LTLIBRARIES = libvc4.la libvc4_la_SOURCES = $(C_SOURCES) libvc4_la_LIBADD = $(SIM_LIB) + +if HAVE_ARM_ASM +noinst_LTLIBRARIES += libvc4_neon.la +libvc4_la_LIBADD += libvc4_neon.la +libvc4_neon_la_SOURCES = $(NEON_C_SOURCES) +libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -mfpu=neon +endif + libvc4_la_LDFLAGS = $(SIM_LDFLAGS) EXTRA_DIST = kernel/README diff --git a/src/gallium/drivers/vc4/Makefile.sources b/src/gallium/drivers/vc4/Makefile.sources index f67dffe0063..76dea7041b7 100644 --- a/src/gallium/drivers/vc4/Makefile.sources +++ b/src/gallium/drivers/vc4/Makefile.sources @@ -57,7 +57,8 @@ C_SOURCES := \ vc4_state.c \ vc4_tiling.c \ vc4_tiling_lt.c \ - vc4_tiling_lt_neon.c \ vc4_tiling.h \ vc4_uniforms.c \ $() + +NEON_C_SOURCES := vc4_tiling_lt_neon.c diff --git a/src/gallium/drivers/vc4/vc4_tiling.h b/src/gallium/drivers/vc4/vc4_tiling.h index 3168ec20a60..66767e7f1f8 100644 --- a/src/gallium/drivers/vc4/vc4_tiling.h +++ b/src/gallium/drivers/vc4/vc4_tiling.h @@ -89,13 +89,15 @@ vc4_load_lt_image(void *dst, uint32_t dst_stride, void *src, uint32_t src_stride, int cpp, const struct pipe_box *box) { +#ifdef USE_ARM_ASM if (util_cpu_caps.has_neon) { vc4_load_lt_image_neon(dst, dst_stride, src, src_stride, cpp, box); - } else { - vc4_load_lt_image_base(dst, dst_stride, src, src_stride, - cpp, box); + return; } +#endif + vc4_load_lt_image_base(dst, dst_stride, src, src_stride, + cpp, box); } static inline void @@ -103,13 +105,16 @@ vc4_store_lt_image(void *dst, uint32_t dst_stride, void *src, uint32_t src_stride, int cpp, const struct pipe_box *box) { +#ifdef USE_ARM_ASM if (util_cpu_caps.has_neon) { vc4_store_lt_image_neon(dst, dst_stride, src, src_stride, cpp, box); - } else { - vc4_store_lt_image_base(dst, dst_stride, src, src_stride, - cpp, box); + return; } +#endif + + vc4_store_lt_image_base(dst, dst_stride, src, src_stride, + cpp, box); } #endif /* VC4_TILING_H */