Skip to content

Wayland Weston support on TX1 TX2 Xavier Nano

Matt Madison edited this page Apr 26, 2019 · 2 revisions

Support for Wayland/Weston has been adapted from the open-source libraries and patches that NVIDIA has published, rather than using the binary-only libraries packaged into the L4T BSP.

DRM support

Unlike their recent driver releases for x86 platforms, NVIDIA does not provide kernel-level support for DRM/KMS on Tegra. Instead, the BSP includes a stripped-down and not-quite-ABI-compatible copy of libdrm.so (binary-only, of course) to emulate a minimal amount of userspace DRM support for bootstrapping EGLStreams.

This wasn't needed for running X11, since the BSP comes with an X display driver, but it is needed for running Weston. Unfortunately, the L4T libdrm library interfered with builds, since it causes segfaults when loaded into QEMU, which is used for generating GObject Introspection data files during a build.

To work around this issue, a shim library was created. On initialization, the shim checks if it's running on real hardware; if so, it dynamically loads all of the symbols from NVIDIA's libdrm.so and passes through all of the function calls to that library. If not, it has stubs that return error values for all of the libdrm APIs. Since none of the build-time emulation actually needs to call on any of these functions, this appears to work OK.

Mesa build changes

The Mesa build has been changed to:

  • disable its DRI drivers for Tegra platforms, since they aren't supported there
  • patch EGL and GLES2 headers to include the NVIDIA-specific extension headers, which are installed from the Tegra Multimedia API SDK.
  • For L4T R32.1 and later, enable libglvnd support.

xserver-xorg changes

The xserver-xorg build has also been changed to disable DRI and KMS support on Tegra platforms.

libglvnd

Starting with L4T R32.1, the BSP uses libglvnd rather than including pre-built copies of the OpenGL/EGL/GLES libraries.

egl-wayland

The egl-wayland extension is built from source, with an additional patch to correct an issue with detecting Wayland displays and surfaces. The recipe also installs the needed JSON file so that the extension can be found at runtime.

weston-eglstream

Besides the EGLStream/EGLDevice patches for Weston from ArchLinux, a couple of extra patches were needed to account for the pseudo-DRM support on Tegra.

The --use-egldevice option gets added to the command line when starting Weston to activate this support.

Testing

The following tests are performed:

  1. Verify that core-image-weston builds.
  2. Verify that weston starts at boot time.
  3. Verify that weston sample programs, such as weston-simple-egl, display appropriate output.
  4. Verify that the nveglglessink gstreamer plugin works with the winsys=wayland parameter by running a gstreamer pipeline to display an H.264 video. Note that the DISPLAY environment variable must not be set, per the NVIDIA documentation.
You can’t perform that action at this time.