We're hiring!
*

Running Weston on a Raspbian

Robert Foss avatar

Robert Foss
June 03, 2016

Share this post:

Reading time:

Alt text

Progress in the VC4 graphics camp and the Wayland camp now enables us to run Weston on top of the drm backend for VC4 platforms. Previously software acceleration using pixman was needed, but this is no longer the case.

Additionally the rpi backend for weston is now being removed since it has been obsoleted by the improved drm layer.

Let's explore running hardware accelerated Weston on the Raspberry Pi.

Building Linux kernel

A comprehensive guide for building a recent Linux kernel for Raspberry Pi boards has been written by the Raspberry Pi foundation and is available here.

As of this writing the guide helps you build a v4.4 kernel which is good enough for our purposes.

Set up alternative install location

These build instructions are based on the Wayland instructions from freedesktop.org, but altered to target VC4 and Raspbian.

You probably don't want to install experimental builds of software among the usual software of your operating system, so let's define a prefix for where to install our builds.

# Change WLD to any location you like
export WLD=~/local
export LD_LIBRARY_PATH=$WLD/lib
export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/
export PATH=$WLD/bin:$PATH
export ACLOCAL_PATH=$WLD/share/aclocal
export ACLOCAL="aclocal -I $ACLOCAL_PATH"

# Needed by autotools
mkdir -p $WLD/share/aclocal


Installing dependencies

Start by installing the build dependencies of mesa, weston and wayland.

# Enable source packages
sudo sed -e "s/#\sdeb-src/deb-src/g" -i /etc/apt/sources.list
sudo apt update


The above step can alternatively be completed using the GUI of your package manager, by enabling source packages.

# Install build dependencies of mesa
sudo apt-get build-dep mesa

# Install build dependencies of wayland/weston
sudo apt-get install \
  libevdev libevdev-dev \
  libwacom libwacom-dev \
  libxkbcommon libxkbcommon-dev


Building Mesa

Configure and compile mesa with vc4, wayland and EGL support.

git clone git://anongit.freedesktop.org/mesa/mesa
cd mesa
./autogen.sh --prefix=$WLD \
  --enable-gles2 \
  --with-egl-platforms=x11,wayland,drm \
  --enable-gbm --enable-shared-glapi \
  --with-gallium-drivers=vc4 \
  --without-dri-drivers \
  --disable-va \
  --disable-vdpau \
  --disable-xvmc \
  --disable-omx
make -j4 && make install


Building Weston and dependencies

Weston and Wayland have a number of dependencies that also need to be fetched and built.

Wayland

Weston is a Wayland compositor, so we're going to have to build Wayland.

git clone git://anongit.freedesktop.org/wayland/wayland
cd wayland
./autogen.sh --prefix=$WLD
make -j4 && make install
cd ..

git clone git://anongit.freedesktop.org/wayland/wayland-protocols
cd wayland-protocols
./autogen.sh --prefix=$WLD
make install
cd ..


libinput

libinput is dependency of wasten, handles input devices like keyboards, touchpads and mice.

git clone git://anongit.freedesktop.org/wayland/libinput
cd libinput
./autogen.sh --prefix=$WLD
make -j4 && make install
cd ..


Weston

Finally we've built all of the dependencies of Weston and can now build it.

git clone git://anongit.freedesktop.org/wayland/weston
cd weston
./autogen.sh --prefix=$WLD \
  --disable-libunwind
make -j4 &&
sudo make install
cd ..


Running Weston

That wasn't so bad, it took a little while, but now we're ready to start Weston. Now, let's fire up a (virtual) terminal. Make sure that you're not running an X terminal, ssh terminal or serial terminal.

Running weston in this way depends on logind.

# Make sure that $DISPLAY is unset.
unset DISPLAY

# And that $XDG_RUNTIME_DIR has been set and created.
if test -z "${XDG_RUNTIME_DIR}"; then
  export XDG_RUNTIME_DIR=/tmp/${UID}-runtime-dir
  if ! test -d "${XDG_RUNTIME_DIR}"; then
    mkdir "${XDG_RUNTIME_DIR}"
    chmod 0700 "${XDG_RUNTIME_DIR}"1
  fi
fi

# Run weston:
weston


Try weston applications

Now that we're running weston, let's try some applications. They're located in the top level directory of weston.

  • weston-terminal
  • weston-flower
  • weston-gears
  • weston-smoke
  • weston-image
  • weston-view
  • weston-resizor
  • weston-eventdemo

When you've started all of your favorite applications you can grab a screenshot by pressing Super + s, which will save wayland-screenshot.png in your home directory.

 

Original post

Related Posts

Related Posts

Comments (2)

  1. COmarius:
    Feb 05, 2017 at 02:29 AM

    configure: error: Package requirements (libffi) were not met:

    No package 'libffi' found

    Consider adjusting the PKG_CONFIG_PATH environment variable if you
    installed software in a non-standard prefix.

    Alternatively, you may set the environment variables FFI_CFLAGS
    and FFI_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    pi@minibian:~/weston/wayland$

    Reply to this comment

    Reply to this comment

  2. Suciu:
    Feb 05, 2017 at 04:55 AM

    Did you try this ?, or ju just copied from wayland website.
    Every build and config complains about missing dependencies.

    Reply to this comment

    Reply to this comment


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

USB 3.0 preliminary support in U-boot for Radxa Rock-5B

31/05/2023

A while back I presented USB 2.0 host support that was added to U-boot for the Radxa Rock-5B RK3588 Rockchip board. This time, USB 3.0 was…

Radxa Rock-5B PCIe and RTL8125B networking in U-boot

18/05/2023

Work continues on the Radxa ROCK5B RK388, as PCIe and RTL8125B networking support in U-boot have now been added. Publishing code as Open…

Introducing Multiview for NVK

03/05/2023

NVK, an open-source Vulkan driver for NVIDIA hardware that is part of Mesa, now supports the Vulkan extension VK_KHR_multiview.

Adding bootloader support for USB 2.0 Host for Radxa ROCK 5B RK3588

27/04/2023

The beauty of Open Source is that we can reuse code written by many other people, keep their authorship, and credit them for their work,…

Meson & VSCode: Develop your project in a modern IDE

18/04/2023

Want to develop your Meson project in a modern IDE? Make sure to install Meson VSCode extension which is now fully functional with the recent…

Carlafox: Towards reliable open-source 3D perception

05/04/2023

Labeling errors are common in present open-source 3D perception datasets, which could have impactful consequences. To tackle this issue,…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2023. All rights reserved. Privacy Notice. Sitemap.