Building Wayland-Weston for i.MX6

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Building Wayland-Weston for i.MX6

Building Wayland-Weston for i.MX6

The instructions is based on building wayland-weston on Ubuntu prebuilt image. The same can be applied to other build systems as well.

PREREQUISITIES

The following is the software environment required:

- Ubuntu Oneiric (11.10) distribution. (Download Pre-built Ubuntu demo image from www.freescale.com/imx6)

- Wayland/Weston : Wayland dependencies are listed in http://wayland.freedesktop.org/building.html.

- 0001-DRM-condition.patch and 0002-Enable-weston-for-Vivante-GPU.patches for Weston.

WAYLAND VERSION

This release is based on Wayland 1.1.0 version.

BUILDING

  1. The steps are based on wayland building from http://wayland.freedesktop.org/building.html.
  2. Download wayland-1.1.0.tar.xz from http://wayland.freedesktop.org/releases.html

   3. Setting up the environment. This need to be performed on the target

$export WLD=/usr

$export LD_LIBRARY_PATH=$WLD/lib

$export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/

$export ACLOCAL="aclocal -I $WLD/share/aclocal"

       Also, create the 'share/aclocal' directory.

               $mkdir -p $WLD/share/aclocal

      Let us consider, extracting the package to /opt

$cd /opt

$tar xvvf wayland-1.1.0.tar.xz

$cd wayland-1.1.0

$ ./configure --prefix=$WLD --disable-documentation

$ make

$ make install

  4. Setting up GPU-VIV graphics drivers

The GPU-VIV graphics drivers are available as part of BSP release.

Get the gpu-viv-wl-bin-mx6q-{VER}.tar.gz for 4.0.0 release gpu-viv-wl-bin-mx6q-3.0.35-4.0.0.tar.gz from the BSP-Source/pkgs

Extract to the target $ROOTFS

The prebuilt root file system (rootfs) may come with prebuilt GPU driver. By default, it may set to EGL framebuffer.

To enable Wayland/Weston support, make EGL and GAL point to correct binaries as shown below:

$ ls –l $(ROOTFS)/usr/lib/libEGL.so*

libEGL.so -> libEGL-wl.so

libEGL.so.1 -> libEGL-wl.so

$ ls –l $(ROOTFS)/usr/lib/libGAL.so

                           libGAL.so -> libGAL-wl.so

  5. Build the libxkbcommon as in http://wayland.freedesktop.org/building.html

6. We will need Cairo stack as Weston clients depend on Cairo for rendering. Please build Cairo as described in http://wayland.freedesktop.org/building.html, but note that, for now, we do not enable gl backend for Cairo, so the '--enable-gl --enable-xcb' flags must not be used when building.

7. Building Weston

    Now add the following environment settings in the terminal window. (Note the "`"- backtick - character).

export WLD=/usr

export LD_LIBRARY_PATH=$WLD/lib

export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/

export ACLOCAL="aclocal -I $WLD/share/aclocal"

export LD_LIBRARY_PATH="/usr/lib"

export LDFLAGS="-lwayland-server -lwayland-client -lwayland-server -lwayland-cursor -lpixman-1"

export COMPOSITOR_LIBS="-lGLESv2 -lEGL -lGAL -lwayland-server -lxkbcommon -lpixman-1"

export COMPOSITOR_CFLAGS="-I $WLD/include -I $WLD/include/pixman-1 -L$SDK_DIR/drivers -DLINUX=1 -DEGL_API_FB -DEGL_API_WL"

export CLIENT_CFLAGS="-I $WLD/include -I $WLD/include/cairo -I $WLD/include/pixman-1"

export CLIENT_LIBS="-lGLESv2 -lEGL -lwayland-client -lwayland-cursor -lxkbcommon"

export SIMPLE_EGL_CLIENT_CFLAGS="-DLINUX=1 -DEGL_API_FB -DEGL_API_WL -I $WLD/include"

export SIMPLE_EGL_CLIENT_LIBS="-lGLESv2 -lEGL -lwayland-client -lwayland-cursor"

export IMAGE_LIBS="-lwayland-cursor"

export WESTON_INFO_LIBS="-lwayland-client"

Apply the two patches 0001-DRM-condition.patch and 0002-Enable-weston-for-Vivante-GPU.patch.

Build the Weston.

$cd /opt

$tar xvvf weston-1.1.1.tar.xz

$ cd weston-1.1.1

    $ ./configure --prefix=$WLD \

        --disable-setuid-install \

        --disable-x11-compositor --disable-drm-compositor \

        --disable-rpi-compositor --disable-wayland-compositor \

        --disable-weston-launch --disable-libunwind \

        --disable-xwayland-test \

WESTON_NATIVE_BACKEND="fbdev-backend.so"

$ make

$ make install


RUNNING

Also, Weston must be run as root. copy weston.ini and weston-desktop-shell.ini to /root/.config/ . In terminal window,

export LD_LIBRARY_PATH="/usr/lib"

export XDG_RUNTIME_DIR=/tmp

Execute 'src/weston'. You should see a blue screen fading in. In a different terminal, enter 'clients/simple-shm &'. You should see a scrolling color pattern. You can then enter 'clients/simple-egl &' to see a 3D client  action.

Attachments
Comments

I am trying to compile Wayland and weston to not without X, When I am following the tuto, I get into this problem at compilation time of weston :

---------------------------------------------------------------------------------------------------------------------

checking for XWAYLAND... no

configure: error: Package requirements (xcb xcb-xfixes xcursor cairo-xcb) were not met:

No package 'xcursor' found

No package 'cairo-xcb' found

---------------------------------------------------------------------------------------------------------------------

So I changed the configure option --disable-xwayland-test to --disable-xwayland and then I get that :

---------------------------------------------------------------------------------------------------------------------

checking for FBDEV_COMPOSITOR... no

configure: error: Package requirements (libudev >= 136 mtdev >= 1.1.0 libdrm >= 2.4.30) were not met:

No package 'libudev' found

---------------------------------------------------------------------------------------------------------------------

Is it the good way to get your tuto done ? because systemd does not seem to be in ltib yet ...

And if add to configure --disable-fbdev-compositor

Everything is compiling but no fbdev-backend.so is present at the output ...

.... Up ....

Is there a way to at least build weston and wayland without X with GPU mx6 support with yocto ?

Thanks ...

We are also waiting for the solution. We tried with tuto but never success.

Will there be a tutorial on getting QtWayland and QtCompositor up and running?

Just running Weston will not get the features that one can get when using QtWayland and QtCompositor.

I have wayland/weston running on a debian rootfs using the latest (3.10.17_beta) libraries. Build instructions on the blog. Unfortunately there is still a dependency to pull in some X11 libraries due to cairo/pixman dependencies.

Which board do you use?

I use Sabre-lite faced some problem, wayland can't work with QtWayland.

I have got Wayland + QT + QTWayland working, it seems to be a bit of  mission especially since I chose to perform a native compile.

thanks for your reply.

I can't open your blog.

do you use ltib or based on any other things?

I use the kernel and rootfs built from timesys(egl from freescale) and compile wayland and Qt by myself, the building is ok, but the Qt + wayland can't work.

could you give me more details about you steps? thanks.

My rootfs is debian (sid) and kernel 3.10.17 beta.

1. I built wayland/weston from latest sources + my patch http://pastebin.com/x5gumsye

2. Test weston works with -wl libraries

3. Built qt5 from latest source

4. Test qt5 works with -fb libraries

5. Build qtwayland from lastest sources

6. To test qt5 examples need to pass -platform wayland-egl

All compilation was native (very slow) not using cross compilation.

get it.

where can I get the debian rootfs and the kernel? is it ok to following i.MX6x SABRE Lite - Linux on ARM - eewiki ?

thanks.

You can try with that roofts but you need to install vivante libraries.

Alternative you can try my debian sid with xfce rootfs. Use your uboot + kernel (this is for 3.10.9 alpha kernel and GPU (fb+x11) /VPU libraries), however you need to deploy -wl libraries, they are not on the rootfs.

You can update my rootfs to 3.10.17 beta kernel + vivante libraries afterwards.

I have got a iMX6Q board, using rootfs built from LTIB. I am able to run wayland in it without any problem. According to wayland/weston - The Weston Wayland Compositor weston does not call FBIO_WAITFORVSYNC ioctl, from the patch available in this thread it look like weston finishes the frame every ms. How the whole system works without tearing or any rendering issue?

Here is a link where weston has been built successfully : Configuring weston with yocto on i.MX6

FYI it works with yocto :

repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b master

repo sync

MACHINE=X source setup-environment build-X

bitbake core-image-weston

I faced a problem when running "weston-simple-egl".

The terminal shows someinfomation:

     [1]HAL user version 4.6.9 build 6622 Aug 16 2013 11:28:30

     [2]HAL kernel version 4.6.9 build 1210

     Segmentation fault (core dumped)

   kernel version : L3.0.35_4.1.0

   GPU-VIV : gpu-viv-wl-bin-mx6q-3.0.35-4.1.0

Could anyone tell me what happened?

Hi,

I'm facing the some issue, I need to get wayland working on the imx6 but i'm not understanding the  work flow,

Its suposed to build the elf file for the wayland on the host machine ? Or this process has to be done on the target ?

thanks in advance

Use yocto to build wayland/weston image on i.MX6 is really easy. Just try it.

Weston on i.MX6 need to patch and currently only work on fb-backend, see the meta-fsl-arm's recipes.

If you are willing to us the mainline kernel, you can also run the latest version of Weston without need for any patches.  The following blog talks about it:

Etnaviv now supported in Weston mainline 

No ratings
Version history
Last update:
‎08-12-2013 02:08 PM
Updated by: