platforms/drm: Properly detect if there are no DRM devices

If no primary gpu can be found, we need to quit.
master
Vlad Zahorodnii 3 years ago
parent 9f030ecd40
commit c4c46a089f

@ -192,16 +192,17 @@ bool DrmBackend::initialize()
{
connect(session(), &Session::activeChanged, this, &DrmBackend::activate);
connect(session(), &Session::awoke, this, &DrmBackend::turnOutputsOn);
std::vector<UdevDevice::Ptr> devices = m_udev->listGPUs();
if (devices.size() == 0) {
qCWarning(KWIN_DRM) << "Did not find a GPU";
return false;
}
std::vector<UdevDevice::Ptr> devices = m_udev->listGPUs();
for (unsigned int gpu_index = 0; gpu_index < devices.size(); gpu_index++) {
addGpu(std::move(devices.at(gpu_index)));
}
if (m_gpus.isEmpty()) {
qCWarning(KWIN_DRM) << "No suitable DRM devices have been found";
return false;
}
initCursor();
if (!updateOutputs())
return false;

Loading…
Cancel
Save