QT5.6.3 and KMS/DRM backend is not rendering

Hi,

I have a QApplication on TX2 that renders on HDMI.
X11 is completely disabled and not present in system.
I use KMS/DRM as plaform for rendering, hence my startup configuration is:

QT_QPA_EGLFS_LAYER_INDEX = 2
QT_QPA_EGLFS_KMS_PLANE_INDEX = 1
QT_QPA_EGLFS_KMS_CONNECTOR_INDEX = 0
QT_QPA_PLATFORM = eglfs
QT_QPA_EGLFS_INTEGRATION = eglfs_kms_egldevice
QT_QPA_EGLFS_KMS_ATOMIC = 1
QT_QPA_EGLFS_ALWAYS_SET_MODE = 1
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

Whereas these setting work on QT 5.12 I am not able to make it work using QT 5.6.3, which is QT version I have to use in final product.

I see that KMS/DRM is supported Qt for Embedded Linux | Qt 5.6

I also see in log correct startup, see following log excerpt:

...
loaded library "/usr/lib/qt5/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.so"
qt.qpa.eglfs.kms: New DRM/KMS on EGLDevice integration created
qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms_egldevice"
qt.qpa.eglfs.kms: Found 1 EGL devices
qt.qpa.eglfs.kms: Opening drm-nvdc
qt.qpa.eglfs.kms: Using connector with type 11
qt.qpa.eglfs.kms: Using crtc 1000 with mode 1920 x 1200 @ 59
qt.qpa.eglfs.kms: DRM/KMS initialized
qt.qpa.eglfs.kms: Creating display
...
qt.qpa.eglfs.kms: Creating stream
qt.qpa.eglfs.kms: Created stream 0x5588cecd91 on display 0x5588b15f00
qt.qpa.eglfs.kms: Output has 6 layers
qt.qpa.eglfs.kms:   [0] layer 0x5588b1e0e1 - crtc 1000
qt.qpa.eglfs.kms:   [1] layer 0x5588b1fde1 - crtc 1001
qt.qpa.eglfs.kms:   [2] layer 0x5588b1fa11 - plane 4001
qt.qpa.eglfs.kms:   [3] layer 0x5588b1fa41 - plane 4002
qt.qpa.eglfs.kms:   [4] layer 0x5588b1faf1 - plane 4004
qt.qpa.eglfs.kms:   [5] layer 0x5588b1fb21 - plane 4005
qt.qpa.eglfs.kms: Using layer 0x5588b1fa11
qt.qpa.eglfs.kms: Stream producer format is QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 0, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 0, samples 0, swapBehavior 0, swapInterval 1, profile  0)
qt.qpa.eglfs.kms: Creating stream producer surface of size 1920x1200
qt.qpa.eglfs.kms: Created stream producer surface 0x5588b2d611
Created context for format QSurfaceFormat(version 2.0, options QFlags(), depthBufferSize 0, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 0, samples 0, swapBehavior 2, swapInterval 1, profile  0) with config:
	EGL_BUFFER_SIZE: 24
	EGL_ALPHA_SIZE: 0
	EGL_BLUE_SIZE: 8
	EGL_GREEN_SIZE: 8
	EGL_RED_SIZE: 8
	EGL_DEPTH_SIZE: 0
	EGL_STENCIL_SIZE: 0
	EGL_CONFIG_CAVEAT: 12344
	EGL_CONFIG_ID: 20
	EGL_LEVEL: 0
	EGL_MAX_PBUFFER_HEIGHT: 32768
	EGL_MAX_PBUFFER_PIXELS: 1073741824
	EGL_MAX_PBUFFER_WIDTH: 32768
	EGL_NATIVE_RENDERABLE: 0
	EGL_NATIVE_VISUAL_ID: 0
	EGL_NATIVE_VISUAL_TYPE: 12344
	EGL_SAMPLES: 0
	EGL_SAMPLE_BUFFERS: 0
	EGL_SURFACE_TYPE: 2049
	EGL_TRANSPARENT_TYPE: 12344
	EGL_TRANSPARENT_BLUE_VALUE: 0
	EGL_TRANSPARENT_GREEN_VALUE: 0
	EGL_TRANSPARENT_RED_VALUE: 0
	EGL_BIND_TO_TEXTURE_RGB: 0
	EGL_BIND_TO_TEXTURE_RGBA: 0
	EGL_MIN_SWAP_INTERVAL: 0
	EGL_MAX_SWAP_INTERVAL: 0
..

I tried various combinations, but no rendering works
No logs in kernel.

Can you help me understand if QT 5.6.3 DRM is maybe not supported on TX2 or if there is some different settings I have to use ?

Thanks
Martin

Hi,
QT is a 3rdparty implementation and we don’t have much experience in using it. MAy need other users to share experience.

Once issue we have seen is about QT + OpenCV:

This looks different from this topic. Simply for your reference.

Hi,

I found only one similar issue in forum, see [mmapi] how to make dual display(DP+DSI) show different video - #18 by WayneWWW

But in that issue QT version is 5.9 and QT KMS/DRM backends have been patched for custom needs, which is not needed in my case I think.

  • I checked that on both QT 5.6.3 and QT 5.12.4 device drm-nvdc is opened and layer plane 4001 is used for renderning.
  • fb0 win_mask setting is in both cases 0x38, which is what we need.
  • in both cases we use yocto recipes to build against.

Hi,

We didn’t try any Qt other than that 5.9. If there is missing patch in 5.6.3, then we cannot help.
Please contact the community of Qt for the compatibility of TX2 platform.

Ok thanks, will do!