Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119308

Multiple screens setup does not work properly for QWidget with EGLFS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3
    • QPA: EGLFS
    • None
    • Linux/Yocto

    Description

      I am experimenting with dual monitors setup with KMS backend by following this blog:
      https://www.qt.io/blog/2016/09/19/qt-graphics-with-multiple-displays-on-embedded-linux
      That is basically using a config file, specifying 2 output entries, and setting QT_QPA_EGLFS_KMS_CONFIG.

      For simplicity, I use a minimal testing sample with some tweaks:

      int main(int argc, char *argv[])
      {
          qputenv("QT_QPA_EGLFS_KMS_CONFIG","kmsconfig.json");
          QApplication a(argc, argv);
      
          QList<QScreen*> screenList = a.screens();
      
          QQuickView w0;
          QQuickView w1;
      
          w0.setScreen(screenList.at(0));
          w0.setGeometry(QRect(screenList.at(0)->availableGeometry().topLeft(), QSize(128, 128)));
          w1.setScreen(screenList.at(1));
          w1.setGeometry(QRect(screenList.at(1)->availableGeometry().topLeft(), QSize(128, 128)));
      
          QTimer t0;
          QTimer t1;
          t0.setInterval(1000);
          t0.setSingleShot(true);
          t1.setInterval(1000);
          t1.setSingleShot(true);
          QObject::connect(&t0, &QTimer::timeout, &w0, [](){
              qDebug() << "Message from screen 0";
          });
          QObject::connect(&t1, &QTimer::timeout, &w1, [](){
              qDebug() << "Message from screen 1";
          });
      
          w0.showFullScreen();
          w1.showFullScreen();
      
          t0.start();
          t1.start();
      
          return a.exec();
      }
      

      It works as expected with QQuickView being set to each screen. Both are shown and QTimer also triggers output.

      But it does not work for QWidget. One can replace both QQuickView with QWidget. The result is that only 1 QWidget is shown on the second screen. It seems to be only a display issue since both QTimer still times out normally.

      I am testing with Raspberry Pi 4 + Boot2Qt 6.5.3. My config file is pretty standard:

      {
        "device": "/dev/dri/card0",
        "outputs": [
          {
            "name": "HDMI1",
            "mode": "1920x1080"
          },
          {
            "name": "HDMI2",
            "mode": "1920x1080"
          }
        ]
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes