Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt6 and EGLFS on Yocto

Qt6 and EGLFS on Yocto

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 4 Posters 4.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    chocblops
    wrote on last edited by chocblops
    #1

    Hi,

    I have a problem integrating Qt6 with EGLFS into my Yocto build.

    Host: Ubuntu 22.04 (x86_64)
    Target device: STM32MP157

    I prepared my Yocto build environment by cloning Poky (Kirkstone, 4.0.x), added the BSP support layers (meta-st-stm32mp and meta-st-stm32mp-addons, most recent version for Kirkstone) and finally meta-qt6 (branch 6.2). Machine and distro files are based on the templates from ST. Without any further modifications everything builds fine.

    To enable EGLFS I created a new layer containing a recipe qtbase_%.bbappend with the following content:

    PACKAGECONFIG_GL = " ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)} "
    PACKAGECONFIG:append = " eglfs kms gbm linuxfb fontconfig icu accessibility "
    QT_CONFIG_FLAGS += " -no-sse2 -no-opengles3"
    

    I added opengl to DISTRO_FEATURES and removed x11 and wayland. packagegroup-qt6-essentials, which is provided by meta-qt6, is added to IMAGE_INSTALL as well as inherit populate_sdk_qt6 to the image recipe. The content of populate_sdk_qt6.bbclass is

    inherit populate_sdk_qt6_base
    
    TOOLCHAIN_HOST_TASK:append = " nativesdk-packagegroup-qt6-toolchain-host-essentials"
    # TOOLCHAIN_TARGET_TASK:append = " packagegroup-qt6-modules"
    

    When I bitbake my image, the following error is thrown from qtbase-native:

     ERROR: Feature "eglfs": Forcing to "ON" breaks its condition:
         NOT ANDROID AND NOT APPLE AND NOT WIN32 AND NOT WASM AND NOT QNX AND QT_FEATURE_egl
     Condition values dump:
         ANDROID = "0"
         APPLE = ""
         WIN32 = ""
         WASM = "0"
         QNX = "0"
         QT_FEATURE_egl = "OFF"
    

    Configure summary:

     Building for: linux-g++ (x86_64, CPU features: mmx sse sse2)
     Compiler: gcc 11.3.0
     Build options:
       Mode ................................... release
       Optimize release build for size ........ no
       Fully optimize release builds (-O3) .... no
       Building shared libraries .............. yes
       Using C standard ....................... C11
       Using C++ standard ..................... C++17
       Using ccache ........................... no
       Using new DTAGS ........................ yes
       Relocatable ............................ yes
       Using precompiled headers .............. yes
       Using LTCG ............................. no
       Target compiler supports:
         SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
         AVX .................................. AVX AVX2
         AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
         Other x86 ............................ AES F16C RDRAND SHA
         Intrinsics without compiler architecture option  yes
       Sanitizers:
         Addresses ............................ no
         Threads .............................. no
         Memory ............................... no
         Fuzzer (instrumentation only) ........ no
         Undefined ............................ no
       Build parts ............................ libs tools
     Qt modules and options:
       Qt Concurrent .......................... yes
       Qt D-Bus ............................... yes
       Qt D-Bus directly linked to libdbus .... yes
       Qt Gui ................................. yes
       Qt Network ............................. yes
       Qt PrintSupport ........................ yes
       Qt Sql ................................. yes
       Qt Testlib ............................. yes
       Qt Widgets ............................. yes
       Qt Xml ................................. yes
     Support enabled for:
       Using pkg-config ....................... yes
       udev ................................... no
       Using system zlib ...................... yes
       Zstandard support ...................... no
       Thread support ......................... yes
     Common build options:
       Linker can resolve circular dependencies  yes
     Qt Core:
       backtrace .............................. no
       DoubleConversion ....................... yes
         Using system DoubleConversion ........ no
       GLib ................................... no
       ICU .................................... yes
       Using system libb2 ..................... no
       Built-in copy of the MIME database ..... yes
       cpp/winrt base ......................... no
       Tracing backend ........................ <none>
       Logging backends:
         journald ............................. no
         syslog ............................... no
         slog2 ................................ no
       PCRE2 .................................. yes
         Using system PCRE2 ................... yes
       CLONE_PIDFD support in forkfd .......... yes
     Qt Sql:
       SQL item models ........................ yes
     Qt Network:
       getifaddrs() ........................... yes
       IPv6 ifname ............................ yes
       libproxy ............................... no
       Linux AF_NETLINK ....................... yes
       OpenSSL ................................ yes
         Qt directly linked to OpenSSL ........ no
       OpenSSL 1.1 ............................ yes
       DTLS ................................... yes
       OCSP-stapling .......................... yes
       SCTP ................................... no
       Use system proxies ..................... yes
       GSSAPI ................................. no
       Brotli Decompression Support ........... no
     Qt Gui:
       Accessibility .......................... yes
       FreeType ............................... yes
         Using system FreeType ................ yes
       HarfBuzz ............................... no
         Using system HarfBuzz ................ no
       Fontconfig ............................. yes
       Image formats:
         GIF .................................. yes
         ICO .................................. yes
         JPEG ................................. no
           Using system libjpeg ............... no
         PNG .................................. yes
           Using system libpng ................ yes
       Text formats:
         HtmlParser ........................... yes
         CssParser ............................ yes
         OdfWriter ............................ yes
         MarkdownReader ....................... yes
           Using system libmd4c ............... no
         MarkdownWriter ....................... yes
       EGL .................................... no
       OpenVG ................................. no
       OpenGL:
         Desktop OpenGL ....................... no
         OpenGL ES 2.0 ........................ no
         OpenGL ES 3.0 ........................ no
         OpenGL ES 3.1 ........................ no
         OpenGL ES 3.2 ........................ no
       Vulkan ................................. no
       Session Management ..................... yes
     Features used by QPA backends:
       evdev .................................. yes
       libinput ............................... no
       INTEGRITY HID .......................... no
       mtdev .................................. no
       tslib .................................. no
       xkbcommon .............................. no
       X11 specific:
         XLib ................................. yes
         XCB Xlib ............................. yes
         EGL on X11 ........................... no
         xkbcommon-x11 ........................ no
         xcb-sm ............................... no
     QPA backends:
       DirectFB ............................... no
       EGLFS .................................. yes
       EGLFS details:
         EGLFS OpenWFD ........................ no
         EGLFS i.Mx6 .......................... no
         EGLFS i.Mx6 Wayland .................. no
         EGLFS RCAR ........................... no
         EGLFS EGLDevice ...................... yes
         EGLFS GBM ............................ yes
         EGLFS VSP2 ........................... no
         EGLFS Mali ........................... no
         EGLFS Raspberry Pi ................... no
         EGLFS X11 ............................ no
       LinuxFB ................................ yes
       VNC .................................... yes
       VK_KHR_display ......................... no
       QNX:
         lgmon ................................ no
         IMF .................................. no
       XCB:
         Using system-provided xcb-xinput ..... no
         GL integrations:
           GLX Plugin ......................... no
             XCB GLX .......................... no
           EGL-X11 Plugin ..................... no
       Windows:
         Direct 2D ............................ no
         Direct 2D 1.1 ........................ no
         DirectWrite .......................... no
         DirectWrite 3 ........................ no
     Qt Widgets:
       GTK+ ................................... no
       Styles ................................. Fusion Windows
     Qt Testlib:
       Tester for item models ................. yes
     Qt PrintSupport:
       CUPS ................................... no
     Qt Sql Drivers:
       DB2 (IBM) .............................. no
       InterBase .............................. no
       MySql .................................. no
       OCI (Oracle) ........................... no
       ODBC ................................... no
       PostgreSQL ............................. no
       SQLite ................................. no
         Using system provided SQLite ......... no
     Core tools:
       qmake tool ............................. yes
    

    Taking a closer look into the do_configure log file reveals that test HAVE_EGL succeeded although EGL is stated as "no" in the summary.

    -- Performing Test HAVE_EGL
    -- Performing Test HAVE_EGL - Success
    -- Found EGL: /.../build/tmp/work/x86_64-linux/qtbase-native/6.2.5-r0/recipe-sysroot-native/usr/include (found version "1.5") 
    

    libEGL.so is available in recipe-sysroot-native/usr/lib.

    This error was also described in another thread, but without solution:
    https://forum.qt.io/topic/105367/yocto-poky-thud-not-enabling-eglfs-and-opengl-es-2-0
    This seems similar (found EGL version, but missing HAVE_EGL flag):
    https://forum.qt.io/topic/131875/qt6-2-for-jetson-tx2nx-eglfs-configuration-problems

    Can anyone tell me what I am doing wrong or how to further narrow down the error? I know the build system changed from Qt5 to Qt6, but I'm not able to find the missing piece of information.

    Best regards
    Benjamin

    C 1 Reply Last reply
    0
    • C chocblops

      Hi,

      I have a problem integrating Qt6 with EGLFS into my Yocto build.

      Host: Ubuntu 22.04 (x86_64)
      Target device: STM32MP157

      I prepared my Yocto build environment by cloning Poky (Kirkstone, 4.0.x), added the BSP support layers (meta-st-stm32mp and meta-st-stm32mp-addons, most recent version for Kirkstone) and finally meta-qt6 (branch 6.2). Machine and distro files are based on the templates from ST. Without any further modifications everything builds fine.

      To enable EGLFS I created a new layer containing a recipe qtbase_%.bbappend with the following content:

      PACKAGECONFIG_GL = " ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)} "
      PACKAGECONFIG:append = " eglfs kms gbm linuxfb fontconfig icu accessibility "
      QT_CONFIG_FLAGS += " -no-sse2 -no-opengles3"
      

      I added opengl to DISTRO_FEATURES and removed x11 and wayland. packagegroup-qt6-essentials, which is provided by meta-qt6, is added to IMAGE_INSTALL as well as inherit populate_sdk_qt6 to the image recipe. The content of populate_sdk_qt6.bbclass is

      inherit populate_sdk_qt6_base
      
      TOOLCHAIN_HOST_TASK:append = " nativesdk-packagegroup-qt6-toolchain-host-essentials"
      # TOOLCHAIN_TARGET_TASK:append = " packagegroup-qt6-modules"
      

      When I bitbake my image, the following error is thrown from qtbase-native:

       ERROR: Feature "eglfs": Forcing to "ON" breaks its condition:
           NOT ANDROID AND NOT APPLE AND NOT WIN32 AND NOT WASM AND NOT QNX AND QT_FEATURE_egl
       Condition values dump:
           ANDROID = "0"
           APPLE = ""
           WIN32 = ""
           WASM = "0"
           QNX = "0"
           QT_FEATURE_egl = "OFF"
      

      Configure summary:

       Building for: linux-g++ (x86_64, CPU features: mmx sse sse2)
       Compiler: gcc 11.3.0
       Build options:
         Mode ................................... release
         Optimize release build for size ........ no
         Fully optimize release builds (-O3) .... no
         Building shared libraries .............. yes
         Using C standard ....................... C11
         Using C++ standard ..................... C++17
         Using ccache ........................... no
         Using new DTAGS ........................ yes
         Relocatable ............................ yes
         Using precompiled headers .............. yes
         Using LTCG ............................. no
         Target compiler supports:
           SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
           AVX .................................. AVX AVX2
           AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
           Other x86 ............................ AES F16C RDRAND SHA
           Intrinsics without compiler architecture option  yes
         Sanitizers:
           Addresses ............................ no
           Threads .............................. no
           Memory ............................... no
           Fuzzer (instrumentation only) ........ no
           Undefined ............................ no
         Build parts ............................ libs tools
       Qt modules and options:
         Qt Concurrent .......................... yes
         Qt D-Bus ............................... yes
         Qt D-Bus directly linked to libdbus .... yes
         Qt Gui ................................. yes
         Qt Network ............................. yes
         Qt PrintSupport ........................ yes
         Qt Sql ................................. yes
         Qt Testlib ............................. yes
         Qt Widgets ............................. yes
         Qt Xml ................................. yes
       Support enabled for:
         Using pkg-config ....................... yes
         udev ................................... no
         Using system zlib ...................... yes
         Zstandard support ...................... no
         Thread support ......................... yes
       Common build options:
         Linker can resolve circular dependencies  yes
       Qt Core:
         backtrace .............................. no
         DoubleConversion ....................... yes
           Using system DoubleConversion ........ no
         GLib ................................... no
         ICU .................................... yes
         Using system libb2 ..................... no
         Built-in copy of the MIME database ..... yes
         cpp/winrt base ......................... no
         Tracing backend ........................ <none>
         Logging backends:
           journald ............................. no
           syslog ............................... no
           slog2 ................................ no
         PCRE2 .................................. yes
           Using system PCRE2 ................... yes
         CLONE_PIDFD support in forkfd .......... yes
       Qt Sql:
         SQL item models ........................ yes
       Qt Network:
         getifaddrs() ........................... yes
         IPv6 ifname ............................ yes
         libproxy ............................... no
         Linux AF_NETLINK ....................... yes
         OpenSSL ................................ yes
           Qt directly linked to OpenSSL ........ no
         OpenSSL 1.1 ............................ yes
         DTLS ................................... yes
         OCSP-stapling .......................... yes
         SCTP ................................... no
         Use system proxies ..................... yes
         GSSAPI ................................. no
         Brotli Decompression Support ........... no
       Qt Gui:
         Accessibility .......................... yes
         FreeType ............................... yes
           Using system FreeType ................ yes
         HarfBuzz ............................... no
           Using system HarfBuzz ................ no
         Fontconfig ............................. yes
         Image formats:
           GIF .................................. yes
           ICO .................................. yes
           JPEG ................................. no
             Using system libjpeg ............... no
           PNG .................................. yes
             Using system libpng ................ yes
         Text formats:
           HtmlParser ........................... yes
           CssParser ............................ yes
           OdfWriter ............................ yes
           MarkdownReader ....................... yes
             Using system libmd4c ............... no
           MarkdownWriter ....................... yes
         EGL .................................... no
         OpenVG ................................. no
         OpenGL:
           Desktop OpenGL ....................... no
           OpenGL ES 2.0 ........................ no
           OpenGL ES 3.0 ........................ no
           OpenGL ES 3.1 ........................ no
           OpenGL ES 3.2 ........................ no
         Vulkan ................................. no
         Session Management ..................... yes
       Features used by QPA backends:
         evdev .................................. yes
         libinput ............................... no
         INTEGRITY HID .......................... no
         mtdev .................................. no
         tslib .................................. no
         xkbcommon .............................. no
         X11 specific:
           XLib ................................. yes
           XCB Xlib ............................. yes
           EGL on X11 ........................... no
           xkbcommon-x11 ........................ no
           xcb-sm ............................... no
       QPA backends:
         DirectFB ............................... no
         EGLFS .................................. yes
         EGLFS details:
           EGLFS OpenWFD ........................ no
           EGLFS i.Mx6 .......................... no
           EGLFS i.Mx6 Wayland .................. no
           EGLFS RCAR ........................... no
           EGLFS EGLDevice ...................... yes
           EGLFS GBM ............................ yes
           EGLFS VSP2 ........................... no
           EGLFS Mali ........................... no
           EGLFS Raspberry Pi ................... no
           EGLFS X11 ............................ no
         LinuxFB ................................ yes
         VNC .................................... yes
         VK_KHR_display ......................... no
         QNX:
           lgmon ................................ no
           IMF .................................. no
         XCB:
           Using system-provided xcb-xinput ..... no
           GL integrations:
             GLX Plugin ......................... no
               XCB GLX .......................... no
             EGL-X11 Plugin ..................... no
         Windows:
           Direct 2D ............................ no
           Direct 2D 1.1 ........................ no
           DirectWrite .......................... no
           DirectWrite 3 ........................ no
       Qt Widgets:
         GTK+ ................................... no
         Styles ................................. Fusion Windows
       Qt Testlib:
         Tester for item models ................. yes
       Qt PrintSupport:
         CUPS ................................... no
       Qt Sql Drivers:
         DB2 (IBM) .............................. no
         InterBase .............................. no
         MySql .................................. no
         OCI (Oracle) ........................... no
         ODBC ................................... no
         PostgreSQL ............................. no
         SQLite ................................. no
           Using system provided SQLite ......... no
       Core tools:
         qmake tool ............................. yes
      

      Taking a closer look into the do_configure log file reveals that test HAVE_EGL succeeded although EGL is stated as "no" in the summary.

      -- Performing Test HAVE_EGL
      -- Performing Test HAVE_EGL - Success
      -- Found EGL: /.../build/tmp/work/x86_64-linux/qtbase-native/6.2.5-r0/recipe-sysroot-native/usr/include (found version "1.5") 
      

      libEGL.so is available in recipe-sysroot-native/usr/lib.

      This error was also described in another thread, but without solution:
      https://forum.qt.io/topic/105367/yocto-poky-thud-not-enabling-eglfs-and-opengl-es-2-0
      This seems similar (found EGL version, but missing HAVE_EGL flag):
      https://forum.qt.io/topic/131875/qt6-2-for-jetson-tx2nx-eglfs-configuration-problems

      Can anyone tell me what I am doing wrong or how to further narrow down the error? I know the build system changed from Qt5 to Qt6, but I'm not able to find the missing piece of information.

      Best regards
      Benjamin

      C Offline
      C Offline
      chocblops
      wrote on last edited by
      #2

      I have not yet been able to find out why the problem occurs, but I have found a workaround. The EGLFS backend for Qt 6.2 in Yocto compiles without problems if QT_FEATURE_egl and QT_FEATURE_opengl are manually set to ON, e.g. by adding

      EXTRA_OECMAKE += "-DQT_FEATURE_egl=ON -DFEATURE_opengl=ON"
      

      to the recipe. I hope this information helps someone.

      H 1 Reply Last reply
      0
      • C chocblops has marked this topic as solved on
      • C chocblops

        I have not yet been able to find out why the problem occurs, but I have found a workaround. The EGLFS backend for Qt 6.2 in Yocto compiles without problems if QT_FEATURE_egl and QT_FEATURE_opengl are manually set to ON, e.g. by adding

        EXTRA_OECMAKE += "-DQT_FEATURE_egl=ON -DFEATURE_opengl=ON"
        

        to the recipe. I hope this information helps someone.

        H Offline
        H Offline
        himanshu.d
        wrote on last edited by
        #3

        @chocblops said in Qt6 and EGLFS on Yocto:

        FEATURE_opengl

        When I enabled EXTRA_OECMAKE. I am getting below error:

        ERROR: Feature "opengl": Forcing to "ON" breaks its condition:
            QT_FEATURE_opengl_desktop OR QT_FEATURE_opengl_dynamic OR QT_FEATURE_opengles2
        Condition values dump:
            QT_FEATURE_opengl_desktop = "OFF"
            QT_FEATURE_opengl_dynamic = "OFF"
            QT_FEATURE_opengles2 = "OFF"
        

        Could you please help me here?

        T 1 Reply Last reply
        0
        • H himanshu.d

          @chocblops said in Qt6 and EGLFS on Yocto:

          FEATURE_opengl

          When I enabled EXTRA_OECMAKE. I am getting below error:

          ERROR: Feature "opengl": Forcing to "ON" breaks its condition:
              QT_FEATURE_opengl_desktop OR QT_FEATURE_opengl_dynamic OR QT_FEATURE_opengles2
          Condition values dump:
              QT_FEATURE_opengl_desktop = "OFF"
              QT_FEATURE_opengl_dynamic = "OFF"
              QT_FEATURE_opengles2 = "OFF"
          

          Could you please help me here?

          T Offline
          T Offline
          TAERYA
          wrote on last edited by
          #4

          @himanshu-d Have you solved this problem? I am facing the same issue.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sefer
            wrote on last edited by sefer
            #5

            I had the same problem. It is critical for which device you are building QT6.
            In my case the EGL provider is libmali (Rockchip libMali.so). For other microcontrollers you must find some other solution.
            For Rockchip apply this patch:

            [https://github.com/agl-ic-eg/meta-rockchip-extra/tree/scarthgap-agl/dynamic-layers/meta-qt6/recipes-qt/qt6/qtbase]

            Patch content:

            From b745ade08dd3e3a9a14a32c1994c0bd7bfb8115f Mon Sep 17 00:00:00 2001
            From: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
            Date: Wed, 25 Sep 2024 22:45:07 +0900
            Subject: [PATCH] HACK qtbase build using libmali
            
            Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
            ---
             cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake | 2 +-
             cmake/FindGLESv2.cmake                                        | 2 +-
             2 files changed, 2 insertions(+), 2 deletions(-)
            
            diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake
            index 9ac8e2fa0c..c5561f7fdf 100644
            --- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake
            +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake
            @@ -81,7 +81,7 @@ find_path(EGL_INCLUDE_DIR
             )
             find_library(EGL_LIBRARY
                 NAMES
            -        EGL
            +        mali EGL
                 HINTS
                     ${PKG_EGL_LIBRARY_DIRS}
             )
            diff --git a/cmake/FindGLESv2.cmake b/cmake/FindGLESv2.cmake
            index 4730418209..16f79437e8 100644
            --- a/cmake/FindGLESv2.cmake
            +++ b/cmake/FindGLESv2.cmake
            @@ -8,7 +8,7 @@ include(CheckCXXSourceCompiles)
             if(EMSCRIPTEN)
                 set(HAVE_GLESv2 ON)
             else()
            -    find_library(GLESv2_LIBRARY NAMES GLESv2 OpenGLES)
            +    find_library(GLESv2_LIBRARY NAMES mali GLESv2 OpenGLES)
                 find_path(GLESv2_INCLUDE_DIR NAMES "GLES2/gl2.h" "OpenGLES/ES2/gl.h" DOC "The OpenGLES 2 include path")
                 find_package(EGL)
                 set(_libraries "${CMAKE_REQUIRED_LIBRARIES}")
            -- 
            2.25.1
            
            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved