Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not find DRM device" when trying to run Qt apps with EGLFS on Pi4 #1050

Closed
jclsn opened this issue Apr 13, 2022 · 6 comments
Closed

Comments

@jclsn
Copy link

jclsn commented Apr 13, 2022

Description
I have been trying to fix this for days now without success. I wanto run my application using eglfs, but I am getting the message Could not find DRM device!

My configuration is as follows

# Architecture of the host machine
SDKMACHINE ?= "x86_64"

# Extra packages

LICENSE_FLAGS_WHITELIST = "commercial"

IMAGE_INSTALL:remove = " \
  x11 \
  wayland \
"

IMAGE_INSTALL:append = " \
  coreutils \
  qtbase-examples \
  qtbase-plugins \
  qtbase-tools \
  qtdeclarative \
  qtdeclarative-plugins \
  qtdeclarative-qmlplugins \
  qtdeclarative-tools \
  qtimageformats-plugins \
  qtmultimedia \
  qtmultimedia-plugins \
  qtmultimedia-qmlplugins \
  qtquickcontrols2 \
  qtquicktimeline \
  qtscript \
  qtsvg \
  qtsvg-plugins \
  qtsystems \
  qtsystems-qmlplugins \
  qtsystems-tools \
  rsync \
"

PACKAGECONFIG:append:pn-qtbase = " \
  eglfs \
  gles2 \
  kms \
  "

# Image file system types to package
IMAGE_FSTYPES = "rpi-sdimg"

MACHINE ??= "raspberrypi4-64"
DISTRO ??= "poky"
BBMULTICONFIG ?= ""

Describe the results you received:
I cannot run my Qt application although Qt is configuring right according to this guide:

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 ............................ yes

I had no problems on Raspbian. So I am thinking that there must be something wrong with my meta-raspberrypi setup. I would think that the qtbase-%.bbappend would take care of providing the right configuration for the Pi4.

PACKAGECONFIG_GL:rpi = "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'gl', \
                        bb.utils.contains('DISTRO_FEATURES',     'opengl', 'eglfs gles2', \
                                                                       '', d), d)}"
PACKAGECONFIG_GL:append:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', ' kms', '', d)}"
PACKAGECONFIG_GL:append:rpi = " gbm"
PACKAGECONFIG_FONTS:rpi = "fontconfig"
PACKAGECONFIG:append:rpi = " libinput examples tslib xkbcommon"
PACKAGECONFIG:remove:rpi = "tests"

OE_QTBASE_EGLFS_DEVICE_INTEGRATION:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', 'eglfs_brcm', d)}"

do_configure:prepend:rpi() {
    # Add the appropriate EGLFS_DEVICE_INTEGRATION
    if [ "${@d.getVar('OE_QTBASE_EGLFS_DEVICE_INTEGRATION')}" != "" ]; then
        echo "EGLFS_DEVICE_INTEGRATION = ${OE_QTBASE_EGLFS_DEVICE_INTEGRATION}" >> ${S}/mkspecs/oe-device-extra.pri
    fi
}
RDEPENDS:${PN}:append:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' userland', d)}"
DEPENDS:append:rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' userland', d)}"

I have been playing around with a lot of values and have tried adding all of the above myself before finding this file, but am always coming to the same results.

@kraj
Copy link
Collaborator

kraj commented Apr 13, 2022

I have it working well with Yoe Distro on rpi4-64

@jclsn
Copy link
Author

jclsn commented Apr 13, 2022

@kraj I am using kas. Should the tool matter? In the docs also Kas is recommended

@kraj
Copy link
Collaborator

kraj commented Apr 13, 2022

@kraj I am using kas. Should the tool matter? In the docs also Kas is recommended

it matters, if you see in meta-yoe
there are bunch of changes to make qt5 work with eglfs.

@jclsn
Copy link
Author

jclsn commented Apr 13, 2022

Looks to me like only linuxfb was added if you compare it to the .bbappend from meta-raspberrypi

# This does not work when wayland and x11 both are enabled in DISTRO_FEATURES and x11 image
# is built but works ok for eglfs and wayland images
QT_CONFIG_FLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '-qpa wayland', \
                                         bb.utils.contains('DISTRO_FEATURES', 'x11', '', \
                                                          '-qpa eglfs', d), d)}"

PACKAGECONFIG:append = " libinput eglfs examples linuxfb tslib"

PACKAGECONFIG_GL = "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'gl', \
                    bb.utils.contains('DISTRO_FEATURES',     'opengl', 'eglfs gles2', \
                                     '', d), d)}"

And shouldn't these changes be in meta-raspberry Pi then, if they fix it?

@jclsn
Copy link
Author

jclsn commented Apr 15, 2022

@kraj I tried using the qtbase_%.bbappend from meta-yoe, but it did not change anything unfortunately

@jclsn
Copy link
Author

jclsn commented Apr 15, 2022

Problem was that I had dtoverlay=vc4-kms-v3d and not dtoverlay=vc4-fkms-v3d set in the ``config.txt```...

@jclsn jclsn closed this as completed Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants