backends/drm: use libdrm function for checking if a device is kms capable

This commit is contained in:
Xaver Hugl 2023-10-24 18:52:38 +02:00
parent 6e05314739
commit 1d77f896df

View file

@ -185,14 +185,11 @@ DrmGpu *DrmBackend::addGpu(const QString &fileName)
return nullptr;
}
// try to make a simple drm get resource call, if it fails it is not useful for us
drmModeRes *resources = drmModeGetResources(fd);
if (!resources) {
if (!drmIsKMS(fd)) {
qCDebug(KWIN_DRM) << "Skipping KMS incapable drm device node at" << fileName;
m_session->closeRestricted(fd);
return nullptr;
}
drmModeFreeResources(resources);
struct stat buf;
if (fstat(fd, &buf) == -1) {