Colibri i.MX6 OpenGL ES 2.0 and gpu_sdk without X11

Hello,

i have read the articel “Embedded Linux Sample Code” and followed the steps to build Freescales gpu_sdk / OpenGL ES 2.0 for i.MX6 combined with X11 i have it running. However our customer like to have a lightweight graphical stack on the i.MX6 with HW acceleration (at least 2D) therefor we think to user OpenGL ES 2.0 without the overhead of X11, so is it possible to use gpu_sdk with “fbdev” with Toradex Yocto Linux to achieve this. Or would you recommed a other approach for a HW accelerated lightweight graphical stack (at least 2D) for displaying a single window e.g. libDRM, Wayland? Or, how can we make use of vivante’s GC320?

many thanks in advanced,
Torsten Krieger

Hi Torsten

Vivante provides different binary drivers for the different supported graphical backends (X11, Wayland, fbdev).
When you build an image with Yocto/Openembedded the flavour installed depends on the DISTRO_FEATURES variable.

So you would add the following to your local.conf file:
DISTRO_FEATURES_remove = “x11 directfb wayland”
delete all buildoutput and sstate:
rm -rf oe-core/build/out-glibc oe-core/build/sstate-cache

And then build an image (which must not install any X11 dependent packages).
The resulting image will contain EGL, GLES drivers which make use the framebuffer device.

Max

Hello,

I try to do the same: get rid of X11 and Wayland and use OpenGL ES with DRM, GBM & EGL directly in an application.

I’m using BSP V5.6 and my image is based on tdx-reference-minimal-image.bb. I’ve added to my local.conf

DISTRO_FEATURES_remove = " x11 wayland"
DISTRO_FEATURES_append = " mesa-gl opengl"

But in my sdk I still miss the headers <GL/gl.h>, <gbm.h> and <EGL/egl.h>

Best regards,
Markus

Hi @Mowlwurf !

You can use the oe-pkgdata-util to help here. It has the find-path command to find out which package is responsible for a given file on the final image.

Since headers are usually in /usr/include, let’s try (I have MACHINE=colibri-imx6 in my local.conf):

$ oe-pkgdata-util find-path /usr/include/GL/gl.h
libgl-imx-dev: /usr/include/GL/gl.h

$ oe-pkgdata-util find-path /usr/include/EGL/egl.h
libegl-imx-dev: /usr/include/EGL/egl.h

$ oe-pkgdata-util find-path /usr/include/gbm.h
ERROR: Unable to find any package producing path /usr/include/gbm.h

So the libgl-imx-dev is responsible for egl.h and gl.h. The gbm.h (and the whole gbm) seems to be available only for iMX8 SoC. You can check directly the imx-gpu-viv recipe files: imx-gpu-viv « recipes-graphics « backports - meta-toradex-nxp.git - Toradex BSP layer, recipes for NXP based modules

To have the headers available, you need to add the imx-gpu-viv recipe to your image.

You can take a look at the distro (tdx-xwayland.conf) and at the tdx-reference-multimedia-image.bb to see how it is done.

https://git.toradex.com/cgit/meta-toradex-distro.git/tree/conf/distro/tdx-xwayland.conf?h=dunfell-5.x.y

https://git.toradex.com/cgit/meta-toradex-demos.git/tree/recipes-images/images/tdx-reference-multimedia-image.bb?h=dunfell-5.x.y

Best regards,

Hi Henrique,

thank you for your response. The oe-pkgdata-util was a good hint.

I’ve looked into the tdx-reference-multimedia-image.bb and added the packagegroup-tdx-graphical to my image recipe.

The build stops with the following error:

ERROR: Nothing RPROVIDES 'vulkan-loader' (but /home/toradex/oe-coreV5.6/build/../layers/meta-toradex-demos/recipes-images/images/packagegroup-tdx-graphical.bb RDEPENDS on or otherwise requires it)
vulkan-loader was skipped: one of 'wayland x11' needs to be in DISTRO_FEATURES
NOTE: Runtime target 'vulkan-loader' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['vulkan-loader']
NOTE: Runtime target 'packagegroup-tdx-graphical' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['packagegroup-tdx-graphical', 'vulkan-loader']
ERROR: Required build target 'image-gemac-dev' has no buildable providers.
Missing or unbuildable dependency chain was: ['image-gemac-dev', 'packagegroup-tdx-graphical', 'vulkan-loader']

When I try to add kmscube (simple example for bare metal graphics) then it gives the following error:

ERROR: Nothing PROVIDES 'virtual/egl' (but /home/toradex/oe-coreV5.6/build/../layers/openembedded-core/meta/recipes-graphics/kmscube/kmscube_git.bb DEPENDS on or otherwise requires it)
imx-gpu-viv PROVIDES virtual/egl but was skipped: incompatible with machine verdin-imx8mm (not in COMPATIBLE_MACHINE)
imx-gpu-viv PROVIDES virtual/egl but was skipped: missing required distro feature 'wayland' (not in DISTRO_FEATURES)
imx-gpu-viv PROVIDES virtual/egl but was skipped: incompatible with machine verdin-imx8mm (not in COMPATIBLE_MACHINE)
imx-gpu-viv PROVIDES virtual/egl but was skipped: missing required distro feature 'wayland' (not in DISTRO_FEATURES)
NOTE: Runtime target 'kmscube' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['kmscube', 'virtual/egl']
ERROR: Required build target 'image-gemac-dev' has no buildable providers.
Missing or unbuildable dependency chain was: ['image-gemac-dev', 'kmscube', 'virtual/egl']

Hi @Mowlwurf

I just realized that you are not even building for the same module as this thread is about (Colibri iMX6 vs Verdin iMX8MM).

NXP provides GPU drivers (related to imx-gpu-viv) exclusively for Wayland. Thus, what you are trying to do is not possible.

If you have another issue, please create a new thread.

Best regards,

Hi Henrique,

sorry for not pointing this out. I would not have thought that this could be a problem.

But thanks for your answer.
Best regards,
Markus