Hi,
Thanks to the help of @max.tx, I could solve the issue and I’m now able to run a Qt application with EGLFS (no X11 or wayland) on a mainline kernel with the mesa provided etnaviv
driver. I answer my own question here with the addition of the required Qt settings, hoping that it might help someone in the future.
My kernel is from the linux-toradex.git
repo, branch toradex_4.19.y-rt
:
$ uname -r
4.19.50-rt22-yocto-preempt-rt
The necessary configuration is as follows.
-
Configure to use the mainline bsp in
local.conf
:MACHINEOVERRIDES .= “:use-mainline-bsp”
-
Add
opengl
to theDISTRO_FEATURES
, and removex11
andwayland
:DISTRO_FEATURES_append = " opengl"
DISTRO_FEATURES_remove = “x11 wayland” -
Configure Qt to enable
eglfs
and the required backends inqtbase_%.bbappend
. It is important to removegl
, because otherwise Qt tries to configure desktop opengl, which makes the configuration step fail.PACKAGECONFIG_append = " linuxfb eglfs gbm gles2 kms"
PACKAGECONFIG_remove = “gl xcb xcb-xinput” -
Run the Qt application with the following settings.
QT_QPA_PLATFORM=eglfs
QT_QPA_EGLFS_INTEGRATION=eglfs_kms
I’m using an HDMI output which I had to configure to use /dev/dri/card1
.
QT_QPA_EGLFS_ALWAYS_SET_MODE=1
QT_QPA_EGLFS_KMS_CONFIG=kms.json
Where kms.json
specifies the output
{
"device": "/dev/dri/card1",
"outputs": [ { "name": "HDMI1" } ]
}