Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_backend.cpp
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Line(s) | |||||
252 | void DrmBackend::openDrm() | 252 | void DrmBackend::openDrm() | ||
253 | { | 253 | { | ||
254 | connect(LogindIntegration::self(), &LogindIntegration::sessionActiveChanged, this, &DrmBackend::activate); | 254 | connect(LogindIntegration::self(), &LogindIntegration::sessionActiveChanged, this, &DrmBackend::activate); | ||
255 | UdevDevice::Ptr device = m_udev->primaryGpu(); | 255 | UdevDevice::Ptr device = m_udev->primaryGpu(); | ||
256 | if (!device) { | 256 | if (!device) { | ||
257 | qCWarning(KWIN_DRM) << "Did not find a GPU"; | 257 | qCWarning(KWIN_DRM) << "Did not find a GPU"; | ||
258 | return; | 258 | return; | ||
259 | } | 259 | } | ||
260 | m_devNode = device->devNode(); | 260 | m_devNode = qEnvironmentVariableIsSet("KWIN_DRM_DEVICE_NODE") ? qgetenv("KWIN_DRM_DEVICE_NODE") : QByteArray(device->devNode()); | ||
261 | int fd = LogindIntegration::self()->takeDevice(m_devNode.constData()); | 261 | int fd = LogindIntegration::self()->takeDevice(m_devNode.constData()); | ||
262 | if (fd < 0) { | 262 | if (fd < 0) { | ||
263 | qCWarning(KWIN_DRM) << "failed to open drm device at" << m_devNode; | 263 | qCWarning(KWIN_DRM) << "failed to open drm device at" << m_devNode; | ||
264 | return; | 264 | return; | ||
265 | } | 265 | } | ||
266 | m_fd = fd; | 266 | m_fd = fd; | ||
267 | m_active = true; | 267 | m_active = true; | ||
268 | QSocketNotifier *notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); | 268 | QSocketNotifier *notifier = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); | ||
▲ Show 20 Lines • Show All 529 Lines • Show Last 20 Lines |