From: Otavio Salvador Date: Tue, 11 Aug 2015 20:32:47 +0000 (-0300) Subject: Enable Vivante kernel driver dynamic provider X-Git-Tag: 2.1~243 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=6d20ab47a75e6c044164c25ccaa9091b0bbc6915;p=meta-freescale.git Enable Vivante kernel driver dynamic provider 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 --- diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index f54e9b79..e0a67c7c 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -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" diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc b/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc index ee3ac71d..468849c8 100644 --- a/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc +++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv.inc @@ -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}" diff --git a/recipes-kernel/linux/linux-imx.inc b/recipes-kernel/linux/linux-imx.inc index d7902272..4835e78f 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 ?= ""