diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2021-03-30 17:40:03 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-06 09:23:37 +0000 |
commit | c936c1fbd73cfe29b44d61f5b9bb09f6b0f0bb0c (patch) | |
tree | 7936bbe6adfa146896527b319a4762f09951ea1e /src | |
parent | 02c2609acad4df5720d1f0b44a38a7e1752109b6 (diff) |
eglfs: Newer Nvidia libdrm provide device instead driver module name
In newer Nvidia proprietary libdrm binaries display device name is
actual device and not driver module name. Check which provided device
name has been returned with EGL_DRM_DEVICE_FILE_EXT to choose correct
function to open device.
Fixes: QTBUG-91184
Change-Id: I95f907dfa30057da0dca4ff32e0605c6bb10e0a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit d8347bd9fe6914cd8c9da4bbfebfa9fb230ef114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp index ea85ab89b1..2bfb8476ca 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevice.cpp @@ -58,7 +58,12 @@ bool QEglFSKmsEglDevice::open() { Q_ASSERT(fd() == -1); - int fd = drmOpen(devicePath().toLocal8Bit().constData(), nullptr); + int fd = -1; + + if (devicePath().compare("drm-nvdc") == 0) + fd = drmOpen(devicePath().toLocal8Bit().constData(), nullptr); + else + fd = qt_safe_open(devicePath().toLocal8Bit().constData(), O_RDWR); if (Q_UNLIKELY(fd < 0)) qFatal("Could not open DRM (NV) device"); |