在具有4.14内核的IMX6上使用vivante GPU [英] Use vivante GPU on IMX6 with 4.14 kernel

查看:1645
本文介绍了在具有4.14内核的IMX6上使用vivante GPU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用yocto rocko/Linux 4.14.24开发IMX6QP,并且正在尝试使用GPU.

I am working on IMX6QP with yocto rocko / Linux 4.14.24 and I am trying to use the GPU.

我的yocto配置文件:

My yocto configuration file :

MACHINE ??= 'imx6qp-tx6-emmc'
DL_DIR ?= "${BSPDIR}/downloads"
SSTATE_DIR ?= "${BSPDIR}/sstate-cache"
DISTRO ?= 'karo-minimal'
PACKAGE_CLASSES ?= "package_deb"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
VIRTUAL-RUNTIME_init_manager = "sysvinit"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"
# EXTRA_IMAGE_FEATURES += "read-only-rootfs"

CORE_IMAGE_EXTRA_INSTALL += "openssh \
                 openssh-sftp-server iproute2 dnsmasq iperf3 \
                 v4l-utils curl vim gnutls alsa-utils iw \
                 usbutils pciutils i2c-tools can-utils libsocketcan wpa-supplicant \
                 gstreamer1.0 gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-base \
                 devmem2 iputils modutils-initscripts \
                 iptables iproute2-ss iproute2-tc bridge-utils hostapd \
                 ruby gdb \
                 qtbase-plugins \
                 qtbase-tools \
                 qtdeclarative \
                 qtdeclarative-tools \
                 qtdeclarative-qmlplugins \
                 qtmultimedia \
                 qtmultimedia-plugins \
                 qtmultimedia-qmlplugins \
                 qtsvg \
                 qtsvg-plugins \
                 qtsensors \
                 qtimageformats-plugins \
                 qtsystems \
                 qtsystems-tools \
                 qtsystems-qmlplugins \
                 qtscript \
                 qt3d \
                 qt3d-qmlplugins \
                 qt3d-tools \
                 qtgraphicaleffects-qmlplugins \
                 qtconnectivity-qmlplugins \
                 qtlocation-plugins \
                 qtlocation-qmlplugins \
                 cinematicexperience \
                     fb-test fbgrab fbida fbset-modes \
                 es2gears \
                 "

DISTRO_FEATURES_remove = " x11 wayland "
PACKAGECONFIG_append_pn-qtbase = " gles2 eglfs "
DISTRO_FEATURES_append = " opengles2 egl opengl gles gbm dri eglfs gles2 "

BB_NUMBER_THREADS = "1"
LICENSE_FLAGS_WHITELIST = "commercial"

当我运行es2gears或Qt5_CinematicExperience时,yocto会显示以下内容:

When I run es2gears or Qt5_CinematicExperience yocto displays this :

gbm: failed to open any driver (search paths /usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/etnaviv_dri.so: cannot open shared object file: No such file or directory
failed to load driver: etnaviv
gbm: failed to open any driver (search paths /usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory
failed to load driver: kms_swrast
Unable to create EGL surface (eglError: 12299)

在/usr/lib/dri文件夹中只有:swrast_dri.so

In the /usr/lib/dri folder there is only : swrast_dri.so

如何在该内核上使用vivante GPU?是否有可能? 在哪里可以找到不包含meta-freescale层的etnaviv驱动程序?

How can use the vivante GPU with this kernel? Is it possible? Where can I find the etnaviv driver without include meta-freescale layer?

目标是运行使用eglfs的Qt5应用程序.

The goal will be to run a Qt5 application that use eglfs.

在文件meta-karo/conf/machine/include/tx-base.inc中:

In the file meta-karo/conf/machine/include/tx-base.inc :

PREFERRED_PROVIDER_virtual/egl ?= "mesa"
PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
PREFERRED_PROVIDER_virtual/libg2d_mx6 ?= "mesa"
PREFERRED_PROVIDER_virtual/libg2d_mx6ul ?= ""

我添加了: CORE_IMAGE_INSTALL + ="imx-gpu-viv"

I added : CORE_IMAGE_INSTALL += "imx-gpu-viv"

在local.conf中,控制台显示:

in local.conf and the console displays :

ERROR: Nothing RPROVIDES 'imx-gpu-viv' (but /media/user/tx6qp-qt5-4.14/build/sources/poky/meta/recipes-core/images/core-image-minimal.bb RDEPENDS on or otherwise requires it)
imx-gpu-viv was skipped: PREFERRED_PROVIDER_virtual/libgles2 set to mesa, not imx-gpu-viv
NOTE: Runtime target 'imx-gpu-viv' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['imx-gpu-viv']
NOTE: Target 'core-image-minimal' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['core-image-minimal', 'imx-gpu-viv']
ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'imx-gpu-viv']

我的内核支持CONFIG_DRM_ETNAVIV

And my kernel supports CONFIG_DRM_ETNAVIV

我的板是在此页面上购买的Karo板.

My board is a Karo board bought on this page.

预先感谢, rBeal

Thanks in advance, rBeal

推荐答案

我也看到您也在使用KaRo TX6QP.我设法在运行QT5的情况下获得了eglfs TX6DL/TX6S/TX6QP.

I see you are using the KaRo TX6QP, too. I've managed to get eglfs with QT5 running on TX6DL/TX6S/TX6QP.

对于较新的内核(例如主线),您不希望使用不推荐使用的vivante-gpu驱动程序.把它扔出你的local.conf!您需要(或需要)用于内核和QP板的社区开发的mesa-etnaviv驱动程序.

For the newer Kernels (e.g. mainline) you don't want the deprecated vivante-gpu-driver. Toss that out of your local.conf! You want (or need) the community-developed mesa-etnaviv driver for your Kernel and QP-Board.

只需三个步骤,因为meta-karo已为从meta-karo/conf/machine/include/tx-base.inc

Only three Steps are needed, since meta-karo already enabled mesa for all boards like you pasted from the meta-karo/conf/machine/include/tx-base.inc

在您自己的元层中,创建具有以下内容的文件recipes-qt5/qt5/qtbase_%.bbappend:

In your own meta-layer create the file recipes-qt5/qt5/qtbase_%.bbappend with the following content:

# mx6q = TX6Q/TX6QP, this is the important part!
PACKAGECONFIG_GL_mx6q = "gbm gles2 kms"  
# mx6dl = TX6DL/TX6S
PACKAGECONFIG_GL_mx6dl = "gbm gles2 kms"
PACKAGECONFIG_GL_mx6sx = "gles2"
PACKAGECONFIG_GL_mx6sl = "${@base_contains('DISTRO_FEATURES', 'x11', ' gl', ' ', d)}"
PACKAGECONFIG_GL_mx6ul = "${@base_contains('DISTRO_FEATURES', 'x11', ' gl', ' ', d)}"
PACKAGECONFIG_GL_mx7 = "gles2"
QT_CONFIG_FLAGS_append_mx6q = "${@base_contains('DISTRO_FEATURES', 'x11', ' -no-eglfs', ' -eglfs', d)}"
QT_CONFIG_FLAGS_append_mx6dl = "${@base_contains('DISTRO_FEATURES', 'x11', ' -no-eglfs', ' -eglfs', d)}"
QT_CONFIG_FLAGS_append_mx6sx = "${@base_contains('DISTRO_FEATURES', 'x11', ' -no-eglfs', ' -eglfs', d)}"
QT_CONFIG_FLAGS_append_mx6sl = "${@base_contains('DISTRO_FEATURES', 'x11', ' -no-eglfs',  ' -no-opengl -linuxfb -no-eglfs -opengl es2 -no-xcb', d)}"
QT_CONFIG_FLAGS_append_mx6ul = "${@base_contains('DISTRO_FEATURES', 'x11', ' -no-eglfs',  ' -no-opengl -no-eglfs -linuxfb', d)}"
QT_CONFIG_FLAGS_append_mx7 = "${@base_contains('DISTRO_FEATURES', 'x11', ' -no-eglfs', ' -no-eglfs -linuxfb', d)}"

此.bbappend启用TX6 {Q,QP,DL,S,UL,ULL}的必要QT5-Options. 现在,QT5使用mesa-etnaviv所需的gdm模块构建其eglfs平台.

This .bbappend enables the neccessary QT5-Options for the TX6{Q,QP,DL,S,UL,ULL}. Now QT5 builds its eglfs-platform with the gdm module which is needed for the mesa-etnaviv .

同样,在您自己的层中创建文件recipes-graphics/mesa/mesa_17.1.7.bbappend. 但是还要检查17.1.7是否也是您的mesa版本!要检查您的mesa版本,请在poky/meta/recipes-graphics/mesa/mesa_[...].bb中搜索mesa食谱!

Again, in your own layer, create the file recipes-graphics/mesa/mesa_17.1.7.bbappend. But check if 17.1.7 is your version of mesa, too! To check your mesa-version search for the mesa-recipe in poky/meta/recipes-graphics/mesa/mesa_[...].bb!

在.bbappend中,粘贴以下内容:

In your .bbappend, paste the following:

# FIXME: mesa should support 'x11-no-tls' option
python () {
    overrides = d.getVar("OVERRIDES", True).split(":")
    if "imxgpu2d" not in overrides:
        return

    x11flag = d.getVarFlag("PACKAGECONFIG", "x11", False)
    d.setVarFlag("PACKAGECONFIG", "x11", x11flag.replace("--enable-glx-tls", "--enable-glx"))
}

# Enable Etnaviv support
PACKAGECONFIG_append = " gallium"
GALLIUMDRIVERS_append = ",etnaviv,imx"

最后两行是最重要的:启用gallium及其imx-etnaviv模块.

The last two lines are the most important: Enabling gallium and its imx-etnaviv module.

现在,您可以准备使用QT5-Etnaviv-Support烘焙自己的图像了!

Now you are ready to go and bake your own image with QT5-Etnaviv-Support!

两个.bbappends都不会修补qt5-qmake来使开箱即用的正确平台成为可能.

Both .bbappends don't patch the qt5-qmake to enable the right platform out of the box.

./yourapplication -platform eglfs

现在,您的应用程序应该可以解决问题并愉快地与egl一起运行.但是,您的QT5可能希望使用不同的eglfs-deviceintegration.您可以通过运行

Now your application should do the trick and happily run with egl. However, it could happen, that your QT5 wants to use a different eglfs-deviceintegration. You can check that by running

export QT_LOGGING_RULES="qt.qpa.*=true"
./yourapplication -platform eglfs

当QT抱怨它不支持仿真的egl或抱怨它无法加载eglfs_viv或eglfs_emu或eglfs_ *时,请尝试使用

When QT complains that it doesn't support emulated egl or complaints that it fails to load eglfs_viv or eglfs_emu or eglfs_* try to force it to the right deviceintegration (gbm) with

export QT_QPA_EGLFS_INTEGRATION=eglfs_gbm
./yourapplication -platform eglfs

这篇关于在具有4.14内核的IMX6上使用vivante GPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆