This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3354: Configuration for Qt5 based compositor with SGX

Part Number: AM3354

Tool/software: Linux

Hello,

I trying to build a setup with a AM3354 which should use a Qt5 qtwayland based compositor which we already have in use on an i.MX6.

For my setup I use meta-ti(rocko) + the ti-linux-kernel (mirrored from git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git).

Furthermore, I have set the preferred providers for:

PREFERRED_PROVIDER_virtual/egl= "ti-sgx-ddk-um"
PREFERRED_PROVIDER_virtual/libgles1 = "ti-sgx-ddk-um"
PREFERRED_PROVIDER_virtual/libgles2 = "ti-sgx-ddk-um"
PREFERRED_PROVIDER_virtual/libgl = "mesa-gl"
PREFERRED_PROVIDER_virtual/mesa = "mesa-gl"
PREFERRED_PROVIDER_libgbm = "libgbm"
PREFERRED_PROVIDER_libgbm-dev = "libgbm-dev"

and as suggested by meta-agl-bsp:

(gerrit.automotivelinux.org/.../gitweb

a bbappend for mesa-gl:

# Remove GBM support from Mesa
# TI Platforms provides own GBM library

PACKAGES_remove = "libgbm"
PACKAGES_remove = "libgbm-dev"

EXTRA_OECONF_remove = "--enable-gbm"

Additionally I added a qtbase.bbappend:

PACKAGECONFIG += " libinput \

                  fontconfig \
                  freetype \
                  ico \
                  gif \
                  xkbcommon-evdev \
                  mtdev \
                  gles2 \
                  accessibility \
                  eglfs \
                  kms \
                  gbm \
"

PACKAGECONFIG_remove = " examples \
                        tests \
"

Now I'm able to build an image which loads the PowerVR driver:

root# /etc/init.d/rc.pvr start
Loaded PowerVR consumer services.

and is able to start a Qt5 application(this is the example analogclock from qtbase) with eglfs backend.

root# ./analogclock --platform eglfs
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
failed to load module: /usr/lib/gbm/gbm_dri.so: cannot open shared object file: No such file or directory
failed to load module: /usr/lib/gbm/gbm_gallium_drm.so: cannot open shared object file: No such file or directory
loaded module : gbm_pvr.so
found valid GBM backend : gbm_pvr.so
Could not create buffer for cursor!
Failed to move cursor on screen LVDS1: -14


This works so far. Also starting of the qt wayland example compositor qwindow-compositor works on the eglfs backend. But if I start an application that should use the wayland backend, the compositor crashes with the following messages:

root# ./analogclock --platform wayland dup failed: Bad file descriptor
Using Wayland-EGL PVR:(Error): PVRSRVDestroyDeviceMemContext: Invalid params [0, ] Segmentation fault (core dumped) [1]+ Aborted (core dumped) /usr/share/qt5/examples/wayland/qwindow-compositor/qwindow-compositor --platform eglfs

Should this work?! Or did I configure something wrong?

Thx,
Hannes

  • Can you please share your weston.ini and weston.log under /var/log? Also, please share qtbase/build/config.summary.

    Below is the content of our Processor SDK build qtbase.bbappend and that works well with wayland backend.

    FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

    GLES_EXTRA_DEPS = "libdrm wayland"

    PACKAGECONFIG[gles2] = "-opengl es2 -eglfs,,virtual/libgles2 virtual/egl ${GLES_EXTRA_DEPS}"

    PR_append = ".arago12"

    QT_CONFIG_FLAGS += "-qpa ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', 'eglfs', d)}"

    QT_EGLFS_PATCHES = "\
    file://0001-calculator-Add-exit-button-for-non-window-environmen.patch \
    file://0002-animatedtiles-Add-exit-button-for-non-window-environ.patch \
    file://quit.png \
    "

    SRC_URI += "\
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', "${QT_EGLFS_PATCHES}", d)}\
    file://0001-deform-Fix-how-controls-are-shown.patch \
    file://0002-deform-disable-opengl-button.patch \
    "

    python do_patch_append() {
    import shutil

    work_dir = d.getVar("WORKDIR", True)
    s = d.getVar("S", True)

    if not bb.utils.contains('DISTRO_FEATURES','wayland',True,False,d):
    shutil.copy(os.path.join(work_dir,"quit.png"),os.path.join(s,"examples/widgets/animation/animatedtiles/images/"))
    }

    RDEPENDS_${PN} += "${PN}-conf"
  • Hello Manisha,

    thx for your reply.

    I can't give you anything related to weston because I don't use weston as I described before my setup consist of a Qt Wayland compositor (In this case the example qwindow-compositor) and an qt client.

    So no weston at all. 

    And I don't see anything new in the configuration settings you posted.

    Furthermore, I tried opengl examples from Qt directly like hellogl2 and openglwindow with the eglfs backend and they work fine.

    At the moment I completely clueless what is going on.

  • This is what we tried on the Processor SDK on AM57x GP EVM and it seems to work. The QPA that works is eglfs_kms, weston compositor is not running in this test but the backend used is Wayland-EGL.

    export QT_QPA_EGLFS_INTEGRATION=eglfs_kms

    root@am57xx-evm:~# /usr/share/qt5/examples/wayland/qwindow-compositor/qwindow-compositor -platform eglfs &
    [1] 2023
    root@am57xx-evm:~# failed to load module: /usr/lib/gbm/gbm_dri.so: cannot open shared object file: No such file or directory
    failed to load module: /usr/lib/gbm/gbm_gallium_drm.so: cannot open shared object file: No such file or directory
    loaded module : gbm_pvr.so
    found valid GBM backend : gbm_pvr.so
    No modes available for output "HDMI1"
    Failed to query EGL extensions

    root@am57xx-evm:~# /usr/share/qt5/examples/widgets/painting/deform/deform
    Using Wayland-EGL
    wlpvr: PVR Services Initialised
  • Our graphics software stack is common between the AM3335x, AM437x and AM57x and hence what works on AM57x should also work on AM335x. So was my comment above on AM57x for AM335x query. 

    Please help me understand why do you want to stay with QT wayland compositor and not the weston compositor? Processor SDK on AM335x supports weston compositor and compared to QT one, this should be more robust and feature complete. 

    We do not support QT compositor but quick run on our platform suggested that it works with eglfs_kms backend. Do you have access to AM335x GP EVM? If so, can try running your requirement on our EVM using our Processor SDK software.

  • Weston is an example compositor which does not fulfill our requirements. That's why we developed our own compositor based on the Qt Wayland compositor API. I only told you to use the qwindow compositor example because it's easy available and shows the same issues.

    We have this setup already running on other ARM CPUs.

    You tested on a AM57xx and I don't think that everything is the same there as it is on the AM3354. I don't have access to a EVM board and I don't think this is necessary.

  • Hi Johannes,

    I find on AM335x, the QT wayland qwindow compositor launches successfully using eglfs_kms backend, but QT client application is seen only partially on the screen and sometimes the compositor crashes when the touchscreen is touched multiple times. This observation is different then what you have reported. It seems you may have some package build related issue.

    It seems that default QT QPA eglfs or eglfs_kms doesn't support QT wayland compositor. Per below blog post, it appears that QT package has special QPA (eglfs_viv_wl) to support wayland compositor on i.MX6 platform.

    blog.qt.io/.../

    As mentioned earlier, we only supported weston compositor and QT wayland compositor is not supported on our platform. We we will need to align on next steps for this to be treated as new feature request.

    Regards,
    Manisha
  • Hi Johannes,

    We find that  qwindow_compositor on AM335x displays the desired graphics well for qt5 examples drawn using hardware accelerated rendering but draws black screen for examples using software rendering. 

    Examples that runs well -

    • opengl/qopenglwidget/qopenglwidget
    • opengl/2dpainting/2dpainting
    • quick/touchinteraction/touchinteraction
    • quick/particles/imageparticle/imageparticle
    • webenginewidgets/simplebrowser/simplebrowser

    Examples that draws black screen - 

    • widgets/painting/deform/deform
    • widgets/widgets/analogclock/analogclock

    Please note that these findings are using QT 5.7. We also find that qwindow compositor is having problem with user inputs for both the hardware accelerated and software rendered drawing. May be the user inputs are not mapped well with the touch co-ordinates and hence causing the compositor to crash when the user touch the screen multiple times. 

    We are continuing our investigation on black screen with software rendering and compositor crash with user input  on QT 5.7. 

  • Manisha, could you tell me which system image you've used? I have set my QT_QPA_EGLFS_INTEGRATION to eglfs_kms, but I am getting this error:

    :~# /usr/share/qt5/examples/wayland/qwindow-compositor/qwindow-compositor -platform eglfs &
    [1] 1071
    root@solix:~# qt.qpa.egldeviceintegration: Failed to load EGL device integration "eglfs_kms"
    EGL library doesn't support Emulator extensions
  • I used image from Processor  SDK Linux 4.2 on AM335x EVM.  The SDK was built using recipes configured by processor-sdk-04.02.00.09-config.txt

    Please check below wiki page  to get the right recipes for  4.2 SDK image. You can compare the QT5 build recipe from this config with yours.