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

backends/drm: fix legacy dpms


(cherry picked from commit 4d0998cf)
parent 22f59e0a
Pipeline #137638 passed with stage
in 16 minutes and 43 seconds
...@@ -98,7 +98,6 @@ bool DrmPipeline::applyPendingChangesLegacy() ...@@ -98,7 +98,6 @@ bool DrmPipeline::applyPendingChangesLegacy()
if (needsModeset() &&!legacyModeset()) { if (needsModeset() &&!legacyModeset()) {
return false; 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(), if (pending.gamma && drmModeCrtcSetGamma(gpu()->fd(), pending.crtc->id(), pending.gamma->size(),
pending.gamma->red(), pending.gamma->green(), pending.gamma->blue()) != 0) { pending.gamma->red(), pending.gamma->green(), pending.gamma->blue()) != 0) {
qCWarning(KWIN_DRM) << "Setting gamma failed!" << strerror(errno); qCWarning(KWIN_DRM) << "Setting gamma failed!" << strerror(errno);
...@@ -107,7 +106,7 @@ bool DrmPipeline::applyPendingChangesLegacy() ...@@ -107,7 +106,7 @@ bool DrmPipeline::applyPendingChangesLegacy()
setCursorLegacy(); setCursorLegacy();
moveCursorLegacy(); 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); qCWarning(KWIN_DRM) << "Setting legacy dpms failed!" << strerror(errno);
return false; return false;
} }
......
...@@ -65,7 +65,12 @@ void DrmProperty::rollbackPending() ...@@ -65,7 +65,12 @@ void DrmProperty::rollbackPending()
bool DrmProperty::setPropertyLegacy(uint64_t value) 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) 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