]> code.ossystems Code Review - meta-freescale.git/commitdiff
Enable Vivante kernel driver dynamic provider
authorOtavio Salvador <otavio@ossystems.com.br>
Tue, 11 Aug 2015 20:32:47 +0000 (17:32 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 19 Apr 2016 18:03:20 +0000 (15:03 -0300)
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@ossystems.com.br>
conf/machine/include/imx-base.inc
recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc
recipes-kernel/linux/linux-imx.inc

index f54e9b7941814f5625e3750c8550dfff826ed527..e0a67c7c1b424a604ed43eb83bc9808281b9644d 100644 (file)
@@ -90,6 +90,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"
index ee3ac71d91bc462f6ce096a7b2b668462747907e..468849c8259bef2933db273c08740538988e96d3 100644 (file)
@@ -47,8 +47,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"
 
@@ -254,6 +258,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}"
 
index d79022724095db7e20aa7348f81a7457e2bc6859..4835e78fb333a51326d32035831245f2419c49bc 100644 (file)
@@ -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 ?= ""