[platform/virtual] Prefer vgem device over render node

If the system has a virtual device and KWin is run on virtual platform
we can assume the user intended that KWin should use the virtual device
and not a render node of the system.

This might fix the random test failures on build.kde.org (T6546).
This commit is contained in:
Martin Flöser 2017-09-29 21:20:12 +02:00
parent 7c8003f7f6
commit d29d181e7c

View file

@ -67,11 +67,11 @@ void EglGbmBackend::initGbmDevice()
return;
}
QScopedPointer<Udev> udev(new Udev);
UdevDevice::Ptr device = udev->renderNode();
UdevDevice::Ptr device = udev->virtualGpu();
if (!device) {
// if we don't have a render node, try to find a virtual (vgem) device
qCDebug(KWIN_VIRTUAL) << "No render node, looking for a vgem device";
device = udev->virtualGpu();
// if we don't have a virtual (vgem) device, try to find a render node
qCDebug(KWIN_VIRTUAL) << "No vgem device, looking for a render node";
device = udev->renderNode();
}
if (!device) {
qCDebug(KWIN_VIRTUAL) << "Neither a render node, nor a vgem device found";