mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-23 15:30:09 +00:00
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 <robert.foss@collabora.com> Reviewed-By: Rohan Garg <rohan.garg@collabora.com> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
parent
6f3f855320
commit
f140467b5b
@ -24,7 +24,7 @@
|
||||
# BOARD_GPU_DRIVERS should be defined. The valid values are
|
||||
#
|
||||
# classic drivers: i915 i965
|
||||
# gallium drivers: swrast freedreno i915g nouveau kmsro r300g r600g radeonsi vc4 virgl vmwgfx etnaviv iris lima
|
||||
# gallium drivers: swrast freedreno i915g nouveau kmsro r300g r600g radeonsi vc4 virgl vmwgfx etnaviv iris lima panfrost
|
||||
#
|
||||
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
|
||||
# module will also be built. DRI modules will be loaded by libGLES_mesa.
|
||||
@ -61,7 +61,8 @@ gallium_drivers := \
|
||||
virgl.HAVE_GALLIUM_VIRGL \
|
||||
etnaviv.HAVE_GALLIUM_ETNAVIV \
|
||||
iris.HAVE_GALLIUM_IRIS \
|
||||
lima.HAVE_GALLIUM_LIMA
|
||||
lima.HAVE_GALLIUM_LIMA \
|
||||
panfrost.HAVE_GALLIUM_PANFROST
|
||||
|
||||
ifeq ($(BOARD_GPU_DRIVERS),all)
|
||||
MESA_BUILD_CLASSIC := $(filter HAVE_%, $(subst ., , $(classic_drivers)))
|
||||
|
@ -49,6 +49,7 @@ SUBDIRS += winsys/etnaviv/drm drivers/etnaviv drivers/renderonly
|
||||
SUBDIRS += state_trackers/dri
|
||||
SUBDIRS += winsys/iris/drm drivers/iris
|
||||
SUBDIRS += winsys/lima/drm drivers/lima
|
||||
SUBDIRS += winsys/panfrost/drm drivers/panfrost
|
||||
|
||||
# sort to eliminate any duplicates
|
||||
INC_DIRS := $(call all-named-subdir-makefiles,$(sort $(SUBDIRS)))
|
||||
|
59
src/gallium/drivers/panfrost/Android.mk
Normal file
59
src/gallium/drivers/panfrost/Android.mk
Normal file
@ -0,0 +1,59 @@
|
||||
# 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.
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# get C_SOURCES
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(C_SOURCES)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(MESA_TOP)/src/gallium/auxiliary/ \
|
||||
$(MESA_TOP)/src/gallium/include/ \
|
||||
$(MESA_TOP)/src/panfrost/include/ \
|
||||
$(MESA_TOP)/src/panfrost/
|
||||
|
||||
LOCAL_MODULE := libmesa_pipe_panfrost
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
libmesa_nir \
|
||||
libmesa_winsys_panfrost \
|
||||
libpanfrost_bifrost \
|
||||
libpanfrost_decode \
|
||||
libpanfrost_encoder \
|
||||
libpanfrost_midgard \
|
||||
libpanfrost_shared
|
||||
|
||||
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
||||
|
||||
include $(GALLIUM_COMMON_MK)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
ifneq ($(HAVE_GALLIUM_PANFROST),)
|
||||
GALLIUM_TARGET_DRIVERS += panfrost
|
||||
$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_panfrost)
|
||||
$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES))
|
||||
endif
|
38
src/gallium/drivers/panfrost/Makefile.sources
Normal file
38
src/gallium/drivers/panfrost/Makefile.sources
Normal file
@ -0,0 +1,38 @@
|
||||
C_SOURCES := \
|
||||
nir/nir_lower_blend.c \
|
||||
nir/nir_lower_blend.h \
|
||||
nir/nir_lower_framebuffer.c \
|
||||
nir/nir_undef_to_zero.c \
|
||||
\
|
||||
pan_afbc.c \
|
||||
pan_allocate.c \
|
||||
pan_allocate.h \
|
||||
pan_assemble.c \
|
||||
pan_blend_cso.c \
|
||||
pan_blend.h \
|
||||
pan_blending.c \
|
||||
pan_blending.h \
|
||||
pan_blend_shaders.c \
|
||||
pan_blend_shaders.h \
|
||||
pan_blit.c \
|
||||
pan_bo.c \
|
||||
pan_bo.h \
|
||||
pan_compute.c \
|
||||
pan_context.c \
|
||||
pan_context.h \
|
||||
pan_format.c \
|
||||
pan_format.h \
|
||||
pan_fragment.c \
|
||||
pan_instancing.c \
|
||||
pan_job.c \
|
||||
pan_job.h \
|
||||
pan_mfbd.c \
|
||||
pan_public.h \
|
||||
pan_resource.c \
|
||||
pan_resource.h \
|
||||
pan_scoreboard.c \
|
||||
pan_screen.c \
|
||||
pan_screen.h \
|
||||
pan_sfbd.c \
|
||||
pan_util.h \
|
||||
pan_varyings.c
|
@ -57,7 +57,11 @@ endif
|
||||
LOCAL_STATIC_LIBRARIES += \
|
||||
libfreedreno_drm \
|
||||
libfreedreno_ir3 \
|
||||
libpanfrost_shared \
|
||||
libpanfrost_bifrost \
|
||||
libpanfrost_decode \
|
||||
libpanfrost_encoder \
|
||||
libpanfrost_midgard \
|
||||
libpanfrost_shared
|
||||
|
||||
ifeq ($(USE_LIBBACKTRACE),true)
|
||||
LOCAL_SHARED_LIBRARIES += libbacktrace
|
||||
|
50
src/panfrost/Android.bifrost.mk
Normal file
50
src/panfrost/Android.bifrost.mk
Normal file
@ -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)
|
42
src/panfrost/Android.encoder.mk
Normal file
42
src/panfrost/Android.encoder.mk
Normal file
@ -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)
|
61
src/panfrost/Android.midgard.mk
Normal file
61
src/panfrost/Android.midgard.mk
Normal file
@ -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)
|
@ -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
|
||||
|
44
src/panfrost/Android.pandecode.mk
Normal file
44
src/panfrost/Android.pandecode.mk
Normal file
@ -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)
|
@ -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 := \
|
||||
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user