Giter Club home page Giter Club logo

quickmwtest's Introduction

Multi-screen test app for Qt 5.7 and up using the eglfs platform plugin. Targeted mainly at the NVIDIA DRIVE CX and Renesas R-Car H2 and H3, and is the test bed for QTBUG-55188, QTBUG-55161 and QTBUG-54151, QTBUG-57762, etc.

There will be one QQuickView created for each screen. With the default threaded render loop both will get its own render thread which is good since they can then be throttled independently.

Logging is enabled automatically, a typical output should be something like the following, assuming a mouse and two screens connected via HDMI and DisplayPort.

Pay special attention to lines like:

qt.qpa.eglfs.kms: Physical size is QSizeF(0, 0) mm for output "HDMI1"

This shows that the DRM subsystem did not report a physical width and height for the output in question. If this happens, you will want to manually provide the correct size via the JSON configuration file, see http://doc-snapshots.qt.io/qt5-5.8/embedded-linux.html#eglfs-with-eglfs-kms-backend

qt.qpa.eglfs.kms: Sorted screen list: QVector(OrderedScreen(0x44a3d0 : 2147483647), OrderedScreen(0x44b700 : 2147483647))
qt.qpa.eglfs.kms: Adding screen 0x44a3d0 to QPA with geometry QRect(0,0 1920x1200)
qt.qpa.eglfs.kms: Adding screen 0x44b700 to QPA with geometry QRect(1920,0 1920x1080)
...
Application sees 2 screens
(QScreen(0x449d80, name="DP1"), QScreen(0x449d40, name="HDMI1"))

This shows what gets registered to Qt. In the example above two QScreen instances will show in QGuiApplication::screens(), with different resolutions (not necessarily ideal), with the HDMI screen placed to the right of the DisplayPort one in the virtual desktop.

NB! future Qt versions are expected to improve logging; there are also continuous improvements to the multiscreen support in general, so do not be surprised if something looks different with newer Qt versions

If there are additional, unexpected outputs (some boards tend to report LVDS as connected even when it is not, for instance), disable it via the config file.

Same goes if the resolution or the virtual desktop layout is not as expected: provide a config file. As an example, check example_rcar_h2_config.json. There we configure HDMI and VGA to 720p and get rid of an unwanted third output, and we manually specify the physical size for the VGA output as it does not get reported automatically. To use this configuration in Qt applications, just set the environment variable QT_QPA_EGLFS_KMS_CONFIG=example_rcar_h2_config.json

Full example log:

nvidia@nvidia:~$ ./quickmwtest
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_kms_egldevice")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms_egldevice")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms_egldevice"
qt.qpa.eglfs.kms: New DRM/KMS on EGLDevice integration created
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms_egldevice"

qt.qpa.eglfs.kms: Found 1 EGL devices
qt.qpa.eglfs.kms: Opening DRM device drm-nvdc
qt.qpa.eglfs.kms: Creating display
qt.qpa.eglfs.kms: "DP1" mode count: 10
qt.qpa.eglfs.kms: mode 0 1920 x 1200 @ 59 hz
qt.qpa.eglfs.kms: mode 1 720 x 400 @ 70 hz
qt.qpa.eglfs.kms: mode 2 640 x 480 @ 59 hz
qt.qpa.eglfs.kms: mode 3 800 x 600 @ 60 hz
qt.qpa.eglfs.kms: mode 4 1024 x 768 @ 60 hz
qt.qpa.eglfs.kms: mode 5 1280 x 960 @ 60 hz
qt.qpa.eglfs.kms: mode 6 1280 x 1024 @ 60 hz
qt.qpa.eglfs.kms: mode 7 1600 x 1200 @ 60 hz
qt.qpa.eglfs.kms: mode 8 1680 x 1050 @ 59 hz
qt.qpa.eglfs.kms: mode 9 1920 x 1080 @ 60 hz
qt.qpa.eglfs.kms: Selected mode 0 : 1920 x 1200 @ 59 hz for output "DP1"
qt.qpa.eglfs.kms: Physical size is QSizeF(0, 0) mm for output "DP1"
qt.qpa.eglfs.kms: Creating new global mouse cursor
qt.qpa.eglfs.kms: "HDMI1" mode count: 11
qt.qpa.eglfs.kms: mode 0 1920 x 1080 @ 59 hz
qt.qpa.eglfs.kms: mode 1 640 x 480 @ 59 hz
qt.qpa.eglfs.kms: mode 2 800 x 600 @ 56 hz
qt.qpa.eglfs.kms: mode 3 800 x 600 @ 60 hz
qt.qpa.eglfs.kms: mode 4 1024 x 768 @ 60 hz
qt.qpa.eglfs.kms: mode 5 1280 x 800 @ 59 hz
qt.qpa.eglfs.kms: mode 6 1280 x 960 @ 60 hz
qt.qpa.eglfs.kms: mode 7 1280 x 1024 @ 60 hz
qt.qpa.eglfs.kms: mode 8 1440 x 900 @ 59 hz
qt.qpa.eglfs.kms: mode 9 1600 x 1200 @ 60 hz
qt.qpa.eglfs.kms: mode 10 1680 x 1050 @ 59 hz
qt.qpa.eglfs.kms: Selected mode 0 : 1920 x 1080 @ 59 hz for output "HDMI1"
qt.qpa.eglfs.kms: Physical size is QSizeF(0, 0) mm for output "HDMI1"

qt.qpa.eglfs.kms: Sorted screen list: QVector(OrderedScreen(0x44a3d0 : 2147483647), OrderedScreen(0x44b700 : 2147483647))
qt.qpa.eglfs.kms: Adding screen 0x44a3d0 to QPA with geometry QRect(0,0 1920x1200)
qt.qpa.eglfs.kms: Adding screen 0x44b700 to QPA with geometry QRect(1920,0 1920x1080)

qt.qpa.input: evdevkeyboard: Using device discovery
...
qt.qpa.input: Found mouse at "/dev/input/event0"
qt.qpa.input: Found matching devices ("/dev/input/event0")
qt.qpa.input: Adding mouse at "/dev/input/event0"
qt.qpa.input: create mouse handler for "/dev/input/event0" ""
qt.qpa.input: evdevtouch: Using device discovery
...

Application sees 2 screens
(QScreen(0x449d80, name="DP1"), QScreen(0x449d40, name="HDMI1"))

Creating new QQuickView for screen 0x449d80
qt.scenegraph.general: threaded render loop
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.95 ms
qt.qpa.eglfs.kms: Creating stream
qt.qpa.eglfs.kms: Created stream 0x4d6ba1 on display 0x1
qt.qpa.eglfs.kms: Output has 6 layers
qt.qpa.eglfs.kms: Searching for id: 1000
qt.qpa.eglfs.kms:   [0] layer 0x4481d1 - crtc 1000
qt.qpa.eglfs.kms:   [1] layer 0x449ec1 - crtc 1001
qt.qpa.eglfs.kms:   [2] layer 0x449f01 - plane 4001
qt.qpa.eglfs.kms:   [3] layer 0x449f41 - plane 4002
qt.qpa.eglfs.kms:   [4] layer 0x449f81 - plane 4004
qt.qpa.eglfs.kms:   [5] layer 0x449fc1 - plane 4005
qt.qpa.eglfs.kms: Using layer 0x4481d1
qt.qpa.eglfs.kms: Stream producer format is QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 8, samples 0, swapBehavior 0, swapInterval 1, profile  0)
qt.qpa.eglfs.kms: Creating stream producer surface of size 1920x1200
qt.qpa.eglfs.kms: Created stream producer surface 0x4d8081
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.95 ms
qt.scenegraph.general: texture atlas dimensions: 2048x2048
qt.scenegraph.general: R/G/B/A Buffers:    8 8 8 0
qt.scenegraph.general: Depth Buffer:       24
qt.scenegraph.general: Stencil Buffer:     8
qt.scenegraph.general: Samples:            0
qt.scenegraph.general: GL_VENDOR:          NVIDIA Corporation
qt.scenegraph.general: GL_RENDERER:        GP10B (nvgpu)/integrated
qt.scenegraph.general: GL_VERSION:         OpenGL ES 3.2 NVIDIA 367.00
qt.scenegraph.general: GL_EXTENSIONS:      ...
qt.scenegraph.general: Max Texture Size:  32768
qt.scenegraph.general: Debug context:     false
qt.qpa.eglfs.kms: Setting mode

Creating new QQuickView for screen 0x449d40
qt.qpa.eglfs.kms: Creating stream
qt.qpa.eglfs.kms: Created stream 0x5bbec1 on display 0x1
qt.qpa.eglfs.kms: Output has 6 layers
qt.qpa.eglfs.kms: Searching for id: 1001
qt.qpa.eglfs.kms:   [0] layer 0x4481d1 - crtc 1000
qt.qpa.eglfs.kms:   [1] layer 0x449ec1 - crtc 1001
qt.qpa.eglfs.kms:   [2] layer 0x449f01 - plane 4001
qt.qpa.eglfs.kms:   [3] layer 0x449f41 - plane 4002
qt.qpa.eglfs.kms:   [4] layer 0x449f81 - plane 4004
qt.qpa.eglfs.kms:   [5] layer 0x449fc1 - plane 4005
qt.qpa.eglfs.kms: Using layer 0x449ec1
qt.qpa.eglfs.kms: Stream producer format is QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 8, samples 0, swapBehavior 0, swapInterval 1, profile  0)
qt.qpa.eglfs.kms: Creating stream producer surface of size 1920x1080
qt.qpa.eglfs.kms: Created stream producer surface 0x5bece1
qt.scenegraph.general: Using sg animation driver
qt.scenegraph.general: Animation Driver: using vsync: 16.95 ms
qt.scenegraph.general: texture atlas dimensions: 2048x2048
qt.qpa.eglfs.kms: Setting mode

quickmwtest's People

Contributors

alpqr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

quickmwtest's Issues

is not an issue

Have you any idea on how to work with the two screen united?
My goal is create an qml object that goes from screen 1 until the end of screen 2.

Thank you so much

Multidisplay support on R Car M2 porter board

Hi,
We are trying to run this multiple display application in porter board(Renesas r-car M2 Porter).
we cross-compiled qt 5.7 with enabled kms plugin, and we are getting below errors.

root@porter:~/test/quickmwtest-master# ./quickmwtest
qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_kms")
qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms")
qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms"
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms"
qt.qpa.eglfs.kms: Loading KMS setup from "example_rcar_h2_config.json"
qt.qpa.eglfs.kms: Configuration:
hwcursor: true
pbuffers: false
separateScreens: false
outputs: QMap(("LVDS", QMap(("mode", QVariant(QString, "1280x720"))("name", QVariant(QString, "LVDS"))("physicalHeight", QVariant(double, 336))("physicalWidth", QVariant(double, 597))))("LVDS1", QMap(("mode", QVariant(QString, "off"))("name", QVariant(QString, "LVDS1"))))("none", QMap(("mode", QVariant(QString, "1280x720"))("name", QVariant(QString, "none")))))
qt.qpa.eglfs.kms: Using DRM device "/dev/dri/card0" specified in config file
qt.qpa.eglfs.kms: Opening device "/dev/dri/card0"
qt.qpa.eglfs.kms: Creating GBM device for file descriptor 4 obtained from "/dev/dri/card0"
loaded module: libgbm_kms.so
Could not open egl display
Aborted

Can you please suggest which configuration i missing to cross-compile qt 5.7 so this error can be solved.

Thanks in advance.
OM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.