ST意法半导体
直播中

哈哈哈

10年用户 821经验值
擅长:可编程逻辑
私信 关注
[问答]

我需要做什么才能在简单的RGB面板上运行QT示例呢?

我正在尝试在我们的自定义板上使用 st-example-image-qt (Ecosystem v2.1) 创建的构建上运行 QT 示例。我们有一个简单的 RGB 显示 800x480 分辨率,所以我修改了板上的 cursor.json 如下
{
“设备”:“/dev/dri/card0”,
“输出”:[
   { “名称”:“DPI1”,“模式”:“800x480”,“尺寸”:“800x480”}
],
“hwcursor”:假
但是当我尝试运行任何 QT 示例时,我收到以下错误
root@STM32mp1-midmark:/usr/share#psplash-drm-quit
root@stm32mp1-midmark:/usr/share# export QT_QPA_EGLFS_ALWAYS_SET_MODE="1"
root@stm32mp1-midmark:/usr/share# 例子/opengl/hellowindow/hellowindow
[ 1] 无法打开设备:没有那个文件或目录,再试一次...
[ 2] 无法打开设备:没有那个文件或目录,再试一次...
[ 3] 无法打开设备:没有那个文件或目录,请重试...
[ 4] 无法打开设备:没有那个文件或目录,再试一次...
[ 5] _OpenDevice(1086): FATAL: 无法打开设备,errno=No such file or directory。
[ 6] 无法打开设备:没有那个文件或目录,再试一次...
[ 7] 无法打开设备:没有那个文件或目录,再试一次...
[ 8] 无法打开设备:没有那个文件或目录,请重试...
[ 9] 无法打开设备:没有那个文件或目录,再试一次...
[ 10] _OpenDevice(1086): FATAL: 无法打开设备,errno=No such file or directory。
root@stm32mp1-midmark:/usr/share#
我需要做什么才能在简单的 RGB 面板上运行 QT 示例?
谢谢。










回帖(1)

杨秀珍

2022-12-7 09:28:01
问题是由于 QT 与 GPU 的依赖性……在 MP153 上不存在。
要使其工作,请按照以下顺序操作:

1 Prerequisites

Must be able to rebuild an OpenSTLinux image
2 OpenSTLinux QT images and SDK

OpenSTLinux distribution provides two examples of images based on the QT framework:

  • st-example-image-qt (requires 'openstlinux-eglfs' distro): only one QT application can access the screen. It is displayed in full-screen mode. This provides the best performance as the QT application accesses the screen without the overhead of a window manager.


  • st-example-image-qtwayland (requires 'openstlinux-weston' distro and ecosystem release ≥ v2.1.0 ): thanks to weston window management, QT applications are displayed in independent windows and can coexist on the same screen with other non-QT applications. The window management adds extra overhead, decreasing the overall performance of the QT application. If the QT application must run in full-screen mode, choose the previous image.
To build the images and the associated SDK, start installing the OpenSTLinux distribution with the procedure described in chapter Installing the OpenSTLinux distribution.
2.1 QT image and SDK with EGLFS

The QT image and SDK use QT back-end to run single QT applications in full-screen mode.
Initialize the OpenEmbedded build environment for the openstlinux-eglfs distro:
DISTRO=openstlinux-eglfs MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.shRead and accept EULA. Refer to Initializing the OpenEmbedded build environment for more details.
Build the image and the SDK:
bitbake st-example-image-qt bitbake st-example-image-qt -c populate_sdkRefer to Generating your own Starter and Developer Packages and How to create an SDK for OpenSTLinux distribution for more details.
Note: the legacy command bitbake meta-toolchain-qt5 is not recommended because the resulting SDK might miss some target packages.
The image can be flashed on the target board as in Flashing the built image.
The generated SDK is available in the tmp-glibc/deploy/sdk/ folder. It can be installed as described in Run the SDK installation script, using the following command:
./tmp-glibc/deploy/sdk/st-example-image-qt-openstlinux-eglfs-stm32mp1-x86_64-toolchain-4.0.4-openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23.sh -y -d /Developer-Package/SDK2.1.1 Selecting the display resolution and size in EGLFS

When using a display that accepts multiple resolutions, the preferred resolution can be specified by editing the board file /usr/share/qt5/cursor.json. For example, for an HDMI display, change the line:
{ "name": "HDMI1", "mode": "1280x720" },and enter one of the valid resolutions reported by the command:
modetestIf the current display resolution is higher than the resolution requested by the QT application, QT expands the application to run it in full screen. This can produce blurred images on the display and can impact the system performance.
The QT framework can be configured to use only one part of the overall display. For example, to use only an area of 400x300 pixels, add:
{ "name": "HDMI1", "mode": "1280x720", "size": "400x300" },2.2 QT image and SDK with weston/wayland

The QT image and SDK use QTwayland back-end to run QT applications in independent windows managed by weston. This requires ecosystem release ≥ v2.1.0 .
Initialize the OpenEmbedded build environment for the openstlinux-weston distro:
DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.shRead and accept EULA. Refer to Initializing the OpenEmbedded build environment for further details.
Build the image and the SDK:
bitbake st-example-image-qtwayland bitbake st-example-image-qtwayland -c populate_sdkRefer to Generating your own Starter and Developer Packages and How to create an SDK for OpenSTLinux distribution for further details.
Note: the legacy command bitbake meta-toolchain-qt5 is not recommended because the resulting SDK might miss some target packages.
The image can be flashed on the target board as in Flashing the built image.
The generated SDK is available in the tmp-glibc/deploy/sdk/ folder. It can be installed as described in Run the SDK installation script, using the following command:
./tmp-glibc/deploy/sdk/st-example-image-qtwayland-openstlinux-weston-stm32mp1-x86_64-toolchain-4.0.4-openstlinux-5.15-yocto-kirkstone-mp1-v22.11.23.sh -y -d /Developer-Package/SDK3 Building a QT application

Pre-existing QT applications are usually deployed as "project" with one or more .pro file. In such case, QT application can be easily build by qmake command.
Open the folder that contains the application, enable the QT SDK and compile the application:
cd . /environment-setup-cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi qmake && makeIf the application does not provide the .pro file, it can be created through the command qmake -project. Check qmake documentation for more information.
Note that, CMake tool begins to replace qmake tool and is being used more and more in different projects.


4 Hints to get better performance on embedded platforms

Embedded platforms don't share the same high performance as general-purpose personal computers (PC). QT applications that run correctly on a PC might require some adaptation and optimization to run on an embedded platform. Some examples and suggestion to develop or port a QT application to an embedded platform are given below:

  • Designers must understand the performance characteristics of their designs, and avoid creating solutions that end up being very expensive to render.
  • Use preferably Qt Quick instead of Qt Widget to ease designers in providing not only assets, layouts, etc., but to actually develop the relevant QML code, either by hand or by using the Designer integrated into Qt Creator. The resulting code is still code, and therefore must be reviewed.
  • Avoid having artwork that requires resizing at runtime (for instance, a full-HD background image, used on a 800x480 display). Instead, prepare all the artwork in the correct sizes. Avoid multiplying opacity level between elements, or big transparent areas in artwork.
  • Avoid overdrawing. Sometimes designs stack a lot alpha-blended visual elements on top of each other. This must be avoided as much as possible. When using OpenGL, QtQuick (directly, by setting QSG_VISUALIZE=overdraw, or through GammaRay) it can visualize the amount of overdraw in a given scene.
  • Avoid too much clipping. Same as, (ab)using clipping can reduce performance drastically. When disabling the depth/stencil buffers, only screen-aligned clipping is possible (because scissoring is used instead). The main problem with clipping is that it might get used inside reusable UI components such as, buttons, dials, etc. As a consequence, clipping might be all on the screen at the same time. (QSG_VISUALIZE=clip).
These practical examples are useful for end-users with basic hardware knowledge and for any QT applications. Giuseppe D'ANGELO from KDAB, explains this in this very good presentation.

但不要接受最终用户许可协议!!!
如果没有 EULA,则不会构建 vivante 驱动程序和相关库。
“mesa”包安装在 vivante 的位置。
Mesa 能够处理无 GPU 设备。
这个例子
/usr/share/examples/opengl/hellowindow/hellowindow
工作正常。很慢,因为完全模拟软件,但它有效!
举报

更多回帖

发帖
×
20
完善资料,
赚取积分