Commit 4d0998cf authored by Xaver Hugl's avatar Xaver Hugl Committed by Vlad Zahorodnii
Browse files

backends/drm: fix legacy dpms

parent 76dbe9e5
Pipeline #137635 passed with stage
in 15 minutes and 48 seconds
......@@ -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;
}
......
......@@ -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)
......
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