diff --git a/src/backends/drm/drm_pipeline_legacy.cpp b/src/backends/drm/drm_pipeline_legacy.cpp index 382ac8baa4..200abaa79a 100644 --- a/src/backends/drm/drm_pipeline_legacy.cpp +++ b/src/backends/drm/drm_pipeline_legacy.cpp @@ -97,7 +97,6 @@ bool DrmPipeline::applyPendingChangesLegacy() if (needsModeset() &&!legacyModeset()) { return false; } - m_connector->getProp(DrmConnector::PropertyIndex::Dpms)->setCurrent(DRM_MODE_DPMS_ON); if (pending.gamma && drmModeCrtcSetGamma(gpu()->fd(), pending.crtc->id(), pending.gamma->size(), pending.gamma->red(), pending.gamma->green(), pending.gamma->blue()) != 0) { qCWarning(KWIN_DRM) << "Setting gamma failed!" << strerror(errno); @@ -106,7 +105,7 @@ bool DrmPipeline::applyPendingChangesLegacy() setCursorLegacy(); moveCursorLegacy(); } - if (pending.crtc && !m_connector->getProp(DrmConnector::PropertyIndex::Dpms)->setPropertyLegacy(pending.active ? DRM_MODE_DPMS_ON : DRM_MODE_DPMS_OFF)) { + if (!m_connector->getProp(DrmConnector::PropertyIndex::Dpms)->setPropertyLegacy(activePending() ? DRM_MODE_DPMS_ON : DRM_MODE_DPMS_OFF)) { qCWarning(KWIN_DRM) << "Setting legacy dpms failed!" << strerror(errno); return false; } diff --git a/src/backends/drm/drm_property.cpp b/src/backends/drm/drm_property.cpp index 2848b304a0..28af8ec07f 100644 --- a/src/backends/drm/drm_property.cpp +++ b/src/backends/drm/drm_property.cpp @@ -65,7 +65,12 @@ void DrmProperty::rollbackPending() bool DrmProperty::setPropertyLegacy(uint64_t value) { - return drmModeObjectSetProperty(m_obj->gpu()->fd(), m_obj->id(), m_obj->type(), m_propId, value) == 0; + if (drmModeObjectSetProperty(m_obj->gpu()->fd(), m_obj->id(), m_obj->type(), m_propId, value) == 0) { + m_current = m_next = m_pending = value; + return true; + } else { + return false; + } } void DrmProperty::initEnumMap(drmModePropertyRes *prop)