[meta-freescale] [meta-fsl-arm PATCH v5 4/6] Enable Vivante kernel driver dynamic provider

Otavio Salvador otavio at ossystems.com.br
Sat Aug 22 14:51:45 PDT 2015


The linux-imx.inc based kernels now can dynamically provide the
Vivante kernel driver and satisfy the runtime dependency added for the
Vivante GPU user space libraries. The beauty of this solution is that
it makes ease for 3rd party kernel to reuse the same infrastructure
and use the external module easily.

Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---

Changes in v5:
- Skip package when machine does not have Vivante kernel support
- Add SoC default for kernel support in imx-base.inc

Changes in v4:
- Silence the warning about missing build-dependency

Changes in v3: None
Changes in v2: None

 conf/machine/include/imx-base.inc            | 12 ++++++++++++
 recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc |  8 +++++++-
 recipes-kernel/linux/linux-imx.inc           |  2 +-
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc
index 48d2e48..d5517dd 100644
--- a/conf/machine/include/imx-base.inc
+++ b/conf/machine/include/imx-base.inc
@@ -88,6 +88,18 @@ MACHINE_GSTREAMER_1_0_PLUGIN ?= ""
 MACHINE_GSTREAMER_1_0_PLUGIN_mx6q ?= "gstreamer1.0-plugins-imx-meta"
 MACHINE_GSTREAMER_1_0_PLUGIN_mx6dl ?= "gstreamer1.0-plugins-imx-meta"
 
+# Determines if the SoC has support for Vivante kernel driver
+SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT       = "0"
+SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6q  = "1"
+SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6dl = "1"
+SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6sx = "1"
+SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT_mx6sl = "1"
+
+# Handle Vivante kernel driver setting:
+#   0 - machine does not have Vivante GPU driver support
+#   1 - machine has Vivante GPU driver support
+MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT ??= "${SOC_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT}"
+
 # mx6 GPU libraries
 PREFERRED_PROVIDER_virtual/egl_mx6q ?= "imx-gpu-viv"
 PREFERRED_PROVIDER_virtual/egl_mx6dl ?= "imx-gpu-viv"
diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc b/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc
index 5de8a3d..b095cf2 100644
--- a/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc
+++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc
@@ -50,8 +50,12 @@ PACKAGES =+ "libclc-mx6 libclc-mx6-dev libclc-mx6-dbg \
 	imx-gpu-viv-demos imx-gpu-viv-demos-dbg \
 "
 
-# Skip package if it does not match the machine float-point type in use
 python __anonymous () {
+        has_vivante_kernel_driver_support = (d.getVar('MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT', True) or '0')
+        if has_vivante_kernel_driver_support != '1':
+                raise bb.parse.SkipPackage('The kernel of machine needs to have Vivante kernel driver support for this recipe to be used.')
+
+        # Skip package if it does not match the machine float-point type in use
         is_machine_hardfp = base_contains("TUNE_FEATURES", "callconvention-hard", True, False, d)
         is_package_hardfp = d.getVar("PACKAGE_FP_TYPE", True) == "hardfp"
 
@@ -260,6 +264,8 @@ FILES_libegl-mx6-dbg = "${libdir}/.debug/libEGL${SOLIBS}"
 FILES_libgal-mx6 = "${libdir}/libGAL${SOLIBS} ${libdir}/libGAL_egl${SOLIBS}"
 FILES_libgal-mx6-dev = "${libdir}/libGAL${SOLIBSDEV} ${includedir}/HAL"
 FILES_libgal-mx6-dbg = "${libdir}/.debug/libGAL${SOLIBS}"
+RDEPENDS_libgal-mx6 += "kernel-module-imx-gpu-viv"
+INSANE_SKIP_libgal-mx6 += "build-deps"
 
 FILES_libvsc-mx6 = "${libdir}/libVSC${SOLIBS}"
 
diff --git a/recipes-kernel/linux/linux-imx.inc b/recipes-kernel/linux/linux-imx.inc
index d790227..4835e78 100644
--- a/recipes-kernel/linux/linux-imx.inc
+++ b/recipes-kernel/linux/linux-imx.inc
@@ -4,7 +4,7 @@
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
 
-inherit kernel fsl-kernel-localversion
+inherit kernel fsl-kernel-localversion fsl-vivante-kernel-driver-handler
 
 # Put a local version until we have a true SRCREV to point to
 LOCALVERSION ?= ""
-- 
2.5.0



More information about the meta-freescale mailing list