diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2026-09-28 21:19:31 -0300 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2026-09-29 10:52:40 +0000 |
| commit | 00a58304a16a1c7a4accf6f98b63e12af7d29d3b (patch) | |
| tree | 8b0731af2e530b5b3cbd27f56ebce5327ace39a1 | |
| parent | 3bd965d1bebb894efb805f451c19a3187f6dff07 (diff) | |
| download | meta-freescale-00a58304a16a1c7a4accf6f98b63e12af7d29d3b.tar.gz | |
imx-gpu-sdk: Convert the GPU features to PACKAGECONFIG
The recipe assumed a Vivante GPU on every imxgpu machine: OpenVG and
HW_GPU_VIVANTE were always passed to FslBuild.py and virtual/libopenvg
was a dependency for all 2D GPUs. OpenVG is only implemented by the
Vivante driver, so on i.MX 95, with its Mali GPU, nothing provides
virtual/libopenvg and even with the dependency dropped the build would
still request the OpenVG samples and the Vivante-specific code.
Follow the layout used by NXP's meta-imx for this recipe and describe
each FslBuild.py feature as a PACKAGECONFIG option carrying its own
dependencies, so the features passed to the build and the recipe
dependencies can no longer diverge:
- openvg and vivante are only enabled on imxviv, mali on imxmali;
- i.MX 95 gets the OpenGL ES 3.x, OpenCV and Vulkan features and the
GL extensions list used by meta-imx, plus OpenCL when the opencl
distro feature is enabled;
- Vulkan is enabled only with the vulkan distro feature, as
vulkan-loader and rapidvulkan require it;
- the Vivante machines keep the same feature set as before.
libxdg-shell is now a runtime dependency for every Wayland build, not
only on i.MX 8, matching its build dependency.
Tested with 'bitbake -e' and 'bitbake -n imx-gpu-sdk' for
imx6qdlsabresd, imx7ulpevk, imx8mm-lpddr4-evk, imx8mp-lpddr4-evk,
imx8mq-evk and imx95-19x19-verdin, with and without the opencl distro
feature, comparing FEATURES against the previous recipe for the
Vivante machines.
Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
(cherry picked from commit 8db7478f15ad79ffb906d9b95e5b0bda1ae9c389)
| -rw-r--r-- | recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_6.1.1.bb | 127 |
1 files changed, 69 insertions, 58 deletions
diff --git a/recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_6.1.1.bb b/recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_6.1.1.bb index adc202eb4..b8b44d2fe 100644 --- a/recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_6.1.1.bb +++ b/recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_6.1.1.bb | |||
| @@ -5,24 +5,7 @@ SECTION = "graphics" | |||
| 5 | LICENSE = "BSD-3-Clause" | 5 | LICENSE = "BSD-3-Clause" |
| 6 | LIC_FILES_CHKSUM = "file://License.md;md5=9d58a2573275ce8c35d79576835dbeb8" | 6 | LIC_FILES_CHKSUM = "file://License.md;md5=9d58a2573275ce8c35d79576835dbeb8" |
| 7 | 7 | ||
| 8 | DEPENDS_BACKEND = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', ' libxdg-shell wayland', \ | ||
| 9 | bb.utils.contains('DISTRO_FEATURES', 'x11', ' xrandr', '', d), d)}" | ||
| 10 | DEPENDS_MX8 = "" | ||
| 11 | DEPENDS_MX8:mx8-nxp-bsp = "\ | ||
| 12 | glslang-native \ | ||
| 13 | opencv \ | ||
| 14 | rapidopencl \ | ||
| 15 | rapidopenvx \ | ||
| 16 | rapidvulkan \ | ||
| 17 | vulkan-headers \ | ||
| 18 | vulkan-loader \ | ||
| 19 | " | ||
| 20 | DEPENDS_MX8:mx8mm-nxp-bsp = "\ | ||
| 21 | opencv \ | ||
| 22 | " | ||
| 23 | DEPENDS = "\ | 8 | DEPENDS = "\ |
| 24 | ${DEPENDS_BACKEND} \ | ||
| 25 | ${DEPENDS_MX8} \ | ||
| 26 | assimp \ | 9 | assimp \ |
| 27 | cmake-native \ | 10 | cmake-native \ |
| 28 | devil \ | 11 | devil \ |
| @@ -39,39 +22,85 @@ DEPENDS = "\ | |||
| 39 | stb \ | 22 | stb \ |
| 40 | zlib \ | 23 | zlib \ |
| 41 | " | 24 | " |
| 42 | DEPENDS:append:imxgpu2d = " virtual/libg2d virtual/libopenvg" | ||
| 43 | DEPENDS:append:imxgpu3d = " virtual/libgles2" | ||
| 44 | 25 | ||
| 45 | require imx-gpu-sdk-src.inc | 26 | require imx-gpu-sdk-src.inc |
| 46 | 27 | ||
| 47 | WINDOW_SYSTEM = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'Wayland_XDG', \ | 28 | PACKAGECONFIG ??= "\ |
| 48 | bb.utils.contains('DISTRO_FEATURES', 'x11', 'X11', 'FB', d), d)}" | 29 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \ |
| 30 | bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d), d)} \ | ||
| 31 | ${PACKAGECONFIG_G2D} \ | ||
| 32 | ${PACKAGECONFIG_GLES} \ | ||
| 33 | ${PACKAGECONFIG_GPUTYPE} \ | ||
| 34 | ${PACKAGECONFIG_OPENVG} \ | ||
| 35 | ${PACKAGECONFIG_SOC} \ | ||
| 36 | " | ||
| 37 | |||
| 38 | PACKAGECONFIG_G2D = "" | ||
| 39 | PACKAGECONFIG_G2D:imxgpu2d = "g2d" | ||
| 40 | |||
| 41 | PACKAGECONFIG_GLES = "" | ||
| 42 | PACKAGECONFIG_GLES:imxgpu3d = "gles2" | ||
| 43 | PACKAGECONFIG_GLES:imxgpu3d:imxmali = "gles2 gles3 gles32" | ||
| 44 | PACKAGECONFIG_GLES:mx6q-nxp-bsp = "gles2 gles3" | ||
| 45 | PACKAGECONFIG_GLES:mx6dl-nxp-bsp = "gles2 gles3" | ||
| 46 | PACKAGECONFIG_GLES:mx8-nxp-bsp = "gles2 gles32" | ||
| 47 | PACKAGECONFIG_GLES:mx8mm-nxp-bsp = "gles2" | ||
| 48 | |||
| 49 | PACKAGECONFIG_GPUTYPE = "" | ||
| 50 | PACKAGECONFIG_GPUTYPE:imxmali = "mali" | ||
| 51 | PACKAGECONFIG_GPUTYPE:imxviv = "vivante" | ||
| 52 | |||
| 53 | # OpenVG is only implemented by the Vivante GPU driver | ||
| 54 | PACKAGECONFIG_OPENVG = "" | ||
| 55 | PACKAGECONFIG_OPENVG:imxviv = "openvg" | ||
| 56 | |||
| 57 | # The Vivante driver always provides OpenCL, while other GPUs rely on the | ||
| 58 | # standard ICD loader, which, like the Vulkan loader, needs the distro feature. | ||
| 59 | PACKAGECONFIG_SOC = "" | ||
| 60 | PACKAGECONFIG_SOC:imxmali = "opencv ${@bb.utils.filter('DISTRO_FEATURES', 'opencl vulkan', d)}" | ||
| 61 | PACKAGECONFIG_SOC:mx8-nxp-bsp = "opencl opencv openvx ${@bb.utils.filter('DISTRO_FEATURES', 'vulkan', d)}" | ||
| 62 | PACKAGECONFIG_SOC:mx8mm-nxp-bsp = "opencv" | ||
| 63 | |||
| 64 | PACKAGECONFIG[g2d] = "G2D,,virtual/libg2d" | ||
| 65 | PACKAGECONFIG[gles2] = "OpenGLES2,,virtual/libgles2" | ||
| 66 | PACKAGECONFIG[gles3] = "OpenGLES3,,virtual/libgles3" | ||
| 67 | PACKAGECONFIG[gles32] = "OpenGLES3.2,,virtual/libgles3" | ||
| 68 | PACKAGECONFIG[mali] = "" | ||
| 69 | # rapidopencl, rapidopenvx and rapidvulkan are header-only, so they are added | ||
| 70 | # to RDEPENDS for them to be included in the SDK | ||
| 71 | PACKAGECONFIG[opencl] = "OpenCL1.2,,rapidopencl virtual/libopencl1,rapidopencl" | ||
| 72 | PACKAGECONFIG[opencv] = "OpenCV4,,opencv" | ||
| 73 | PACKAGECONFIG[openvg] = "OpenVG,,virtual/libopenvg" | ||
| 74 | PACKAGECONFIG[openvx] = "OpenVX1.2,,rapidopenvx,rapidopenvx" | ||
| 75 | PACKAGECONFIG[vivante] = "HW_GPU_VIVANTE" | ||
| 76 | # vulkan-loader is dynamically loaded, so it needs an explicit RDEPENDS | ||
| 77 | PACKAGECONFIG[vulkan] = "Vulkan1.2,,glslang-native rapidvulkan vulkan-headers vulkan-loader,rapidvulkan vulkan-loader vulkan-validation-layers" | ||
| 78 | PACKAGECONFIG[wayland] = ",,libxdg-shell wayland,libxdg-shell,,x11" | ||
| 79 | PACKAGECONFIG[x11] = ",,xrandr,,,wayland" | ||
| 80 | |||
| 81 | WINDOW_SYSTEM = "${@bb.utils.contains('PACKAGECONFIG', 'wayland', 'Wayland_XDG', \ | ||
| 82 | bb.utils.contains('PACKAGECONFIG', 'x11', 'X11', 'FB', d), d)}" | ||
| 49 | 83 | ||
| 50 | # FEATURES is a comma-separated list passed to FslBuild.py as | 84 | # FEATURES is a comma-separated list passed to FslBuild.py as |
| 51 | # --UseFeatures [${FEATURES}], so each appended token starts with a comma | 85 | # --UseFeatures [${FEATURES}], built from the fixed features below and the ones |
| 52 | # and must NOT start with a space. A leading space would inject an invalid | 86 | # enabled through PACKAGECONFIG. |
| 53 | # feature name into the build. | 87 | PACKAGECONFIG_CONFARGS = "\ |
| 54 | FEATURES = "ConsoleHost,EarlyAccess,EGL,GoogleUnitTest,Lib_NlohmannJson,OpenVG,Test_RequireUserInputToExit,WindowHost" | 88 | ConsoleHost \ |
| 55 | # nooelint: oelint.vars.inconspaces | 89 | EarlyAccess \ |
| 56 | FEATURES:append:imxgpu = ",HW_GPU_VIVANTE" | 90 | EGL \ |
| 57 | # nooelint: oelint.vars.inconspaces | 91 | GoogleUnitTest \ |
| 58 | FEATURES:append:imxgpu2d = ",G2D" | 92 | Lib_NlohmannJson \ |
| 59 | # nooelint: oelint.vars.inconspaces | 93 | Test_RequireUserInputToExit \ |
| 60 | FEATURES:append:imxgpu3d = ",OpenGLES2" | 94 | WindowHost \ |
| 61 | # nooelint: oelint.vars.inconspaces | 95 | " |
| 62 | FEATURES:append = "${FEATURES_SOC}" | 96 | FEATURES = "${@','.join(d.getVar('PACKAGECONFIG_CONFARGS').split())}" |
| 63 | |||
| 64 | FEATURES_SOC = "" | ||
| 65 | FEATURES_SOC:mx6q-nxp-bsp = ",OpenGLES3" | ||
| 66 | FEATURES_SOC:mx6dl-nxp-bsp = ",OpenGLES3" | ||
| 67 | FEATURES_SOC:mx8-nxp-bsp = ",OpenCV4,Vulkan1.2,OpenGLES3.2,OpenCL1.2,OpenVX1.2" | ||
| 68 | FEATURES_SOC:mx8mm-nxp-bsp = ",OpenCV4" | ||
| 69 | 97 | ||
| 70 | EXTENSIONS = "*" | 98 | EXTENSIONS = "*" |
| 71 | EXTENSIONS:mx6q-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_geometry_shader,OpenGLES3:GL_EXT_tessellation_shader" | 99 | EXTENSIONS:mx6q-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_geometry_shader,OpenGLES3:GL_EXT_tessellation_shader" |
| 72 | EXTENSIONS:mx6dl-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_geometry_shader,OpenGLES3:GL_EXT_tessellation_shader" | 100 | EXTENSIONS:mx6dl-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_geometry_shader,OpenGLES3:GL_EXT_tessellation_shader" |
| 73 | EXTENSIONS:mx8m-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_color_buffer_float" | 101 | EXTENSIONS:mx8m-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_color_buffer_float" |
| 74 | EXTENSIONS:mx8mm-nxp-bsp = "*" | 102 | EXTENSIONS:mx8mm-nxp-bsp = "*" |
| 103 | EXTENSIONS:imxmali = "OpenGLES3:GL_EXT_color_buffer_float,OpenGLES3:GL_EXT_geometry_shader,OpenGLES3:GL_EXT_tessellation_shader" | ||
| 75 | 104 | ||
| 76 | do_compile () { | 105 | do_compile () { |
| 77 | export FSL_PLATFORM_NAME=Yocto | 106 | export FSL_PLATFORM_NAME=Yocto |
| @@ -116,7 +145,7 @@ INSANE_SKIP:${PN} += "already-stripped rpaths" | |||
| 116 | 145 | ||
| 117 | # Unfortunately recipes with an empty main package, like header-only libraries, | 146 | # Unfortunately recipes with an empty main package, like header-only libraries, |
| 118 | # are not included in the SDK. Use RDEPENDS as a workaround. | 147 | # are not included in the SDK. Use RDEPENDS as a workaround. |
| 119 | RDEPENDS_EMPTY_MAIN_PACKAGE = "\ | 148 | RDEPENDS:${PN} += "\ |
| 120 | fmt \ | 149 | fmt \ |
| 121 | gli \ | 150 | gli \ |
| 122 | glm \ | 151 | glm \ |
| @@ -126,24 +155,6 @@ RDEPENDS_EMPTY_MAIN_PACKAGE = "\ | |||
| 126 | rapidjson \ | 155 | rapidjson \ |
| 127 | stb \ | 156 | stb \ |
| 128 | " | 157 | " |
| 129 | RDEPENDS_EMPTY_MAIN_PACKAGE_MX8 = "" | ||
| 130 | RDEPENDS_EMPTY_MAIN_PACKAGE_MX8:mx8-nxp-bsp = "\ | ||
| 131 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libxdg-shell', '', d)} \ | ||
| 132 | rapidopencl \ | ||
| 133 | rapidopenvx \ | ||
| 134 | rapidvulkan \ | ||
| 135 | " | ||
| 136 | RDEPENDS_EMPTY_MAIN_PACKAGE_MX8:mx8mm-nxp-bsp = "" | ||
| 137 | # vulkan-loader is dynamically loaded, so need to add an explicit | ||
| 138 | # dependency | ||
| 139 | RDEPENDS_VULKAN_LOADER = "" | ||
| 140 | RDEPENDS_VULKAN_LOADER:mx8-nxp-bsp = "vulkan-loader vulkan-validation-layers" | ||
| 141 | RDEPENDS_VULKAN_LOADER:mx8mm-nxp-bsp = "" | ||
| 142 | RDEPENDS:${PN} += "\ | ||
| 143 | ${RDEPENDS_EMPTY_MAIN_PACKAGE_MX8} \ | ||
| 144 | ${RDEPENDS_EMPTY_MAIN_PACKAGE} \ | ||
| 145 | ${RDEPENDS_VULKAN_LOADER} \ | ||
| 146 | " | ||
| 147 | 158 | ||
| 148 | # For backwards compatibility | 159 | # For backwards compatibility |
| 149 | RPROVIDES:${PN} = "fsl-gpu-sdk" | 160 | RPROVIDES:${PN} = "fsl-gpu-sdk" |
