package/qt6/qt6base: don't require gbm for eglfs
PATCH 1/1 package/qt6/qt6base: don't require gbm for eglfs
From: Fred Lefranc <[email protected]>
Hi all,
While trying to enable Qt 6 with the eglfs eglfs_viv backend on a 32-bit i.MX6 target (imx-gpu-viv, framebuffer output), I hit the package dependency-chain consistency error, because qt6base pulls in libgbm/libdrm unconditionally for eglfs even though the Vivante framebuffer EGL integration needs neither.
The root cause is that qt6base treats GBM as a hard requirement for *all* of eglfs, whereas GBM/KMS is only needed by the eglfs_kms backend. This patch decouples the two: eglfs now only requires libegl, and GBM/KMS support is enabled conditionally when a gbm provider is available.
Tested:
- i.MX6Q (Cortex-A9, glibc, EABIhf), imx-gpu-viv FB output: qt6base builds, libqeglfs-viv-integration.so is produced, and a Qt app runs with -platform eglfs / QT_QPA_EGLFS_INTEGRATION=eglfs_viv.
I wasn't sure whether maintainers prefer keeping a Config.in comment to explain that eglfs without gbm only provides vendor/fb backends - happy to add one. Feedback welcome.
Thanks,
Fred
Fred Lefranc (1):
package/qt6/qt6base: don't require gbm for eglfs
package/qt6/qt6base/Config.in | 2 +- package/qt6/qt6base/qt6base.mk | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-)
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH 1/1 package/qt6/qt6base: don't require gbm for eglfs
From: Fred Lefranc <[email protected]>
BR2_PACKAGE_QT6BASE_EGLFS currently has a hard "depends on BR2_PACKAGE_HAS_LIBGBM", and qt6base.mk unconditionally adds libgbm and libdrm to QT6BASE_DEPENDENCIES whenever eglfs is enabled. This is
incorrect: GBM is only needed by the eglfs_kms backend. Other eglfs device integrations, such as the Vivante framebuffer backend (eglfs_viv) used on 32-bit i.MX6, provide EGL and OpenGL ES without GBM or DRM.
As a result, eglfs cannot be enabled on i.MX6 (imx-gpu-viv only provides libgbm on the aarch64/i.MX8 blobs), and forcing it through triggers the dependency-chain consistency check:
package 'qt6base' has added 'libgbm' to its _DEPENDENCIES variable without selecting it or depending on it from Config.in.
Make GBM optional for eglfs:
- In Config.in, drop the hard dependency on BR2_PACKAGE_HAS_LIBGBM and keep only the libegl requirement, which every eglfs backend needs.
- In qt6base.mk, only pass -DFEATURE_gbm=ON/-DFEATURE_kms=ON and add libgbm/libdrm to the dependencies when a gbm provider is actually present (BR2_PACKAGE_HAS_LIBGBM). Otherwise pass -DFEATURE_gbm=OFF/-DFEATURE_kms=OFF so that the eglfs_kms backend is simply not built, while eglfs_viv (and other vendor backends) still are.
This keeps eglfs_kms working unchanged on platforms that do provide GBM (i.MX8, Raspberry Pi 4, ...) while allowing eglfs to be enabled on GBM-less platforms such as i.MX6 with the Vivante framebuffer output.
--- package/qt6/qt6base/Config.in | 2 +- package/qt6/qt6base/qt6base.mk | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-)
package/qt6/qt6base/Config.in +1 -1
@@ -74,7 +74,7 @@ comment "X.org XCB backend available if X.org is enabled" config BR2_PACKAGE_QT6BASE_EGLFS bool "eglfs support" depends on BR2_PACKAGE_HAS_LIBEGL - depends on BR2_PACKAGE_HAS_LIBGBM + depends on BR2_PACKAGE_HAS_LIBGBM || BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_FB depends on BR2_PACKAGE_QT6_GL_SUPPORTS select BR2_PACKAGE_QT6BASE_OPENGL
package/qt6/qt6base/qt6base.mk +10 -2
@@ -305,8 +305,16 @@ QT6BASE_CONF_OPTS += -DFEATURE_tslib=OFF endif ifeq ($(BR2_PACKAGE_QT6BASE_EGLFS),y) -QT6BASE_CONF_OPTS += -DFEATURE_egl=ON -DFEATURE_eglfs=ON -QT6BASE_DEPENDENCIES += libegl libgbm +QT6BASE_CONF_OPTS += -DINPUT_opengl=es2 -DFEATURE_egl=ON -DFEATURE_eglfs=ON +QT6BASE_DEPENDENCIES += libegl + +# Only pull in GBM/KMS/DRM when a gbm provider actually exists (i.MX8, RPi, etc.) +ifeq ($(BR2_PACKAGE_HAS_LIBGBM),y) +QT6BASE_CONF_OPTS += -DFEATURE_gbm=ON -DFEATURE_kms=ON +QT6BASE_DEPENDENCIES += libgbm libdrm +else +QT6BASE_CONF_OPTS += -DFEATURE_gbm=OFF -DFEATURE_kms=OFF +endif else QT6BASE_CONF_OPTS += -DFEATURE_eglfs=OFF endif
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hello,
Do you want any update on that one?
Best regards,
Fred
Quoted 78 lines · Fred Lefranc
From: Fred Lefranc <[email protected]>
BR2_PACKAGE_QT6BASE_EGLFScurrently has a hard "depends onBR2_PACKAGE_HAS_LIBGBM", and qt6base.mk unconditionally adds libgbm and libdrm toQT6BASE_DEPENDENCIESwhenever eglfs is enabled. This is
incorrect: GBM is only needed by theeglfs_kmsbackend. Other eglfs device integrations, such as the Vivante framebuffer backend (eglfs_viv) used on 32-bit i.MX6, provide EGL and OpenGL ES without GBM or DRM.As a result, eglfs cannot be enabled on i.MX6 (imx-gpu-viv only provides libgbm on the aarch64/i.MX8 blobs), and forcing it through triggers the dependency-chain consistency check:
package 'qt6base' has added 'libgbm' to its
_DEPENDENCIESvariable without selecting it or depending on it from Config.in.Make GBM optional for eglfs:
- In Config.in, drop the hard dependency on
BR2_PACKAGE_HAS_LIBGBMand keep only the libegl requirement, which every eglfs backend needs.- In qt6base.mk, only pass -DFEATURE_gbm=ON/-DFEATURE_kms=ON and add libgbm/libdrm to the dependencies when a gbm provider is actually present (
BR2_PACKAGE_HAS_LIBGBM). Otherwise pass -DFEATURE_gbm=OFF/-DFEATURE_kms=OFF so that theeglfs_kmsbackend is simply not built, whileeglfs_viv(and other vendor backends) still are.This keeps
eglfs_kmsworking unchanged on platforms that do provide GBM (i.MX8, Raspberry Pi 4, ...) while allowing eglfs to be enabled on GBM-less platforms such as i.MX6 with the Vivante framebuffer output.Signed-off-by Fred Lefranc <[email protected]>--- package/qt6/qt6base/Config.in | 2 +- package/qt6/qt6base/qt6base.mk | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-)package/qt6/qt6base/Config.in +1
-1@@ -74,7 +74,7 @@ comment "X.org XCB backend available if X.org is enabled" config BR2_PACKAGE_QT6BASE_EGLFS bool "eglfs support" depends on BR2_PACKAGE_HAS_LIBEGL - depends on BR2_PACKAGE_HAS_LIBGBM + depends on BR2_PACKAGE_HAS_LIBGBM || BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_FB depends on BR2_PACKAGE_QT6_GL_SUPPORTS select BR2_PACKAGE_QT6BASE_OPENGLpackage/qt6/qt6base/qt6base.mk +10
-3@@ -305,8 +305,16 @@ QT6BASE_CONF_OPTS += -DFEATURE_tslib=OFF endif ifeq ($(BR2_PACKAGE_QT6BASE_EGLFS),y) -QT6BASE_CONF_OPTS += -DFEATURE_egl=ON -DFEATURE_eglfs=ON -QT6BASE_DEPENDENCIES += libegl libgbm +QT6BASE_CONF_OPTS += -DINPUT_opengl=es2 -DFEATURE_egl=ON -DFEATURE_eglfs=ON +QT6BASE_DEPENDENCIES += libegl + +# Only pull in GBM/KMS/DRM when a gbm provider actually exists (i.MX8, RPi, etc.) +ifeq ($(BR2_PACKAGE_HAS_LIBGBM),y) +QT6BASE_CONF_OPTS += -DFEATURE_gbm=ON -DFEATURE_kms=ON +QT6BASE_DEPENDENCIES += libgbm libdrm +else +QT6BASE_CONF_OPTS += -DFEATURE_gbm=OFF -DFEATURE_kms=OFF +endif else QT6BASE_CONF_OPTS += -DFEATURE_eglfs=OFF endif --
Quoted 2 lines
2.34.1
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot