Added few more stubs so that control reaches to DestroyDevice().
[mesa.git] / src / amd / Android.common.mk
index 54180f16bbab2a2df249176ba46d838f11dcadbe..d9aa66fd23ebdb62c01ce17a41ba9b0343c5b479 100644 (file)
@@ -20,6 +20,8 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
+ifeq ($(MESA_ENABLE_LLVM),true)
+
 # ---------------------------------------
 # Build libmesa_amd_common
 # ---------------------------------------
@@ -30,9 +32,8 @@ LOCAL_MODULE := libmesa_amd_common
 
 LOCAL_SRC_FILES := \
        $(AMD_COMMON_FILES) \
-       $(AMD_COMPILER_FILES) \
-       $(AMD_DEBUG_FILES) \
-       $(AMD_NIR_FILES)
+       $(AMD_COMMON_LLVM_FILES) \
+       $(AMD_DEBUG_FILES)
 
 LOCAL_CFLAGS += -DFORCE_BUILD_AMDGPU   # instructs LLVM to declare LLVMInitializeAMDGPU* functions
 
@@ -41,19 +42,58 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 intermediates := $(call local-generated-sources-dir)
 LOCAL_GENERATED_SOURCES := $(addprefix $(intermediates)/, $(AMD_GENERATED_FILES))
 
-$(LOCAL_GENERATED_SOURCES): PRIVATE_PYTHON := $(MESA_PYTHON2)
-$(LOCAL_GENERATED_SOURCES): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PYTHON) $^ > $@
+AMD_JSON_FILES := \
+       $(LOCAL_PATH)/registers/gfx6.json \
+       $(LOCAL_PATH)/registers/gfx7.json \
+       $(LOCAL_PATH)/registers/gfx8.json \
+       $(LOCAL_PATH)/registers/gfx81.json \
+       $(LOCAL_PATH)/registers/gfx9.json \
+       $(LOCAL_PATH)/registers/gfx10.json \
+       $(LOCAL_PATH)/registers/gfx103.json \
+       $(LOCAL_PATH)/registers/pkt3.json \
+       $(LOCAL_PATH)/registers/gfx10-rsrc.json \
+       $(LOCAL_PATH)/registers/registers-manually-defined.json
+
+SID_TABLES := $(LOCAL_PATH)/common/sid_tables.py
+
+SID_TABLES_INPUTS := \
+       $(LOCAL_PATH)/common/sid.h \
+       $(AMD_JSON_FILES)
+
+$(intermediates)/common/sid_tables.h: $(SID_TABLES) $(SID_TABLES_INPUTS)
+       @mkdir -p $(dir $@)
+       @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+       $(hide) $(MESA_PYTHON2) $(SID_TABLES) $(SID_TABLES_INPUTS) > $@ || ($(RM) $@; false)
+
+AMDGFXREGS := $(LOCAL_PATH)/registers/makeregheader.py
+
+AMDGFXREGS_INPUTS := \
+       $(AMD_JSON_FILES)
 
-$(intermediates)/common/sid_tables.h: $(LOCAL_PATH)/common/sid_tables.py $(LOCAL_PATH)/common/sid.h $(LOCAL_PATH)/registers/amdgfxregs.json $(LOCAL_PATH)/registers/pkt3.json
-       $(transform-generated-source)
+$(intermediates)/common/amdgfxregs.h: $(AMDGFXREGS) $(AMDGFXREGS_INPUTS)
+       @mkdir -p $(dir $@)
+       @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+       $(hide) $(MESA_PYTHON2) $(AMDGFXREGS) $(AMDGFXREGS_INPUTS) --sort address --guard AMDGFXREGS_H > $@ || ($(RM) $@; false)
 
-$(intermediates)/common/amdgfxregs.h: $(LOCAL_PATH)/registers/makeregheader.py $(LOCAL_PATH)/registers/amdgfxregs.json $(LOCAL_PATH)/registers/pkt3.json
-       $(transform-generated-source) --sort address --guard AMDGFXREGS_H
+GEN10_FORMAT_TABLE_INPUTS := \
+       $(MESA_TOP)/src/util/format/u_format.csv \
+       $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
+
+GEN10_FORMAT_TABLE_DEP := \
+       $(MESA_TOP)/src/amd/registers/regdb.py
+
+GEN10_FORMAT_TABLE := $(LOCAL_PATH)/common/gfx10_format_table.py
+
+$(intermediates)/common/gfx10_format_table.c: $(GEN10_FORMAT_TABLE) $(GEN10_FORMAT_TABLE_INPUTS) $(GEN10_FORMAT_TABLE_DEP)
+       @mkdir -p $(dir $@)
+       @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+       $(hide) $(MESA_PYTHON2) $(GEN10_FORMAT_TABLE) $(GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
 
 LOCAL_C_INCLUDES := \
        $(MESA_TOP)/include \
        $(MESA_TOP)/src \
        $(MESA_TOP)/src/amd/common \
+       $(MESA_TOP)/src/amd/llvm \
        $(MESA_TOP)/src/compiler \
        $(call generated-sources-dir-for,STATIC_LIBRARIES,libmesa_nir,,)/nir \
        $(MESA_TOP)/src/gallium/include \
@@ -62,7 +102,9 @@ LOCAL_C_INCLUDES := \
        $(intermediates)/common
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
-       $(LOCAL_PATH)/common
+       $(LOCAL_PATH)/common \
+       $(LOCAL_PATH)/llvm \
+       $(intermediates)/common
 
 LOCAL_SHARED_LIBRARIES := \
        libdrm_amdgpu
@@ -77,3 +119,5 @@ $(call mesa-build-with-llvm)
 
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
+
+endif # MESA_ENABLE_LLVM == true