diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp index e4ad43d732..73f098b8ab 100644 --- a/src/backends/drm/drm_gpu.cpp +++ b/src/backends/drm/drm_gpu.cpp @@ -423,8 +423,8 @@ bool DrmGpu::testPendingConfiguration() // try again without hw rotation bool hwRotationUsed = false; for (const auto &pipeline : qAsConst(m_pipelines)) { - hwRotationUsed |= (pipeline->pending.bufferTransformation != DrmPlane::Transformations(DrmPlane::Transformation::Rotate0)); - pipeline->pending.bufferTransformation = DrmPlane::Transformation::Rotate0; + hwRotationUsed |= (pipeline->pending.bufferOrientation != DrmPlane::Transformations(DrmPlane::Transformation::Rotate0)); + pipeline->pending.bufferOrientation = DrmPlane::Transformation::Rotate0; } return hwRotationUsed ? checkCrtcAssignment(connectors, crtcs) : false; } diff --git a/src/backends/drm/drm_output.cpp b/src/backends/drm/drm_output.cpp index 5d39c8e3f5..93859a9f46 100644 --- a/src/backends/drm/drm_output.cpp +++ b/src/backends/drm/drm_output.cpp @@ -358,9 +358,9 @@ bool DrmOutput::queueChanges(const OutputConfiguration &config) m_pipeline->pending.mode = *it; m_pipeline->pending.overscan = props->overscan; m_pipeline->pending.rgbRange = props->rgbRange; - m_pipeline->pending.sourceTransformation = outputToPlaneTransform(props->transform); + m_pipeline->pending.renderOrientation = outputToPlaneTransform(props->transform); if (!envOnlySoftwareRotations && m_gpu->atomicModeSetting()) { - m_pipeline->pending.bufferTransformation = m_pipeline->pending.sourceTransformation; + m_pipeline->pending.bufferOrientation = m_pipeline->pending.renderOrientation; } m_pipeline->pending.enabled = props->enabled; return true; diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index 4fdf1a0016..b431dabca3 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -238,7 +238,7 @@ void DrmPipeline::prepareAtomicModeset() pending.crtc->setPending(DrmCrtc::PropertyIndex::ModeId, activePending() ? pending.mode->blobId() : 0); pending.crtc->primaryPlane()->setPending(DrmPlane::PropertyIndex::CrtcId, activePending() ? pending.crtc->id() : 0); - pending.crtc->primaryPlane()->setTransformation(pending.bufferTransformation); + pending.crtc->primaryPlane()->setTransformation(pending.bufferOrientation); if (pending.crtc->cursorPlane()) { pending.crtc->cursorPlane()->setTransformation(DrmPlane::Transformation::Rotate0); } @@ -362,7 +362,7 @@ void DrmPipeline::applyPendingChanges() QSize DrmPipeline::bufferSize() const { const auto modeSize = pending.mode->size(); - if (pending.bufferTransformation & (DrmPlane::Transformation::Rotate90 | DrmPlane::Transformation::Rotate270)) { + if (pending.bufferOrientation & (DrmPlane::Transformation::Rotate90 | DrmPlane::Transformation::Rotate270)) { return modeSize.transposed(); } return modeSize; @@ -431,7 +431,7 @@ bool DrmPipeline::needsModeset() const || pending.active != m_current.active || pending.mode != m_current.mode || pending.rgbRange != m_current.rgbRange - || pending.bufferTransformation != m_current.bufferTransformation + || pending.bufferOrientation != m_current.bufferOrientation || m_connector->linkStatus() == DrmConnector::LinkStatus::Bad || m_modesetPresentPending; } diff --git a/src/backends/drm/drm_pipeline.h b/src/backends/drm/drm_pipeline.h index 12c21d9133..7250ba8a6d 100644 --- a/src/backends/drm/drm_pipeline.h +++ b/src/backends/drm/drm_pipeline.h @@ -108,9 +108,9 @@ public: QSharedPointer cursorBo; // the transformation that this pipeline will apply to submitted buffers - DrmPlane::Transformations bufferTransformation = DrmPlane::Transformation::Rotate0; + DrmPlane::Transformations bufferOrientation = DrmPlane::Transformation::Rotate0; // the transformation that buffers submitted to the pipeline should have - DrmPlane::Transformations sourceTransformation = DrmPlane::Transformation::Rotate0; + DrmPlane::Transformations renderOrientation = DrmPlane::Transformation::Rotate0; }; State pending; diff --git a/src/backends/drm/egl_gbm_layer.cpp b/src/backends/drm/egl_gbm_layer.cpp index 1f4d7e34f5..96d61e0b43 100644 --- a/src/backends/drm/egl_gbm_layer.cpp +++ b/src/backends/drm/egl_gbm_layer.cpp @@ -53,7 +53,7 @@ OutputLayerBeginFrameInfo EglGbmLayer::beginFrame() m_scanoutBuffer.reset(); m_dmabufFeedback.renderingSurface(); - return m_surface.startRendering(m_pipeline->bufferSize(), m_pipeline->pending.sourceTransformation, m_pipeline->pending.bufferTransformation, m_pipeline->formats()); + return m_surface.startRendering(m_pipeline->bufferSize(), m_pipeline->pending.renderOrientation, m_pipeline->pending.bufferOrientation, m_pipeline->formats()); } void EglGbmLayer::aboutToStartPainting(const QRegion &damagedRegion) @@ -64,7 +64,7 @@ void EglGbmLayer::aboutToStartPainting(const QRegion &damagedRegion) void EglGbmLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { Q_UNUSED(renderedRegion) - const auto ret = m_surface.endRendering(m_pipeline->pending.sourceTransformation, damagedRegion); + const auto ret = m_surface.endRendering(m_pipeline->pending.renderOrientation, damagedRegion); if (ret.has_value()) { std::tie(m_currentBuffer, m_currentDamage) = ret.value(); } diff --git a/src/backends/drm/egl_gbm_layer_surface.cpp b/src/backends/drm/egl_gbm_layer_surface.cpp index ba123bf65f..e4b939d96f 100644 --- a/src/backends/drm/egl_gbm_layer_surface.cpp +++ b/src/backends/drm/egl_gbm_layer_surface.cpp @@ -53,7 +53,7 @@ void EglGbmLayerSurface::destroyResources() m_oldGbmSurface.reset(); } -OutputLayerBeginFrameInfo EglGbmLayerSurface::startRendering(const QSize &bufferSize, DrmPlane::Transformations renderTransform, DrmPlane::Transformations bufferTransform, const QMap> &formats) +OutputLayerBeginFrameInfo EglGbmLayerSurface::startRendering(const QSize &bufferSize, DrmPlane::Transformations renderOrientation, DrmPlane::Transformations bufferOrientation, const QMap> &formats) { // gbm surface if (doesGbmSurfaceFit(m_gbmSurface.data(), bufferSize, formats)) { @@ -76,14 +76,14 @@ OutputLayerBeginFrameInfo EglGbmLayerSurface::startRendering(const QSize &buffer } // shadow buffer - const QSize renderSize = (renderTransform & (DrmPlane::Transformation::Rotate90 | DrmPlane::Transformation::Rotate270)) ? m_gbmSurface->size().transposed() : m_gbmSurface->size(); - if (doesShadowBufferFit(m_shadowBuffer.data(), renderSize, renderTransform, bufferTransform)) { + const QSize renderSize = (renderOrientation & (DrmPlane::Transformation::Rotate90 | DrmPlane::Transformation::Rotate270)) ? m_gbmSurface->size().transposed() : m_gbmSurface->size(); + if (doesShadowBufferFit(m_shadowBuffer.data(), renderSize, renderOrientation, bufferOrientation)) { m_oldShadowBuffer.reset(); } else { - if (doesShadowBufferFit(m_oldShadowBuffer.data(), renderSize, renderTransform, bufferTransform)) { + if (doesShadowBufferFit(m_oldShadowBuffer.data(), renderSize, renderOrientation, bufferOrientation)) { m_shadowBuffer = m_oldShadowBuffer; } else { - if (renderTransform != bufferTransform) { + if (renderOrientation != bufferOrientation) { const auto format = m_eglBackend->gbmFormatForDrmFormat(m_gbmSurface->format()); if (!format.has_value()) { return {}; @@ -125,12 +125,12 @@ void EglGbmLayerSurface::aboutToStartPainting(DrmOutput *output, const QRegion & } } -std::optional, QRegion>> EglGbmLayerSurface::endRendering(DrmPlane::Transformations renderTransform, const QRegion &damagedRegion) +std::optional, QRegion>> EglGbmLayerSurface::endRendering(DrmPlane::Transformations renderOrientation, const QRegion &damagedRegion) { if (m_shadowBuffer) { GLFramebuffer::popFramebuffer(); - // TODO handle bufferTransform != Rotate0 - m_shadowBuffer->render(renderTransform); + // TODO handle bufferOrientation != Rotate0 + m_shadowBuffer->render(renderOrientation); } GLFramebuffer::popFramebuffer(); QSharedPointer buffer; @@ -230,9 +230,9 @@ bool EglGbmLayerSurface::doesGbmSurfaceFit(GbmSurface *surf, const QSize &size, && (surf->modifiers().isEmpty() || formats[surf->format()] == surf->modifiers()); } -bool EglGbmLayerSurface::doesShadowBufferFit(ShadowBuffer *buffer, const QSize &size, DrmPlane::Transformations renderTransform, DrmPlane::Transformations bufferTransform) const +bool EglGbmLayerSurface::doesShadowBufferFit(ShadowBuffer *buffer, const QSize &size, DrmPlane::Transformations renderOrientation, DrmPlane::Transformations bufferOrientation) const { - if (renderTransform != bufferTransform) { + if (renderOrientation != bufferOrientation) { return buffer && buffer->texture()->size() == size && buffer->drmFormat() == m_gbmSurface->format(); } else { return buffer == nullptr; diff --git a/src/backends/drm/egl_gbm_layer_surface.h b/src/backends/drm/egl_gbm_layer_surface.h index 93b8c811e4..a8d055f646 100644 --- a/src/backends/drm/egl_gbm_layer_surface.h +++ b/src/backends/drm/egl_gbm_layer_surface.h @@ -41,9 +41,9 @@ public: EglGbmLayerSurface(DrmGpu *gpu, EglGbmBackend *eglBackend); ~EglGbmLayerSurface(); - OutputLayerBeginFrameInfo startRendering(const QSize &bufferSize, DrmPlane::Transformations renderTransform, DrmPlane::Transformations bufferTransform, const QMap> &formats); + OutputLayerBeginFrameInfo startRendering(const QSize &bufferSize, DrmPlane::Transformations renderOrientation, DrmPlane::Transformations bufferOrientation, const QMap> &formats); void aboutToStartPainting(DrmOutput *output, const QRegion &damagedRegion); - std::optional, QRegion>> endRendering(DrmPlane::Transformations renderTransform, const QRegion &damagedRegion); + std::optional, QRegion>> endRendering(DrmPlane::Transformations renderOrientation, const QRegion &damagedRegion); bool doesSurfaceFit(const QSize &size, const QMap> &formats) const; QSharedPointer texture() const; @@ -55,7 +55,7 @@ private: bool createGbmSurface(const QSize &size, const QMap> &formats); bool doesGbmSurfaceFit(GbmSurface *surf, const QSize &size, const QMap> &formats) const; - bool doesShadowBufferFit(ShadowBuffer *buffer, const QSize &size, DrmPlane::Transformations renderTransform, DrmPlane::Transformations bufferTransform) const; + bool doesShadowBufferFit(ShadowBuffer *buffer, const QSize &size, DrmPlane::Transformations renderOrientation, DrmPlane::Transformations bufferOrientation) const; bool doesSwapchainFit(DumbSwapchain *swapchain) const; QSharedPointer importBuffer();