From 7c0298e2fe4e6eb5f877786bfe6a536dbc778012 Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Sat, 16 Jan 2021 21:36:47 +0100 Subject: [PATCH] android: freedreno/hw/isa: Add description of ir3 ISA Necessary to build libir3decode and libir3encode for Android Fixes: 6d94f575d ("freedreno/hw/isa: Add description of ir3 ISA") Signed-off-by: Mauro Rossi Acked-by: Rob Clark Part-of: --- src/freedreno/Android.isa.mk | 123 +++++++++++++++++++++++++++++++++ src/freedreno/Android.mk | 1 + src/freedreno/Makefile.sources | 9 +++ 3 files changed, 133 insertions(+) create mode 100644 src/freedreno/Android.isa.mk diff --git a/src/freedreno/Android.isa.mk b/src/freedreno/Android.isa.mk new file mode 100644 index 00000000000..97ed0f4a2d3 --- /dev/null +++ b/src/freedreno/Android.isa.mk @@ -0,0 +1,123 @@ +# Mesa 3-D graphics library +# +# Copyright (C) 2021 Mauro Rossi issor.oruam@gmail.com +# +# 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. + +# Android.mk for libir3decode.a and libir3encode.a + +# --------------------------------------- +# Build libir3decode +# --------------------------------------- + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(decode_SOURCES) + +LOCAL_MODULE := libir3decode + +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +intermediates := $(call local-generated-sources-dir) + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/src/gallium/include \ + $(MESA_TOP)/src/gallium/auxiliary \ + $(MESA_TOP)/src/freedreno/isa \ + $(intermediates)/isa + +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/isa/, ir3-isa.c) + +ir3-isa_c_gen := \ + $(MESA_TOP)/src/freedreno/isa/decode.py + +ir3-isa_c_deps := \ + $(MESA_TOP)/src/freedreno/isa/ir3.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-common.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat0.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat1.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat2.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat3.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat4.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat5.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat6.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat7.xml \ + $(MESA_TOP)/src/freedreno/isa/isa.py + +$(intermediates)/isa/ir3-isa.c: $(ir3-isa_c_deps) + @mkdir -p $(dir $@) + $(hide) $(MESA_PYTHON3) $(ir3-isa_c_gen) $< $@ + +include $(MESA_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) + +# --------------------------------------- +# Build libir3encode +# --------------------------------------- + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + $(encode_SOURCES) + +LOCAL_MODULE := libir3encode + +LOCAL_MODULE_CLASS := STATIC_LIBRARIES + +intermediates := $(call local-generated-sources-dir) + +LOCAL_C_INCLUDES := \ + $(MESA_TOP)/src/compiler/nir \ + $(MESA_TOP)/src/gallium/include \ + $(MESA_TOP)/src/gallium/auxiliary \ + $(MESA_TOP)/src/freedreno/isa \ + $(intermediates)/isa + +# We need libmesa_nir to get NIR's generated include directories. +LOCAL_STATIC_LIBRARIES := \ + libmesa_nir + +LOCAL_GENERATED_SOURCES := \ + $(MESA_GEN_NIR_H) + +LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/isa/, encode.h) + +encode_h_gen := \ + $(MESA_TOP)/src/freedreno/isa/encode.py + +encode_h_deps := \ + $(MESA_TOP)/src/freedreno/isa/ir3.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-common.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat0.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat1.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat2.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat3.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat4.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat5.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat6.xml \ + $(MESA_TOP)/src/freedreno/isa/ir3-cat7.xml \ + $(MESA_TOP)/src/freedreno/isa/isa.py + +$(intermediates)/isa/encode.h: $(encode_h_deps) + @mkdir -p $(dir $@) + $(hide) $(MESA_PYTHON3) $(encode_h_gen) $< $@ + +include $(MESA_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) diff --git a/src/freedreno/Android.mk b/src/freedreno/Android.mk index 7c3d30753ba..a488803f98c 100644 --- a/src/freedreno/Android.mk +++ b/src/freedreno/Android.mk @@ -29,5 +29,6 @@ include $(LOCAL_PATH)/Android.common.mk include $(LOCAL_PATH)/Android.drm.mk include $(LOCAL_PATH)/Android.ir2.mk include $(LOCAL_PATH)/Android.ir3.mk +include $(LOCAL_PATH)/Android.isa.mk include $(LOCAL_PATH)/Android.perfcntrs.mk include $(LOCAL_PATH)/Android.registers.mk diff --git a/src/freedreno/Makefile.sources b/src/freedreno/Makefile.sources index c2e445d042b..2d17e66f7b0 100644 --- a/src/freedreno/Makefile.sources +++ b/src/freedreno/Makefile.sources @@ -6,6 +6,11 @@ common_SOURCES := \ common/freedreno_uuid.c \ common/freedreno_uuid.h +decode_SOURCES := \ + isa/decode.c \ + isa/decode.h \ + isa/isa.h + drm_SOURCES := \ drm/freedreno_bo.c \ drm/freedreno_drmif.h \ @@ -22,6 +27,10 @@ drm_SOURCES := \ drm/freedreno_priv.h \ drm/msm_ringbuffer.c +encode_SOURCES := \ + isa/encode.c \ + isa/isa.h + ir2_SOURCES := \ ir2/disasm-a2xx.c \ ir2/instr-a2xx.h