diff --git a/src/backends/drm/drm_object_connector.cpp b/src/backends/drm/drm_object_connector.cpp index 93bcbb0bfc..032cf84cac 100644 --- a/src/backends/drm/drm_object_connector.cpp +++ b/src/backends/drm/drm_object_connector.cpp @@ -194,7 +194,7 @@ int DrmConnector::currentModeIndex() const return m_modeIndex; } -QVector DrmConnector::modes() +QVector DrmConnector::modes() const { return m_modes; } diff --git a/src/backends/drm/drm_object_connector.h b/src/backends/drm/drm_object_connector.h index 46660a4f0c..f5bbc455c3 100644 --- a/src/backends/drm/drm_object_connector.h +++ b/src/backends/drm/drm_object_connector.h @@ -98,7 +98,7 @@ public: DrmConnectorMode *currentMode() const; int currentModeIndex() const; - QVector modes(); + QVector modes() const; void setModeIndex(int index); void findCurrentMode(drmModeModeInfo currentMode); void updateModes(); diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index 8b31c807f4..38bcf2059f 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -116,7 +116,7 @@ void DrmOutput::updateCursor() return; } const auto plane = m_pipeline->pending.crtc->cursorPlane(); - if (!m_cursor || (plane && !plane->formats()[m_cursor->drmFormat()].contains(DRM_FORMAT_MOD_LINEAR))) { + if (!m_cursor || (plane && !plane->formats().value(m_cursor->drmFormat()).contains(DRM_FORMAT_MOD_LINEAR))) { if (plane) { const auto formatModifiers = plane->formats(); const auto formats = formatModifiers.keys(); diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index 460dd52996..11d3226c4d 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -191,7 +191,7 @@ bool DrmPipeline::populateAtomicValues(drmModeAtomicReq *req, uint32_t &flags) if (pending.crtc) { pending.crtc->setPending(DrmCrtc::PropertyIndex::VrrEnabled, pending.syncMode == RenderLoopPrivate::SyncMode::Adaptive); pending.crtc->setPending(DrmCrtc::PropertyIndex::Gamma_LUT, pending.gamma ? pending.gamma->blobId() : 0); - auto modeSize = m_connector->modes()[pending.modeIndex]->size(); + auto modeSize = m_connector->modes().at(pending.modeIndex)->size(); pending.crtc->primaryPlane()->set(QPoint(0, 0), m_primaryBuffer ? m_primaryBuffer->size() : bufferSize(), QPoint(0, 0), modeSize); pending.crtc->primaryPlane()->setBuffer(activePending() ? m_primaryBuffer.get() : nullptr); @@ -224,7 +224,7 @@ void DrmPipeline::prepareAtomicModeset() m_connector->setPending(DrmConnector::PropertyIndex::CrtcId, 0); return; } - auto mode = m_connector->modes()[pending.modeIndex]; + auto mode = m_connector->modes().at(pending.modeIndex); m_connector->setPending(DrmConnector::PropertyIndex::CrtcId, activePending() ? pending.crtc->id() : 0); if (const auto &prop = m_connector->getProp(DrmConnector::PropertyIndex::Broadcast_RGB)) { @@ -400,7 +400,7 @@ void DrmPipeline::applyPendingChanges() QSize DrmPipeline::bufferSize() const { - const auto modeSize = m_connector->modes()[pending.modeIndex]->size(); + const auto modeSize = m_connector->modes().at(pending.modeIndex)->size(); if (pending.bufferTransformation & (DrmPlane::Transformation::Rotate90 | DrmPlane::Transformation::Rotate270)) { return modeSize.transposed(); } @@ -409,7 +409,7 @@ QSize DrmPipeline::bufferSize() const QSize DrmPipeline::sourceSize() const { - const auto modeSize = m_connector->modes()[pending.modeIndex]->size(); + const auto modeSize = m_connector->modes().at(pending.modeIndex)->size(); if (pending.sourceTransformation & (DrmPlane::Transformation::Rotate90 | DrmPlane::Transformation::Rotate270)) { return modeSize.transposed(); } @@ -418,7 +418,7 @@ QSize DrmPipeline::sourceSize() const bool DrmPipeline::isCursorVisible() const { - const QRect mode = QRect(QPoint(), m_connector->modes()[pending.modeIndex]->size()); + const QRect mode = QRect(QPoint(), m_connector->modes().at(pending.modeIndex)->size()); return pending.cursorBo && QRect(pending.cursorPos, pending.cursorBo->size()).intersects(mode); } @@ -468,7 +468,7 @@ bool DrmPipeline::isFormatSupported(uint32_t drmFormat) const if (pending.crtc->primaryPlane()) { return pending.crtc->primaryPlane()->formats().contains(drmFormat); } else { - return legacyFormats.keys().contains(drmFormat); + return legacyFormats.contains(drmFormat); } } else { return false; @@ -478,7 +478,7 @@ bool DrmPipeline::isFormatSupported(uint32_t drmFormat) const QVector DrmPipeline::supportedModifiers(uint32_t drmFormat) const { if (pending.crtc && pending.crtc->primaryPlane()) { - return pending.crtc->primaryPlane()->formats()[drmFormat]; + return pending.crtc->primaryPlane()->formats().value(drmFormat); } else { return {}; } diff --git a/src/backends/drm/drm_pipeline_legacy.cpp b/src/backends/drm/drm_pipeline_legacy.cpp index c22de146e8..97f1d0c9d4 100644 --- a/src/backends/drm/drm_pipeline_legacy.cpp +++ b/src/backends/drm/drm_pipeline_legacy.cpp @@ -33,7 +33,7 @@ bool DrmPipeline::presentLegacy() bool DrmPipeline::legacyModeset() { - auto mode = m_connector->modes()[pending.modeIndex]; + auto mode = m_connector->modes().at(pending.modeIndex); uint32_t connId = m_connector->id(); if (!checkTestBuffer() || drmModeSetCrtc(gpu()->fd(), pending.crtc->id(), m_primaryBuffer->bufferId(), 0, 0, &connId, 1, mode->nativeMode()) != 0) { qCWarning(KWIN_DRM) << "Modeset failed!" << strerror(errno);