Qt6 and EGLFS on Yocto
-
Hi,
I have a problem integrating Qt6 with EGLFS into my Yocto build.
Host: Ubuntu 22.04 (x86_64)
Target device: STM32MP157I 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-problemsCan 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 -
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.
-
-
@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?
-
@himanshu-d Have you solved this problem? I am facing the same issue.