Commit 9f030ecd authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

platforms/drm: Enable atomic modesetting in hot plugged gpus

At the moment, if a gpu is hot plugged, it won't have atomic modesetting
enabled.
parent 03c38e02
......@@ -202,12 +202,6 @@ bool DrmBackend::initialize()
addGpu(std::move(devices.at(gpu_index)));
}
// trying to activate Atomic Mode Setting (this means also Universal Planes)
if (!qEnvironmentVariableIsSet("KWIN_DRM_NO_AMS")) {
for (auto gpu : m_gpus)
gpu->tryAMS();
}
initCursor();
if (!updateOutputs())
return false;
......
......@@ -76,6 +76,12 @@ DrmGpu::DrmGpu(DrmBackend *backend, QByteArray devNode, int fd, dev_t deviceId)
m_socketNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, this);
connect(m_socketNotifier, &QSocketNotifier::activated, this, &DrmGpu::dispatchEvents);
// trying to activate Atomic Mode Setting (this means also Universal Planes)
static const bool atomicModesetting = !qEnvironmentVariableIsSet("KWIN_DRM_NO_AMS");
if (atomicModesetting) {
tryAMS();
}
}
DrmGpu::~DrmGpu()
......
......@@ -105,9 +105,7 @@ Q_SIGNALS:
void outputDisabled(DrmOutput *output);
protected:
friend class DrmBackend;
void tryAMS();
bool updateOutputs();
private:
......@@ -115,6 +113,7 @@ private:
DrmPlane *getCompatiblePlane(DrmPlane::TypeIndex typeIndex, DrmCrtc *crtc);
DrmOutput *findOutput(quint32 connector);
void removeOutput(DrmOutput *output);
void tryAMS();
DrmBackend* const m_backend;
AbstractEglBackend *m_eglBackend;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment