[Interest] Qt examples and primary screen
Laszlo Agocs
laszlo.agocs at qt.io
Fri Dec 14 15:50:07 CET 2018
Hello,
Like you found out, category 2 are all QWidget apps. The advanced stuff in eglfs (like multiscreen, cloning, and such) may not be fully supported for the QWidget stack as the primary target on embedded is Qt Quick. You need to poke around in qtbase/src/platformsupport/platformcompositor and qtbase/src/plugins/platforms/eglfs if you want to enhance the support for this.
Best regards,
Laszlo
-----Original Message-----
From: Interest <interest-bounces at qt-project.org> On Behalf Of Mylène Josserand
Sent: Friday, December 14, 2018 3:16 PM
To: interest at lists.qt-project.org
Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Subject: [Interest] Qt examples and primary screen
Hello everyone,
I need some hints about some behaviors I have while running Qt examples. Here is my setup:
- a custom embedded platform based on IMX6
- Qt 5.11
- 2 displays: HDMI and LVDS
- a touchscreen on top of the LVDS
- want to be able to use only LVDS, only HDMI or both LVDS and HDMI
with cloning
- OpenGL support
To be able to choose between the different displays, we use json files, exported with QT_QPA_EGLFS_KMS_CONFIG variable:
- Both LVDS and HDMI:
{
"device": "/dev/dri/card1",
"outputs": [
{"name": "HDMI1", "mode": "1024x768", "primary":
false, "clones": "LVDS1" },
{ "name": "LVDS1", "mode": "1024x768", "primary": true } ]
}
- only LVDS:
{ "device": "/dev/dri/card1",
"outputs": [
{ "name": "HDMI1", "mode": "1920x1080", "primary": false },
{ "name": "LVDS1", "mode": "1024x768", "primary": true } ]
}
- only HDMI:
{ "device":"/dev/dri/card1",
"outputs": [
{ "name": "HDMI1", "mode": "1920x1080", "primary": true },
{ "name": "LVDS1", "mode": "1024x768", "primary": false } ]
}
After testing Qt examples, I noticed two different behaviors:
1.) Cloning is working fine, touchscreen is working on every
configuration: on "Qt5_CinematicExperience" and "hellowindow"
2.) Cloning is not working, touchscreen is working only on HDMI's
setup and application is shown on HDMI when LVDS is the primary
screen: on "hellogl2", "contextinfo", "cube"
The second case is the one I need help with. On these examples, I got the following behaviors according to the primary screen used:
- Cloning LVDS on HDMI reports an error:
"Screen HDMI1 clones another screen. swapBuffers() not allowed."
- HDMI as primary: everything works correctly. The application is
shown on HDMI display and the touchscreen is working fine.
- LVDS as primary: the application is shown on HDMI instead of LVDS
as expected. The touchscreen is not working at all.
We looked at these examples and they do not seem to use QML or QWindow. They are using a QWidget and it seems that it is not taken into account the primary screen. According to QWindow's description, this is normal for an application to use a QWidget directly.
http://doc.qt.io/qt-5/qwindow.html
"An application will typically use QWidget or QQuickView for its UI, and not QWindow directly."
Is it correct?
What should we implement to have the same behavior on examples that are using QWidget than the ones using a QWindow (such as "hellowindow")? Is it possible?
Thank you in advance for any help!
Mylène
--
Mylène Josserand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest
More information about the Interest
mailing list