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.

Pick-to: 5.15
Fixes: QTBUG-91184
Change-Id: I95f907dfa30057da0dca4ff32e0605c6bb10e0a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Pasi Petäjäjärvi 2021-03-30 17:40:03 +03:00
parent aa84de1afa
commit d8347bd9fe

View File

@ -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");