Firefly Open Source Community

Title: Ubuntu 20.04, XServer and Qt applicatons with QOpenGLWidget [Print This Page]

Author: AntonBogomolov    Time: 8/12/2022 15:30
Title: Ubuntu 20.04, XServer and Qt applicatons with QOpenGLWidget
Hello!

Hardware: ITX-3588J and two monitors

Software:
Ubuntu 20.04.4 LTS (GNU/Linux 5.10.66 aarch64)
Qt version 5.12.8 installed on ITX-3588J by: sudo apt-get install build-essential qt5-default
X.Org X Server 1.20.8

When we trying to run a qt application with QOpenGLWidget on two monitors (the window has a size 3840x1080), there were problems.

First scenario (Used eglfs):

  1. sudo killall -3 gnome-shell
  2. export QT_QPA_PLATFORM=eglfs
  3. export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
  4. export QT_QPA_EGLFS_KMS_ATOMIC=1
  5. export QT_QPA_EGLFS_KMS_CONFIG=/home/firefly/kms_config.json
  6. ./ZeroCopyGLSample
Copy the code


kms_config.json are:
  1. {
  2.   "device": "/dev/dri/card0",
  3.   "outputs": [
  4.     {
  5.       "name": "HDMI1",
  6.       "mode": "1920x1080"
  7.     },
  8.     {
  9.       "name": "HDMI2",
  10.       "mode": "1920x1080"
  11.     }
  12.   ]
  13. }
Copy the code


Everything starts and works well, except that the application can only use one monitor, although qApp¡úscreens() correctly returns both devices. Attempts to create widgets with the geometry of the second monitor did not give the expected result.

Second scenario (Used Xserver):

xinit /home/firefly/testapps/OpenGL/ZeroCopyGLSample/ZeroCopyGLSample

The application starts, a window is created on two monitors, but OpenGL does not work correctly:
  1. QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
  2. QOpenGLWidget: Failed to create context
Copy the code


I would be grateful for any hint
Thanks for the help!




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1