# # Copyright (C) 2018 Allwinner Technology Limited. All rights reserved # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # # Author: Albert Yu # include $(TOPDIR)/rules.mk include $(TINA_BUILD_TOP)/.config PKG_NAME:=gpu PKG_VERSION:=1.0.0 PKG_RELEASE:=1 PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME) include $(BUILD_DIR)/package.mk define Package/$(PKG_NAME)/Default SECTION:=libs CATEGORY:=Libraries SUBMENU:=GPU Libraries endef define Package/$(PKG_NAME)/description/Default endef ifeq ($(TARGET_PLATFORM), $(filter $(TARGET_PLATFORM), astar azalea tulip mandolin)) GPU_TYPE:=mali400 else ifeq ($(TARGET_PLATFORM), $(filter $(TARGET_PLATFORM), koto)) GPU_TYPE:=mali-t760 else ifeq ($(TARGET_PLATFORM), $(filter $(TARGET_PLATFORM), octopus)) GPU_TYPE:=sgx544 endif define Build/Configure endef define Build/Compile endef ifeq ($(CONFIG_WESTON_DRM),y) WINDOW_SYSTEM_TYPE:=wayland else WINDOW_SYSTEM_TYPE:=fbdev endif GPU_3RDPARTY_INCLUDE_DIR:=$(GPU_TYPE)/3rdparty/include/khronos GPU_INCLUDE_DIR:=$(GPU_TYPE)/$(WINDOW_SYSTEM_TYPE)/include ifeq ($(CONFIG_COMPLILE_KERNEL64_USER64),y) GPU_LIB_DIR:=$(GPU_TYPE)/$(WINDOW_SYSTEM_TYPE)/$(CONFIG_LIBC)/lib64 else ifeq ($(TARGET_ARCH),aarch64) GPU_LIB_DIR:=$(GPU_TYPE)/$(WINDOW_SYSTEM_TYPE)/$(CONFIG_LIBC)/lib64 else ifeq ($(TARGET_ARCH),arm) GPU_LIB_DIR:=$(GPU_TYPE)/$(WINDOW_SYSTEM_TYPE)/$(CONFIG_LIBC)/lib else $(error Invalid TARGET_ARCH $(TARGET_ARCH)) endif ##################################################################### #For Mali-400 platforms define Package/mali400-um $(Package/$(PKG_NAME)/Default) TITLE:=Mali-400 userspace libraries DEPENDS:=+kmod-mali-utgard-km ifeq ($(CONFIG_WESTON_DRM),y) DEPENDS+=+wayland +libdrm endif endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include $(CP) -v $(GPU_3RDPARTY_INCLUDE_DIR)/* $(1)/usr/include ifeq ($(filter $(TARGET_PLATFORM), octopus),) $(CP) -v $(GPU_INCLUDE_DIR)/* $(1)/usr/include endif $(CP) -uvd $(GPU_LIB_DIR)/* $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(CP) -v pkgconfig/*.pc $(1)/usr/lib/pkgconfig ifeq ($(WINDOW_SYSTEM_TYPE),wayland) $(CP) -v $(GPU_TYPE)/wayland/pkgconfig/*.pc $(1)/usr/lib/pkgconfig endif endef define Package/mali400-um/install $(INSTALL_DIR) $(1)/usr/lib $(CP) -uvd $(GPU_LIB_DIR)/* $(1)/usr/lib endef ##################################################################### #For Mali-T760 platforms define Package/mali-t760-um $(Package/$(PKG_NAME)/Default) TITLE:=Mali-T760 userspace libraries DEPENDS:=+kmod-mali-midgard-km endef define Package/mali-t760-um/install $(INSTALL_DIR) $(1)/usr/lib $(CP) -uvd $(GPU_LIB_DIR)/* $(1)/usr/lib endef ##################################################################### #For SGX-544 platforms define Package/sgx544-um $(Package/$(PKG_NAME)/Default) TITLE:=SGX-544 userspace libraries DEPENDS:=+kmod-sgx544-km endef define Package/sgx544-um/install $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(CP) -uvd $(GPU_LIB_DIR)/lib/* $(1)/usr/lib $(CP) -uv $(GPU_LIB_DIR)/../bin/* $(1)/usr/bin endef ##################################################################### ifeq ($(TARGET_PLATFORM), $(filter $(TARGET_PLATFORM), astar azalea tulip mandolin)) $(eval $(call BuildPackage,mali400-um)) else ifeq ($(TARGET_PLATFORM), $(filter $(TARGET_PLATFORM), koto)) $(eval $(call BuildPackage,mali-t760-um)) else ifeq ($(TARGET_PLATFORM), $(filter $(TARGET_PLATFORM), octopus)) $(eval $(call BuildPackage,sgx544-um)) endif