diff --git a/src/backends/drm/drm_lease_egl_gbm_layer.cpp b/src/backends/drm/drm_lease_egl_gbm_layer.cpp index 85653a0a94..112fb4ba16 100644 --- a/src/backends/drm/drm_lease_egl_gbm_layer.cpp +++ b/src/backends/drm/drm_lease_egl_gbm_layer.cpp @@ -30,7 +30,7 @@ DrmLeaseEglGbmLayer::DrmLeaseEglGbmLayer(EglGbmBackend *backend, DrmPipeline *pi QSharedPointer DrmLeaseEglGbmLayer::testBuffer() { const auto mods = m_pipeline->formats().value(DRM_FORMAT_XRGB8888); - const auto size = m_pipeline->sourceSize(); + const auto size = m_pipeline->bufferSize(); if (!m_buffer || m_buffer->size() != size || !(mods.isEmpty() || mods.contains(m_buffer->modifier()))) { gbm_bo *newBo; if (mods.isEmpty()) { diff --git a/src/backends/drm/drm_pipeline.cpp b/src/backends/drm/drm_pipeline.cpp index 045c6a3a2c..4fdf1a0016 100644 --- a/src/backends/drm/drm_pipeline.cpp +++ b/src/backends/drm/drm_pipeline.cpp @@ -368,15 +368,6 @@ QSize DrmPipeline::bufferSize() const return modeSize; } -QSize DrmPipeline::sourceSize() const -{ - const auto modeSize = pending.mode->size(); - if (pending.sourceTransformation & (DrmPlane::Transformation::Rotate90 | DrmPlane::Transformation::Rotate270)) { - return modeSize.transposed(); - } - return modeSize; -} - bool DrmPipeline::isCursorVisible() const { const QRect mode = QRect(QPoint(), pending.mode->size()); diff --git a/src/backends/drm/drm_pipeline.h b/src/backends/drm/drm_pipeline.h index 8564b28efa..12c21d9133 100644 --- a/src/backends/drm/drm_pipeline.h +++ b/src/backends/drm/drm_pipeline.h @@ -79,10 +79,6 @@ public: bool modesetPresentPending() const; void resetModesetPresentPending(); void printDebugInfo() const; - /** - * which size buffers for rendering should have - */ - QSize sourceSize() const; /** * what size buffers submitted to this pipeline should have */ diff --git a/src/backends/drm/drm_qpainter_layer.cpp b/src/backends/drm/drm_qpainter_layer.cpp index 2465aa0ba9..55da331f3b 100644 --- a/src/backends/drm/drm_qpainter_layer.cpp +++ b/src/backends/drm/drm_qpainter_layer.cpp @@ -33,7 +33,7 @@ DrmQPainterLayer::DrmQPainterLayer(DrmQPainterBackend *backend, DrmPipeline *pip OutputLayerBeginFrameInfo DrmQPainterLayer::beginFrame() { if (!doesSwapchainFit()) { - m_swapchain = QSharedPointer::create(m_pipeline->gpu(), m_pipeline->sourceSize(), DRM_FORMAT_XRGB8888); + m_swapchain = QSharedPointer::create(m_pipeline->gpu(), m_pipeline->bufferSize(), DRM_FORMAT_XRGB8888); } QRegion needsRepaint; if (!m_swapchain->acquireBuffer(&needsRepaint)) { @@ -55,14 +55,14 @@ void DrmQPainterLayer::endFrame(const QRegion &renderedRegion, const QRegion &da QSharedPointer DrmQPainterLayer::testBuffer() { if (!doesSwapchainFit()) { - m_swapchain = QSharedPointer::create(m_pipeline->gpu(), m_pipeline->sourceSize(), DRM_FORMAT_XRGB8888); + m_swapchain = QSharedPointer::create(m_pipeline->gpu(), m_pipeline->bufferSize(), DRM_FORMAT_XRGB8888); } return m_swapchain->currentBuffer(); } bool DrmQPainterLayer::doesSwapchainFit() const { - return m_swapchain && m_swapchain->size() == m_pipeline->sourceSize(); + return m_swapchain && m_swapchain->size() == m_pipeline->bufferSize(); } QSharedPointer DrmQPainterLayer::currentBuffer() const @@ -112,7 +112,7 @@ DrmLeaseQPainterLayer::DrmLeaseQPainterLayer(DrmQPainterBackend *backend, DrmPip QSharedPointer DrmLeaseQPainterLayer::testBuffer() { - const auto size = m_pipeline->sourceSize(); + const auto size = m_pipeline->bufferSize(); if (!m_buffer || m_buffer->size() != size) { m_buffer = QSharedPointer::create(m_pipeline->gpu(), size, DRM_FORMAT_XRGB8888); } diff --git a/src/backends/drm/egl_gbm_layer.cpp b/src/backends/drm/egl_gbm_layer.cpp index 3bb623bafa..1f4d7e34f5 100644 --- a/src/backends/drm/egl_gbm_layer.cpp +++ b/src/backends/drm/egl_gbm_layer.cpp @@ -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.bufferTransformation, damagedRegion); + const auto ret = m_surface.endRendering(m_pipeline->pending.sourceTransformation, damagedRegion); if (ret.has_value()) { std::tie(m_currentBuffer, m_currentDamage) = ret.value(); } @@ -77,7 +77,7 @@ QRegion EglGbmLayer::currentDamage() const QSharedPointer EglGbmLayer::testBuffer() { - if (!m_surface.doesSurfaceFit(m_pipeline->sourceSize(), m_pipeline->formats())) { + if (!m_surface.doesSurfaceFit(m_pipeline->bufferSize(), m_pipeline->formats())) { renderTestBuffer(); } return m_currentBuffer; @@ -115,7 +115,7 @@ bool EglGbmLayer::scanout(SurfaceItem *surfaceItem) } const auto surface = item->surface(); const auto buffer = qobject_cast(surface->buffer()); - if (!buffer || buffer->planes().isEmpty() || buffer->size() != m_pipeline->sourceSize()) { + if (!buffer || buffer->planes().isEmpty() || buffer->size() != m_pipeline->bufferSize()) { return false; }