From 51925567f6e28155e0d0263415fa245556bf663b Mon Sep 17 00:00:00 2001 From: Amir Maimon Date: Wed, 22 Sep 2021 15:07:08 +0300 Subject: [PATCH] platforms/drm: Fix explicitGpus check The check for explicitGpus in udev event handler was limited to new GPUs, and didn't consider changes to the GPU driver, eg. from vfio-pci to amdgpu --- src/plugins/platforms/drm/drm_backend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/drm/drm_backend.cpp b/src/plugins/platforms/drm/drm_backend.cpp index 1b3f786c83..abf42e8677 100644 --- a/src/plugins/platforms/drm/drm_backend.cpp +++ b/src/plugins/platforms/drm/drm_backend.cpp @@ -234,11 +234,11 @@ void DrmBackend::handleUdevEvent() if (!session()->isActive()) { continue; } + if (!m_explicitGpus.isEmpty() && !m_explicitGpus.contains(device->devNode())) { + continue; + } if (device->action() == QStringLiteral("add")) { - if (!m_explicitGpus.isEmpty() && !m_explicitGpus.contains(device->devNode())) { - continue; - } qCDebug(KWIN_DRM) << "New gpu found:" << device->devNode(); if (addGpu(device->devNode())) { updateOutputs();