Commit 47c08d6f 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 d6e9b801
Pipeline #196193 passed with stage
in 14 minutes
......@@ -170,13 +170,17 @@ DrmPipeline::Error DrmPipeline::commitPipelinesAtomic(const QVector<DrmPipeline
DrmPipeline::Error 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);
......@@ -302,6 +306,7 @@ void DrmPipeline::atomicCommitSuccessful(CommitMode mode)
}
}
if (mode != CommitMode::Test) {
m_pending.needsModeset = false;
if (activePending()) {
m_pageflipPending = true;
}
......
......@@ -173,6 +173,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;
std::shared_ptr<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