Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Using platform eglfs for two screens

Using platform eglfs for two screens

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    beckseba
    wrote on last edited by beckseba
    #1

    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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Not a direct answer but wouldn't it be simpler to use Wayland as backend ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        beckseba
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What happens if you use the same mode for both screens ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved