diff --git a/src/plugins/platforms/drm/drm_abstract_output.h b/src/plugins/platforms/drm/drm_abstract_output.h index e1e49e0bb0..15fe152729 100644 --- a/src/plugins/platforms/drm/drm_abstract_output.h +++ b/src/plugins/platforms/drm/drm_abstract_output.h @@ -32,7 +32,6 @@ public: virtual bool present(const QSharedPointer &buffer, QRegion damagedRegion) = 0; virtual bool needsSoftwareTransformation() const = 0; - virtual bool isDpmsEnabled() const = 0; virtual QSize sourceSize() const = 0; virtual bool isFormatSupported(uint32_t drmFormat) const = 0; virtual QVector supportedModifiers(uint32_t drmFormat) const = 0; diff --git a/src/plugins/platforms/drm/drm_backend.cpp b/src/plugins/platforms/drm/drm_backend.cpp index abf42e8677..3c6e691f2d 100644 --- a/src/plugins/platforms/drm/drm_backend.cpp +++ b/src/plugins/platforms/drm/drm_backend.cpp @@ -119,7 +119,7 @@ void DrmBackend::checkOutputsAreOn() return; } for (auto it = m_enabledOutputs.constBegin(), end = m_enabledOutputs.constEnd(); it != end; it++) { - if (!(*it)->isDpmsEnabled()) { + if ((*it)->dpmsMode() != AbstractWaylandOutput::DpmsMode::On) { // dpms still disabled, need to keep the filter return; } diff --git a/src/plugins/platforms/drm/drm_gpu.cpp b/src/plugins/platforms/drm/drm_gpu.cpp index c2c356dd84..e2d316618b 100644 --- a/src/plugins/platforms/drm/drm_gpu.cpp +++ b/src/plugins/platforms/drm/drm_gpu.cpp @@ -320,6 +320,9 @@ bool DrmGpu::updateOutputs() } else if (m_outputs.contains(output)) { // try setting hardware rotation output->updateTransform(output->transform()); + if (output->dpmsMode() != AbstractWaylandOutput::DpmsMode::On) { + pipeline->setActive(false); + } } else { qCDebug(KWIN_DRM).nospace() << "New output on GPU " << m_devNode << ": " << pipeline->connector()->modelName(); if (!output->initCursor(m_cursorSize)) { diff --git a/src/plugins/platforms/drm/drm_output.cpp b/src/plugins/platforms/drm/drm_output.cpp index 527e3244cf..75679111ea 100644 --- a/src/plugins/platforms/drm/drm_output.cpp +++ b/src/plugins/platforms/drm/drm_output.cpp @@ -256,7 +256,8 @@ void DrmOutput::setDrmDpmsMode(DpmsMode mode) return; } bool active = mode == DpmsMode::On; - if (active == m_pipeline->isActive()) { + bool isActive = dpmsMode() == DpmsMode::On; + if (active == isActive) { setDpmsModeInternal(mode); return; } @@ -433,11 +434,6 @@ DrmPipeline *DrmOutput::pipeline() const return m_pipeline; } -bool DrmOutput::isDpmsEnabled() const -{ - return m_pipeline->isActive(); -} - QSize DrmOutput::sourceSize() const { return m_pipeline->sourceSize(); diff --git a/src/plugins/platforms/drm/drm_output.h b/src/plugins/platforms/drm/drm_output.h index eda34fc4b0..465dd74838 100644 --- a/src/plugins/platforms/drm/drm_output.h +++ b/src/plugins/platforms/drm/drm_output.h @@ -48,7 +48,6 @@ public: bool present(const QSharedPointer &buffer, QRegion damagedRegion) override; void pageFlipped(); - bool isDpmsEnabled() const override; DrmConnector *connector() const; DrmPipeline *pipeline() const; diff --git a/src/plugins/platforms/drm/drm_pipeline.h b/src/plugins/platforms/drm/drm_pipeline.h index a3d43afc25..722e4927ea 100644 --- a/src/plugins/platforms/drm/drm_pipeline.h +++ b/src/plugins/platforms/drm/drm_pipeline.h @@ -58,7 +58,6 @@ public: bool setRgbRange(AbstractWaylandOutput::RgbRange rgbRange); DrmPlane::Transformations transformation() const; - bool isActive() const; bool isCursorVisible() const; QPoint cursorPos() const; @@ -91,6 +90,7 @@ private: bool atomicCommit(); bool presentLegacy(); bool checkTestBuffer(); + bool isActive() const; bool setPendingTransformation(const DrmPlane::Transformations &transformation); diff --git a/src/plugins/platforms/drm/drm_virtual_output.cpp b/src/plugins/platforms/drm/drm_virtual_output.cpp index 8fd76df907..cb454d553e 100644 --- a/src/plugins/platforms/drm/drm_virtual_output.cpp +++ b/src/plugins/platforms/drm/drm_virtual_output.cpp @@ -74,12 +74,6 @@ void DrmVirtualOutput::updateMode(const QSize &size, uint32_t refreshRate) void DrmVirtualOutput::setDpmsMode(DpmsMode mode) { setDpmsModeInternal(mode); - m_dpmsEnabled = mode == DpmsMode::On; -} - -bool DrmVirtualOutput::isDpmsEnabled() const -{ - return m_dpmsEnabled; } void DrmVirtualOutput::updateEnablement(bool enable) diff --git a/src/plugins/platforms/drm/drm_virtual_output.h b/src/plugins/platforms/drm/drm_virtual_output.h index 098889c40a..f12fe7c1d4 100644 --- a/src/plugins/platforms/drm/drm_virtual_output.h +++ b/src/plugins/platforms/drm/drm_virtual_output.h @@ -29,7 +29,6 @@ public: bool present(const QSharedPointer &buffer, QRegion damagedRegion) override; QSize sourceSize() const override; - bool isDpmsEnabled() const override; bool isFormatSupported(uint32_t drmFormat) const override; QVector supportedModifiers(uint32_t drmFormat) const override; @@ -55,7 +54,6 @@ private: QSharedPointer m_currentBuffer; bool m_pageFlipPending = true; int m_modeIndex = 0; - bool m_dpmsEnabled = true; int m_identifier; SoftwareVsyncMonitor *m_vsyncMonitor;