# 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.
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)))
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)))
--- /dev/null
+# 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
--- /dev/null
+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
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
--- /dev/null
+# 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
--- /dev/null
+# 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
--- /dev/null
+# 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
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
--- /dev/null
+# 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
LOCAL_C_INCLUDES := \
$(MESA_TOP)/src/gallium/auxiliary/ \
- $(MESA_TOP)/src/gallium/include/ \
+ $(MESA_TOP)/src/gallium/include/
LOCAL_STATIC_LIBRARIES := \
+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