From caa8c8fd45fd932ed701d6bf8fd0c3b002bf85c9 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Wed, 7 Jul 2021 19:16:29 +0200 Subject: [PATCH] platforms/drm: always populate atomic req with connector props If we don't then overscan and underscan are never applied --- src/plugins/platforms/drm/drm_output.cpp | 16 ++++++++-------- src/plugins/platforms/drm/drm_output.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/platforms/drm/drm_output.cpp b/src/plugins/platforms/drm/drm_output.cpp index 92ee5012c3..d6f4b79d68 100644 --- a/src/plugins/platforms/drm/drm_output.cpp +++ b/src/plugins/platforms/drm/drm_output.cpp @@ -798,14 +798,16 @@ bool DrmOutput::doAtomicCommit(AtomicCommitMode mode) return false; } } - if (!atomicReqModesetPopulate(req, m_dpmsModePending == DpmsMode::On)){ - qCWarning(KWIN_DRM) << "Failed to populate Atomic Modeset"; - errorHandler(); - return false; - } + setModesetValues(m_dpmsModePending == DpmsMode::On); flags |= DRM_MODE_ATOMIC_ALLOW_MODESET; } + if (!m_conn->atomicPopulate(req)) { + qCWarning(KWIN_DRM) << "Failed to populate connector. Abort atomic commit!"; + errorHandler(); + return false; + } + if (!m_crtc->atomicPopulate(req)) { qCWarning(KWIN_DRM) << "Failed to populate crtc. Abort atomic commit!"; errorHandler(); @@ -859,7 +861,7 @@ bool DrmOutput::doAtomicCommit(AtomicCommitMode mode) return true; } -bool DrmOutput::atomicReqModesetPopulate(drmModeAtomicReq *req, bool enable) +void DrmOutput::setModesetValues(bool enable) { if (enable) { const QSize mSize = modeSize(); @@ -898,8 +900,6 @@ bool DrmOutput::atomicReqModesetPopulate(drmModeAtomicReq *req, bool enable) m_conn->setValue(DrmConnector::PropertyIndex::CrtcId, enable ? m_crtc->id() : 0); m_crtc->setValue(DrmCrtc::PropertyIndex::ModeId, enable ? m_blobId : 0); m_crtc->setValue(DrmCrtc::PropertyIndex::Active, enable); - - return m_conn->atomicPopulate(req); } int DrmOutput::gammaRampSize() const diff --git a/src/plugins/platforms/drm/drm_output.h b/src/plugins/platforms/drm/drm_output.h index 026a06665f..1f89f90644 100644 --- a/src/plugins/platforms/drm/drm_output.h +++ b/src/plugins/platforms/drm/drm_output.h @@ -118,7 +118,7 @@ private: void dpmsFinishOn(); void dpmsFinishOff(); - bool atomicReqModesetPopulate(drmModeAtomicReq *req, bool enable); + void setModesetValues(bool enable); void setDpmsMode(DpmsMode mode) override; void updateMode(int modeIndex) override; void updateMode(uint32_t width, uint32_t height, uint32_t refreshRate);