Commit 3bac0cd0 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: ensure modeset properties are reset properly

Without this, all atomic modeset commits fail on setups with a VR headset
parent 680fd236
Pipeline #196200 passed with stage
in 26 minutes and 25 seconds
......@@ -169,13 +169,17 @@ bool DrmPipeline::commitPipelinesAtomic(const QVector<DrmPipeline *> &pipelines,
bool DrmPipeline::populateAtomicValues(drmModeAtomicReq *req, uint32_t &flags)
{
if (needsModeset()) {
prepareAtomicModeset();
bool modeset = needsModeset();
if (modeset) {
flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
m_pending.needsModeset = true;
}
if (activePending()) {
flags |= DRM_MODE_PAGE_FLIP_EVENT;
}
if (m_pending.needsModeset) {
prepareAtomicModeset();
}
if (m_pending.crtc) {
m_pending.crtc->setPending(DrmCrtc::PropertyIndex::VrrEnabled, m_pending.syncMode == RenderLoopPrivate::SyncMode::Adaptive);
m_pending.crtc->setPending(DrmCrtc::PropertyIndex::Gamma_LUT, m_pending.gamma ? m_pending.gamma->blobId() : 0);
......@@ -285,6 +289,7 @@ void DrmPipeline::atomicCommitSuccessful(CommitMode mode)
}
}
if (mode != CommitMode::Test) {
m_pending.needsModeset = false;
if (activePending()) {
m_pageflipPending = true;
}
......
......@@ -162,6 +162,7 @@ private:
QMap<uint32_t, QVector<uint64_t>> formats;
bool active = true; // whether or not the pipeline should be currently used
bool enabled = true; // whether or not the pipeline needs a crtc
bool needsModeset = false;
QSharedPointer<DrmConnectorMode> mode;
uint32_t overscan = 0;
Output::RgbRange rgbRange = Output::RgbRange::Automatic;
......
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