sunxi-mali-mainline-driver: new package
authorPeter Korsgaard <peter@korsgaard.com>
Thu, 15 Feb 2018 13:57:52 +0000 (14:57 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Thu, 15 Feb 2018 20:44:55 +0000 (21:44 +0100)
Add allwinner mali kernel driver package.  Used in combination with
userspace Allwinner openGL libraries, it gives possibility to use 3D openGL
SoC acceleration.

[Peter: Rename to sunxi-mali-mainline-driver.  Use revision selection from
sunxi-mali-mainline package.  Depend on that package and default to
y if dependencies are met. Tweak Linux config]
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
DEVELOPERS
linux/linux.mk
package/Config.in
package/sunxi-mali-mainline-driver/Config.in [new file with mode: 0644]
package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk [new file with mode: 0644]

index 1b14927228000db01e71a1a8a698b4b8a281d5f6..e2b390142595c6933e864471c65d058df9d8a502 100644 (file)
@@ -732,6 +732,7 @@ F:  package/webp/
 
 N:     Giulio Benetti <giulio.benetti@micronovasrl.com>
 F:     package/sunxi-mali-mainline/
+F:     package/sunxi-mali-mainline-driver/
 
 N:     Gregory Dymarek <gregd72002@gmail.com>
 F:     package/ding-libs/
index 5300b9cfc58fb8073f359d7989b7383b51cb46d5..776304e730c49971eb371ce9e1cbec8f38ef09b2 100644 (file)
@@ -291,6 +291,9 @@ define LINUX_KCONFIG_FIXUP_CMDS
                $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_SMACK,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_NETWORK,$(@D)/.config))
+       $(if $(BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER),
+               $(call KCONFIG_ENABLE_OPT,CONFIG_CMA,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_DMA_CMA,$(@D)/.config))
        $(if $(BR2_PACKAGE_IPTABLES),
                $(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_IPTABLES,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_IP_NF_FILTER,$(@D)/.config)
index 87c55e227b7008670906d9716a3f8d962a05c273..97317fdb5ff04bcbb40d9c0b3bb10e2c074a3f25 100644 (file)
@@ -505,6 +505,7 @@ endmenu
        source "package/sunxi-cedarx/Config.in"
        source "package/sunxi-mali/Config.in"
        source "package/sunxi-mali-mainline/Config.in"
+       source "package/sunxi-mali-mainline-driver/Config.in"
        source "package/sysstat/Config.in"
        source "package/targetcli-fb/Config.in"
        source "package/ti-gfx/Config.in"
diff --git a/package/sunxi-mali-mainline-driver/Config.in b/package/sunxi-mali-mainline-driver/Config.in
new file mode 100644 (file)
index 0000000..c939d2a
--- /dev/null
@@ -0,0 +1,25 @@
+comment "sunxi-mali-mainline-driver needs a Linux kernel to be built"
+       depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE
+       depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_DRIVER
+       bool "sunxi-mali-mainline-driver"
+       default y
+       depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE # runtime
+       depends on BR2_LINUX_KERNEL
+       select BR2_LINUX_NEEDS_MODULES # not using kernel-module infra
+       help
+         This package builds and installs the Linux kernel driver for
+         the Mali GPU on Allwinner platforms, compatible with recent
+         Linux kernels (>= 4.4). Note that it should be installed
+         together with the corresponding userspace OpenGL libraries,
+         which are provided as binaries only at:
+         https://github.com/free-electrons/mali-blobs
+
+         sunxi-mali-mainline-driver requires a Linux kernel >= 4.4
+         with the following options enabled:
+
+         - CONFIG_CMA
+         - CONFIG_DMA_CMA
+
+         https://github.com/mripard/sunxi-mali/blob/master/README.md
diff --git a/package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk b/package/sunxi-mali-mainline-driver/sunxi-mali-mainline-driver.mk
new file mode 100644 (file)
index 0000000..e4871c0
--- /dev/null
@@ -0,0 +1,26 @@
+################################################################################
+#
+# sunxi-mali-mainline-driver
+#
+################################################################################
+
+SUNXI_MALI_MAINLINE_DRIVER_VERSION = 42c7c139c14103a83bb2ad7e7a1f0ed491f96500
+SUNXI_MALI_MAINLINE_DRIVER_SITE = $(call github,mripard,sunxi-mali,$(SUNXI_MALI_MAINLINE_DRIVER_VERSION))
+SUNXI_MALI_MAINLINE_DRIVER_DEPENDENCIES = linux
+
+SUNXI_MALI_MAINLINE_DRIVER_MAKE_OPTS = \
+       KDIR=$(LINUX_DIR) \
+       CROSS_COMPILE=$(TARGET_CROSS) \
+       INSTALL_MOD_PATH=$(TARGET_DIR)
+
+define SUNXI_MALI_MAINLINE_DRIVER_BUILD_CMDS
+       cd $(@D) && $(SUNXI_MALI_MAINLINE_DRIVER_MAKE_OPTS) \
+               $(SHELL) ./build.sh -r $(SUNXI_MALI_MAINLINE_REV) -b
+endef
+
+define SUNXI_MALI_MAINLINE_DRIVER_INSTALL_TARGET_CMDS
+       cd $(@D) && $(SUNXI_MALI_MAINLINE_DRIVER_MAKE_OPTS) \
+               $(SHELL) ./build.sh -r $(SUNXI_MALI_MAINLINE_REV) -i
+endef
+
+$(eval $(generic-package))