From f140467b5b43bc30046aa57247897e68ae13707a Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Tue, 22 Oct 2019 19:31:52 +0200 Subject: android: Add panfrost support to build scripts Currently the Android build system doesn't expose the panfrost driver. This patch enables the panfrost driver to be build on for the Android platform. Signed-off-by: Robert Foss Reviewed-By: Rohan Garg Reviewed-by: Alyssa Rosenzweig --- src/panfrost/Android.bifrost.mk | 50 ++++++++++++++++++++++++++++++++ src/panfrost/Android.encoder.mk | 42 +++++++++++++++++++++++++++ src/panfrost/Android.midgard.mk | 61 +++++++++++++++++++++++++++++++++++++++ src/panfrost/Android.mk | 4 +++ src/panfrost/Android.pandecode.mk | 44 ++++++++++++++++++++++++++++ src/panfrost/Android.shared.mk | 2 +- src/panfrost/Makefile.sources | 56 +++++++++++++++++++++++++++++++++++ 7 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 src/panfrost/Android.bifrost.mk create mode 100644 src/panfrost/Android.encoder.mk create mode 100644 src/panfrost/Android.midgard.mk create mode 100644 src/panfrost/Android.pandecode.mk (limited to 'src/panfrost') diff --git a/src/panfrost/Android.bifrost.mk b/src/panfrost/Android.bifrost.mk new file mode 100644 index 00000000000..d30ddfadf40 --- /dev/null +++ b/src/panfrost/Android.bifrost.mk @@ -0,0 +1,50 @@ +# Copyright © 2019 Collabora Ltd. +# +# 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 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. + +include $(CLEAR_VARS) + +LOCAL_MODULE := libpanfrost_bifrost + +LOCAL_SRC_FILES := \ + $(bifrost_FILES) + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/include \ + $(MESA_TOP)/src/compiler/nir/ \ + $(MESA_TOP)/src/gallium/auxiliary/ \ + $(MESA_TOP)/src/gallium/include/ \ + $(MESA_TOP)/src/mapi/ \ + $(MESA_TOP)/src/mesa/ \ + $(MESA_TOP)/src/panfrost/bifrost/ \ + $(MESA_TOP)/src/panfrost/include/ + +LOCAL_STATIC_LIBRARIES := \ + libmesa_glsl \ + libmesa_nir \ + libmesa_st_mesa + +LOCAL_GENERATED_SOURCES := \ + $(MESA_GEN_GLSL_H) + +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(MESA_TOP)/src/panfrost/bifrost/ \ + +include $(MESA_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/src/panfrost/Android.encoder.mk b/src/panfrost/Android.encoder.mk new file mode 100644 index 00000000000..d913f45b177 --- /dev/null +++ b/src/panfrost/Android.encoder.mk @@ -0,0 +1,42 @@ +# Copyright © 2019 Collabora Ltd. +# +# 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 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. + +include $(CLEAR_VARS) + +LOCAL_MODULE := libpanfrost_encoder + +LOCAL_SRC_FILES := \ + $(encoder_FILES) + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/src/gallium/auxiliary/ \ + $(MESA_TOP)/src/gallium/include/ \ + $(MESA_TOP)/src/panfrost/encoder/ \ + $(MESA_TOP)/src/panfrost/include/ + +LOCAL_STATIC_LIBRARIES := \ + +LOCAL_GENERATED_SOURCES := \ + +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(MESA_TOP)/src/panfrost/encoder/ \ + +include $(MESA_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/src/panfrost/Android.midgard.mk b/src/panfrost/Android.midgard.mk new file mode 100644 index 00000000000..6c9cd4c18e9 --- /dev/null +++ b/src/panfrost/Android.midgard.mk @@ -0,0 +1,61 @@ +# Copyright © 2019 Collabora Ltd. +# +# 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 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. + +include $(CLEAR_VARS) + +LOCAL_MODULE := libpanfrost_midgard +LOCAL_MODULE_CLASS := STATIC_LIBRARIES +intermediates := $(call local-generated-sources-dir) + +LOCAL_SRC_FILES := \ + $(midgard_FILES) + +LOCAL_GENERATED_SOURCES := \ + $(MESA_GEN_GLSL_H) \ + $(intermediates)/midgard_nir_algebraic.c + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/include \ + $(MESA_TOP)/src/compiler/nir/ \ + $(MESA_TOP)/src/gallium/auxiliary/ \ + $(MESA_TOP)/src/gallium/include/ \ + $(MESA_TOP)/src/mapi/ \ + $(MESA_TOP)/src/mesa/ \ + $(MESA_TOP)/src/panfrost/include/ \ + $(MESA_TOP)/src/panfrost/midgard/ + +LOCAL_STATIC_LIBRARIES := \ + libmesa_glsl \ + libmesa_nir \ + libmesa_st_mesa + +midgard_nir_algebraic_gen := $(LOCAL_PATH)/midgard/midgard_nir_algebraic.py +midgard_nir_algebraic_deps := \ + $(MESA_TOP)/src/compiler/nir/ + +$(intermediates)/midgard_nir_algebraic.c: $(midgard_nir_algebraic_deps) + @mkdir -p $(dir $@) + $(hide) $(MESA_PYTHON2) $(midgard_nir_algebraic_gen) -p $< > $@ + +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(MESA_TOP)/src/panfrost/midgard/ \ + +include $(MESA_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/src/panfrost/Android.mk b/src/panfrost/Android.mk index 9ab5ddf9fdf..e48f81071e6 100644 --- a/src/panfrost/Android.mk +++ b/src/panfrost/Android.mk @@ -25,4 +25,8 @@ LOCAL_PATH := $(call my-dir) include $(LOCAL_PATH)/Makefile.sources +include $(LOCAL_PATH)/Android.bifrost.mk +include $(LOCAL_PATH)/Android.encoder.mk +include $(LOCAL_PATH)/Android.midgard.mk include $(LOCAL_PATH)/Android.shared.mk +include $(LOCAL_PATH)/Android.pandecode.mk diff --git a/src/panfrost/Android.pandecode.mk b/src/panfrost/Android.pandecode.mk new file mode 100644 index 00000000000..76c5ce9a763 --- /dev/null +++ b/src/panfrost/Android.pandecode.mk @@ -0,0 +1,44 @@ +# Copyright © 2019 Collabora Ltd. +# +# 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 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. + +include $(CLEAR_VARS) + +LOCAL_MODULE := libpanfrost_decode + +LOCAL_SRC_FILES := \ + $(pandecode_FILES) + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/src/gallium/auxiliary/ \ + $(MESA_TOP)/src/gallium/include/ \ + $(MESA_TOP)/src/panfrost/include/ \ + $(MESA_TOP)/src/panfrost/encoder/ \ + $(MESA_TOP)/src/panfrost/pandecode/ + +LOCAL_STATIC_LIBRARIES := \ + libpanfrost_encoder + +LOCAL_GENERATED_SOURCES := \ + +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(MESA_TOP)/src/panfrost/pandecode/ \ + +include $(MESA_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/src/panfrost/Android.shared.mk b/src/panfrost/Android.shared.mk index 6b921756ecb..81024607eeb 100644 --- a/src/panfrost/Android.shared.mk +++ b/src/panfrost/Android.shared.mk @@ -33,7 +33,7 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := \ $(MESA_TOP)/src/gallium/auxiliary/ \ - $(MESA_TOP)/src/gallium/include/ \ + $(MESA_TOP)/src/gallium/include/ LOCAL_STATIC_LIBRARIES := \ diff --git a/src/panfrost/Makefile.sources b/src/panfrost/Makefile.sources index 3ab90f27913..5b2535bc42a 100644 --- a/src/panfrost/Makefile.sources +++ b/src/panfrost/Makefile.sources @@ -1,3 +1,59 @@ +bifrost_FILES := \ + bifrost/bifrost_compile.c \ + bifrost/bifrost_compile.h \ + bifrost/bifrost.h \ + bifrost/bifrost_ops.h \ + bifrost/bifrost_opts.c \ + bifrost/bifrost_opts.h \ + bifrost/bifrost_print.c \ + bifrost/bifrost_print.h \ + bifrost/bifrost_sched.c \ + bifrost/bifrost_sched.h \ + bifrost/cmdline.c \ + bifrost/compiler_defines.h \ + bifrost/disassemble.c \ + bifrost/disassemble.h + +encoder_FILES := \ + encoder/pan_encoder.h \ + encoder/pan_invocation.c \ + encoder/pan_tiler.c + +midgard_FILES := \ + midgard/compiler.h \ + midgard/disassemble.c \ + midgard/disassemble.h \ + midgard/helpers.h \ + midgard/midgard_compile.c \ + midgard/midgard_compile.h \ + midgard/midgard_derivatives.c \ + midgard/midgard_emit.c \ + midgard/midgard.h \ + midgard/midgard_liveness.c \ + midgard/midgard_nir.h \ + midgard/midgard_ops.c \ + midgard/midgard_ops.h \ + midgard/midgard_opt_copy_prop.c \ + midgard/midgard_opt_dce.c \ + midgard/midgard_opt_float.c \ + midgard/midgard_opt_invert.c \ + midgard/midgard_opt_perspective.c \ + midgard/midgard-parse.h \ + midgard/midgard_print.c \ + midgard/midgard_ra.c \ + midgard/midgard_ra_pipeline.c \ + midgard/midgard_schedule.c \ + midgard/mir.c \ + midgard/mir_promote_uniforms.c + shared_FILES := \ shared/pan_tiling.c \ shared/pan_tiling.h + +pandecode_FILES := \ + pandecode/common.c \ + pandecode/decode.c \ + pandecode/decode.h \ + pandecode/pan_pretty_print.c \ + pandecode/pan_pretty_print.h \ + pandecode/public.h \ No newline at end of file -- cgit v1.2.3