i.MX6ULL GUI Demo + Browser

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

i.MX6ULL GUI Demo + Browser

4,769 Views
brianptl
Contributor III

Hi All,

I have the following hardware:

  • MCIMX6ULL-EVK Evaluation kit
  • NXP LCD8000-43T LCD Display

I have followed the linux Yocto build instructions from: L4.9.88_2.0.0_LINUX_DOCS

My ultimate goal is to get a web browser running and displaying on the LCD display. At the moment I would settle for _any_ GUI application displaying at all.

As I understand it, for the i.MX6ULL the following is true:

  • No vivante GPU, only G2D
  • Therefore no QT support since no GPU

I see that Wayland / Weston supports G2D so I am attempting to build this image to get something working.

i.MX_Reference_Manual.pdf, Rev.L4.9.88_2.0.0-ga, 05/2018 page 164

$ MACHINE=imx6ull14x14evk DISTRO=fsl-imx-xwayland source fsl-setup-release.sh -b build-
wayland
bitbake fsl-image-gui
On boot I can see the u-boot splash screen, and the open-embedded loading screen (from psplash I think). Finally the screen will show a cursor. So I know that some graphics capability is there.
If I then issue:
cat /dev/urandom > /dev/fb0
I get noise on the screen.

My next step is to try to start Weston.

Following the document i.MX_Reference_Manual.pdf, page 165

export FB_MULTI_BUFFER=1

I have then tried the following:

Command:

weston --tty=1 --device=/dev/fb0 --use-g2d=1 &

Response

[14:39:47.015] weston 3.0.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0
               Build: 3.0.0-208-g5b77bec4-dirty desktop-shell: Disable idle timeout [YOCIMX-2463] (2018-04-27 12:52:23 -0500)
[14:39:47.016] Command line: weston --tty=1 --device=/dev/fb0 --use-g2d=1
[14:39:47.016] OS: Linux, 4.9.88-imx_4.9.88_2.0.0_ga+g5e23f9d61147, #1 SMP PREEMPT Fri Dec 14 15:18:23 GMT 2018, armv7l
[14:39:47.017] Using config file '/etc/xdg/weston/weston.ini'
[14:39:47.018] Output repaint window is 16 ms maximum.
[14:39:47.018] Loading module '/usr/lib/libweston-3/drm-backend.so'
[14:39:47.018] Failed to load module: /usr/lib/libweston-3/drm-backend.so: cannot open shared object file: No such file or directory
[14:39:47.019] fatal: failed to create compositor backend

From this thread it seems that there is no drm-backend.so backend support on i.MX6.

I can see the following files however:

root@imx6ull14x14evk:~# ls -1 /usr/lib/libweston-3/
fbdev-backend.so
gl-renderer.so
wayland-backend.so
x11-backend.so
xwayland.so

So I tried the following:

Command:

weston --tty=1 --device=/dev/fb0 --use-g2d=1 -use-gl=0 --backend=fbdev-backend.so &

Response

root@imx6ull14x14evk:~# Date: 2018-12-14 UTC
[14:47:02.293] weston 3.0.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0
               Build: 3.0.0-208-g5b77bec4-dirty desktop-shell: Disable idle timeout [YOCIMX-2463] (2018-04-27 12:52:23 -0500)
[14:47:02.294] Command line: weston --tty=1 --device=/dev/fb0 --use-g2d=1 -use-gl=0 --backend=fbdev-backend.so
[14:47:02.294] OS: Linux, 4.9.88-imx_4.9.88_2.0.0_ga+g5e23f9d61147, #1 SMP PREEMPT Fri Dec 14 15:18:23 GMT 2018, armv7l
[14:47:02.296] Using config file '/etc/xdg/weston/weston.ini'
[14:47:02.297] Output repaint window is 16 ms maximum.
[14:47:02.310] Loading module '/usr/lib/libweston-3/fbdev-backend.so'
[14:47:02.335] Failed to load module: /usr/lib/libweston-3/fbdev-backend.so: undefined symbol: fbDestroyDisplay
[14:47:02.335] fatal: failed to create compositor backend

Command:

weston --tty=1 --device=/dev/fb0 --use-g2d=1 -use-gl=0 --backend=wayland-backend.so &

Response:

root@imx6ull14x14evk:~# Date: 2018-12-14 UTC
[14:50:13.569] weston 3.0.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0
               Build: 3.0.0-208-g5b77bec4-dirty desktop-shell: Disable idle timeout [YOCIMX-2463] (2018-04-27 12:52:23 -0500)
[14:50:13.570] Command line: weston --tty=1 --device=/dev/fb0 --use-g2d=1 -use-gl=0 --backend=wayland-backend.so
[14:50:13.570] OS: Linux, 4.9.88-imx_4.9.88_2.0.0_ga+g5e23f9d61147, #1 SMP PREEMPT Fri Dec 14 15:18:23 GMT 2018, armv7l
[14:50:13.571] Using config file '/etc/xdg/weston/weston.ini'
[14:50:13.572] Output repaint window is 16 ms maximum.
[14:50:13.573] Loading module '/usr/lib/libweston-3/wayland-backend.so'
[14:50:13.632] Error: Failed to connect to parent Wayland compositor: No such file or directory
               display option: (none), WAYLAND_DISPLAY=(not set)
[14:50:13.632] fatal: failed to create compositor backend

So my question is:

What am I doing wrong - is there a set of instructions I am missing to get Wayland / Weston running on the i.MX6ULL?

Update 1:

If I try the same on the L4.9.88_2.0.0_images_MX6UL7D example images, I get the same things, however I do see the following:

First to get the image to boot on the imx6ull, in u-boot, set the dtb to the correct one for the imx6ull (Note the extra lower-case L):

=> setenv fdt_file imx6ull-14x14-evk.dtb
=> saveenv
Saving Environment to MMC...
Writing to MMC(1)... done

Then on boot I see:

[  OK  ] Started Terminate Psplash Boot Screen.
[  OK  ] Started Permit User Sessions.
         Starting Weston Wayland Compositor (on tty7)...
[  OK  ] Started Serial Getty on ttymxc0.
[  OK  ] Started Getty on tty1.
[  OK  ] Reached target Login Prompts.
[  OK  ] Reached target Sound Card.
[  OK  ] Started Weston Wayland Compositor (on tty7).
[  OK  ] Started Kernel Logging Service.
[  OK  ] Created slice User Slice of root.
[  OK  ] Started Session c1 of user root.
         Starting User Manager for UID 0...
[  OK  ] Reached target Multi-User System.
         Starting Update UTMP about System Runlevel Changes...
[  OK  ] Started Update UTMP about System Runlevel Changes.
[  OK  ] Started User Manager for UID 0.

NXP i.MX Release Distro 4.9.88-2.0.0 imx6ul7d ttymxc0

imx6ul7d login:

I also found the following advice in the i.MX_Graphics_User's_Guide_Linux.pdf, Rev. 0, 05/2018, Page 70

[Chapter 9  G2D compositor on Weston]

edit the file /etc/default/weston as follows:

#!/bin/sh
OPTARGS="--xwayland --use-g2d=1"
GPU_VIV_EXT_RESOLVE=0

restart weston:

systemctl restart  weston

I see the screen flicker here, so maybe weston is running...

Run an example app:

export GPU_VIV_EXT_RESOLVE=0
weston-simple-egl

but this crashes and I get the following error:

weston-simple-egl: ../git/clients/simple-egl.c:901: main: Assertion `display.display' failed.
Aborted (core dumped)

I feel like I am close, but I think it should be easier than this...

Thanks,

Brian.

Labels (4)
0 Kudos
2 Replies

2,954 Views
brianptl
Contributor III

Changing the weston_3.0.0.bb file to remove egl as such:

Before:

PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \

After

PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland', '', d)} \

Gives the following:

...

n-mx6ul-poky-linux-gnueabi/weston/3.0.0-r0=/usr/src/debug/weston/3.0.0-r0 -fdebug-prefix-map=/home/brian/imx-yocto-bsp/build-wayland/tmp/work/cortexa7hf-neon-mx6ul-poky-linux-gnueabi/weston/3.0.0-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/brian/imx-yocto-bsp/build-wayland/tmp/sysroots/imx6ull-theopolis=  -c -o protocol/weston_simple_dmabuf_v4l-fullscreen-shell-unstable-v1-protocol.o `test -f 'protocol/fullscreen-shell-unstable-v1-protocol.c' || echo '../git/'`protocol/fullscreen-shell-unstable-v1-protocol.c
| ../git/clients/simple-dmabuf-drm.c: In function 'create_display':
| ../git/clients/simple-dmabuf-drm.c:758:15: warning: implicit declaration of function 'eglQueryString' [-Wimplicit-function-declaration]
|   extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|                ^~~~~~~~~~~~~~
| ../git/clients/simple-dmabuf-drm.c:758:30: error: 'EGL_NO_DISPLAY' undeclared (first use in this function)
|   extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|                               ^~~~~~~~~~~~~~
| ../git/clients/simple-dmabuf-drm.c:758:30: note: each undeclared identifier is reported only once for each function it appears in
| ../git/clients/simple-dmabuf-drm.c:758:46: error: 'EGL_EXTENSIONS' undeclared (first use in this function); did you mean '__EXTENSIONS__'?
|   extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
|                                               ^~~~~~~~~~~~~~
|                                               __EXTENSIONS__
| arm-poky-linux-gnueabi-gcc  -march=armv7ve -marm -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/brian/imx-yocto-bsp/build-wayland/tmp/sysroots/imx6ull-theopolis -DHAVE_CONFIG_H -I. -I../git  -I./libweston -I../git/libweston -I./clients -I./tests -I../git/shared -I./protocol -DDATADIR='"/usr/share"' -DLIBWESTON_MODULEDIR='"/usr/lib/libweston-3"' -DLIBEXECDIR='"/usr/libexec"' -DBINDIR='"/usr/bin"'  -Wall -Wextra -Wno-unused-parameter         -Wno-shift-negative-value -Wno-missing-field-initializers         -g -fvisibility=hidden         -Wstrict-prototypes -Wmissing-prototypes -Wsign-compare -I/home/brian/imx-yocto-bsp/build-wayland/tmp/sysroots/imx6ull-theopolis/usr/include/libdrm -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/brian/imx-yocto-bsp/build-wayland/tmp/work/cortexa7hf-neon-mx6ul-poky-linux-gnueabi/weston/3.0.0-r0=/usr/src/debug/weston/3.0.0-r0 -fdebug-prefix-map=/home/brian/imx-yocto-bsp/build-wayland/tmp/work/cortexa7hf-neon-mx6ul-poky-linux-gnueabi/weston/3.0.0-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/brian/imx-yocto-bsp/build-wayland/tmp/sysroots/imx6ull-theopolis=  -c -o protocol/weston_simple_dmabuf_v4l-linux-dmabuf-unstable-v1-protocol.o `test -f 'protocol/linux-dmabuf-unstable-v1-protocol.c' || echo '../git/'`protocol/linux-dmabuf-unstable-v1-protocol.c
| ../git/clients/simple-dmabuf-drm.c:759:21: warning: implicit declaration of function 'weston_check_egl_extension' [-Wimplicit-function-declaration]
|   if (extensions && !weston_check_egl_extension(extensions,
|                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
| Makefile:6782: recipe for target 'clients/weston_simple_dmabuf_drm-simple-dmabuf-drm.o' failed
| make[1]: *** [clients/weston_simple_dmabuf_drm-simple-dmabuf-drm.o] Error 1
| make[1]: *** Waiting for unfinished jobs....
| make[1]: Leaving directory '/home/brian/imx-yocto-bsp/build-wayland/tmp/work/cortexa7hf-neon-mx6ul-poky-linux-gnueabi/weston/3.0.0-r0/build'
| Makefile:3387: recipe for target 'all' failed
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/brian/imx-yocto-bsp/build-wayland/tmp/work/cortexa7hf-neon-mx6ul-poky-linux-gnueabi/weston/3.0.0-r0/temp/log.do_compile.4447)
ERROR: Task (/home/brian/imx-yocto-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-graphics/wayland/weston_3.0.0.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4081 tasks of which 4079 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/brian/imx-yocto-bsp/sources/meta-fsl-bsp-release/imx/meta-bsp/recipes-graphics/wayland/weston_3.0.0.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

...

In simple-dmabuf-drm.c there is the following code:

static struct display *
create_display(int is_immediate, int format)
{
    struct display *display;
    const char *extensions;

    display = malloc(sizeof *display);
    if (display == NULL) {
        fprintf(stderr, "out of memory\n");
        exit(1);
    }
    display->display = wl_display_connect(NULL);
    assert(display->display);

    display->req_dmabuf_immediate = is_immediate;
    display->req_dmabuf_modifiers = (format == DRM_FORMAT_NV12);


    /*
     * hard code format if the platform egl doesn't support format
     * querying / advertising.
     */
    extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
    if (extensions && !weston_check_egl_extension(extensions,
                "EGL_EXT_image_dma_buf_import_modifiers"))
        display->xrgb8888_format_found = 1;

    display->registry = wl_display_get_registry(display->display);
    wl_registry_add_listener(display->registry,
                 &registry_listener, display);
    wl_display_roundtrip(display->display);
    if (display->dmabuf == NULL) {
        fprintf(stderr, "No zwp_linux_dmabuf global\n");
        exit(1);
    }

    wl_display_roundtrip(display->display);

    if ((format == DRM_FORMAT_XRGB8888 && !display->xrgb8888_format_found) ||
        (format == DRM_FORMAT_NV12 && (!display->nv12_format_found ||
            !display->nv12_modifier_found))) {
        fprintf(stderr, "requested format is not available\n");
        exit(1);
    }

    return display;
}

Basically patch/comment out the stuff in bold and weston will compile. You need the .bb file edit above too so that egl code is not defined-in.

I can now run weston on the i.MX6ULL. It looks like the i.MX6ULL has been forgotten as the codebase has moved along...

Update 1:

Forgot to add, the following line was required to launch weston:

weston --tty=7 --device=/dev/fb0 --backend=fbdev-backend.so &

0 Kudos

2,954 Views
brianptl
Contributor III

OK, so I am pretty convinced the fbdev-backend is correct:

weston --tty=1 --device=/dev/fb0 --use-g2d=1 --use-gl=0 --backend=fbdev-backend.so &

Which gives the following error:

[08:57:00.248] weston 3.0.0
               http://wayland.freedesktop.org
               Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0
               Build: 3.0.0-208-g5b77bec-dirty desktop-shell: Disable idle timeout [YOCIMX-2463] (2018-04-27 12:52:23 -0500)
[08:57:00.249] Command line: weston --tty=1 --device=/dev/fb0 --use-g2d=1 --use-gl=0 --backend=fbdev-backend.so
[08:57:00.249] OS: Linux, 4.9.88-imx_4.9.88_2.0.0_ga+g5e23f9d, #1 SMP PREEMPT Tue May 1 03:58:29 CDT 2018, armv7l
[08:57:00.251] Using config file '/etc/xdg/weston/weston.ini'
[08:57:00.253] Output repaint window is 16 ms maximum.
[08:57:00.253] Loading module '/usr/lib/libweston-3/fbdev-backend.so'
[08:57:00.271] Failed to load module: /usr/lib/libweston-3/fbdev-backend.so: undefined symbol: fbDestroyDisplay
[08:57:00.271] fatal: failed to create compositor backend

Looking at the weston source code from the yocto build:

g2d-renderer.c, it has the following:

static void
g2d_renderer_destroy(struct weston_compositor *ec)
{
    struct g2d_renderer *gr = get_renderer(ec);

    wl_signal_emit(&gr->destroy_signal, gr);
    g2d_close(gr->handle);
#ifdef ENABLE_EGL
    if(gr->bind_display)
        gr->bind_display(gr->egl_display, gr->wl_display);
    eglTerminate(gr->egl_display);
    if(!gr->use_drm)
        fbDestroyDisplay(gr->display);
#endif
    free(ec->renderer);
    ec->renderer = NULL;

    /* remove use-g2d-renderer */
    char *dir, *path;
    dir = getenv("XDG_RUNTIME_DIR");
    path = malloc(strlen(dir) + 40);
    strcpy(path, dir);
    strcat(path, "/use-g2d-renderer");
    remove(path);
    free(path);
}

The weston_3.0.0.bb file has:

PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
                   clients launch"
#
# Compositor choices
#
# Weston on KMS
PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
# Weston on Wayland (nested Weston)
PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
# Weston on X11
PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
# Headless Weston
PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
# Weston on framebuffer
PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
# weston-launch
PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
# VA-API desktop recorder
PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
# Weston with EGL support
PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
# Weston with cairo glesv2 support

So I think maybe:

  • egl is enabled in the build
  • egl is not supported by the imx6ull?

Does anyone have any input here? I will try to work out how to disable egl and try again.

Thanks,

Brian.

0 Kudos