backends/drm: ensure modeset properties are reset properly

Without this, all atomic modeset commits fail on setups with a VR headset
This commit is contained in:
Xaver Hugl 2022-06-24 02:52:32 +02:00
parent d6e9b8011a
commit 47c08d6f66
2 changed files with 8 additions and 2 deletions

View file

@ -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;
}

View file

@ -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;