Neptune 3 UI - Configure Screens on Embedded Linux

The System UI of Neptune 3 has two top-level windows: A Center Console and an Instrument Cluster. They are not to be confused with application's center console (ApplicationCCWindow) and instrument cluster windows (ApplicationICWindow), which are composited in the aforementioned System UI counterparts. In this document we are referring only to the System UI top level windows.

On target hardware, where Neptune 3 UI would run on the EGLFS platform, each window will be displayed (full-screen) on its own screen (QScreen). The Center Console window will shown on the screen of index 0 and the Instrument Cluster on the screen of index 1 (if the target has a second screen, that is) as defined in the Qt.application.screens list (or QGuiApplication::screens(), from the C++ side).

It's possible to specify the order in which the device's displays are exposed by Qt in its screens list, therefore controlling where the Instrument Cluster and the Center Console are shown. To do that you have to supply Qt with a configuration file where you map a display name to its index in that screens' list.

The first step is finding out what are the names of the displays in the system. This is fairly simple. Just run the Qt tool called qtdiag in your target hardware and check the output. It will show information about the system and how Qt is configured there, including information about the displays. Below is a snippet of a qtdiag output from a system that has two external displays connected to it:

Screens: 2, High DPI scaling: inactive
# 0 "DP1" Depth: 32 Primary: yes
  Manufacturer: GEC
  Model: Onlap1503
  Serial number: 8888
  Geometry: 1920x1080+0+0 Available: 1920x1080+0+0
  Virtual geometry: 3520x1200+0+0 Available: 3520x1200+0+0
  2 virtual siblings
  Physical size: 350x200 mm  Refresh: 60 Hz Power state: 0
  Physical DPI: 139.337,137.16 Logical DPI: 139.337,137.16 Subpixel_None
  DevicePixelRatio: 1 Pixel density: 1
  Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

# 1 "DP2" Depth: 32 Primary: no
  Manufacturer: Eizo Nanao Corporation
  Model: L887
  Serial number: 56110036
  Geometry: 1600x1200+1920+0 Available: 1600x1200+1920+0
  Virtual geometry: 3520x1200+0+0 Available: 3520x1200+0+0
  2 virtual siblings
  Physical size: 410x310 mm  Refresh: 60 Hz Power state: 0
  Physical DPI: 99.122,98.3226 Logical DPI: 99.122,98.3226 Subpixel_None
  DevicePixelRatio: 1 Pixel density: 1
  Primary orientation: 2 Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

In this example, the screen "DP1" is assigned index 0 (default behavior, hence will show Center Console) and "DP2" index 1 (hence will show Instrument Cluster). If we want it the other way around: to have the Center Console on "DP2" and the Instrument Cluster on "DP1", we would have to write the following configuration file (in JSON format):

{
  "outputs": [
    {
      "name": "DP1",
      "virtualIndex": 1
    },
    {
      "name": "DP2",
      "virtualIndex": 0
    }
  ]
}

In order to make it work, we have to make neptune3-ui to use this configuration file on start-up. This is done via an environment variable named QT_QPA_EGLFS_KMS_CONFIG. Its value is the filepath of the configuration file you want to use. Eg:

QT_QPA_EGLFS_KMS_CONFIG=/home/foo/.config/neptune3-ui-display-config.js

For more information see Qt for Embedded Linux.

© 2018 Pelagicore AG. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.