Using platform eglfs for two screens
-
Hello,
I have several apps which are started separately from each other via a bash script. They are communicating via QtRemoteObjects. Two of them create a window which shall run on two different screens with a different resolution.
Now, I want to use eglfs with the following config:
app1
if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("1920")); qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("1080")); qputenv("QT_QPA_EGLFS_KMS_CONFIG", QByteArray("/etc/kms.conf")); qputenv("QT_QPA_EGLFS_INTEGRATION", QByteArray("eglfs_kms")); qputenv("QT_QPA_EGLFS_ALWAYS_SET_MODE", QByteArray("1")); qputenv("QT_LOGGING_RULES", QByteArray("qt.qpa.eglfs.kms=true"));
app2
if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("1366")); qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("512")); qputenv("QT_QPA_EGLFS_KMS_CONFIG", QByteArray("/etc/kms.conf")); qputenv("QT_QPA_EGLFS_INTEGRATION", QByteArray("eglfs_kms")); qputenv("QT_QPA_EGLFS_ALWAYS_SET_MODE", QByteArray("1")); qputenv("QT_LOGGING_RULES", QByteArray("qt.qpa.eglfs.kms=true"));
/etc/kms.conf
{ "device": "/dev/dri/card0", "hwcursor": true, "pbuffers": false, "separateScreens": true, "outputs": [ { "name": "DP3", "mode": "1920x1080", "touchDevice": "/dev/input/mouse1", "primary": true, "virtualindex": 0 }, { "name": "DP2", "mode": "1366x512", "virtualindex": 1 } ] }
I start both apps consecutively:
./app1 -platform eglfs ./app2 -platform eglfs
App1 works very well, however, app2 reports "Could not set DRM mode for screen DP3". I need for both apps OpenGL. I have only one framebuffer (fb0) so that using QT_QPA_EGLFS_FB is not working.
In qml the screens are assigned via the screen property.
Thanks a lot.
-
Hi,
Not a direct answer but wouldn't it be simpler to use Wayland as backend ?
-
Hi,
thanks for the response. Of course wayland could be a potential solution, are there any options with eglfs?
In case of wayland: I have two physical screens - each screen is addressed by one application (app1 and app2). Now, do I have to implement a compositor additionally and run both apps as client? I have problems to transfer the example https://doc.qt.io/qt-5/qtwaylandcompositor-multi-screen-example.html to my use case. In general, the documention is very well in explaining the idea behind wayland but not in how to apply it for specific use cases.
-
What happens if you use the same mode for both screens ?