From 6012e409a61cf4100455c2db664fe6e058a57165 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Sat, 26 Feb 2022 23:53:52 +0100 Subject: [PATCH] backends/drm: fix multi-gpu The import code was added but not actually used --- src/backends/drm/egl_gbm_layer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backends/drm/egl_gbm_layer.cpp b/src/backends/drm/egl_gbm_layer.cpp index aeee43f1ed..2325139067 100644 --- a/src/backends/drm/egl_gbm_layer.cpp +++ b/src/backends/drm/egl_gbm_layer.cpp @@ -140,7 +140,14 @@ bool EglGbmLayer::endRendering(const QRegion &damagedRegion) m_shadowBuffer->render(m_pipeline->pending.sourceTransformation); } GLRenderTarget::popRenderTarget(); - const auto buffer = m_gbmSurface->swapBuffersForDrm(damagedRegion); + QSharedPointer buffer; + if (m_pipeline->gpu() == m_eglBackend->gpu()) { + buffer = m_gbmSurface->swapBuffersForDrm(damagedRegion); + } else { + if (m_gbmSurface->swapBuffers(damagedRegion)) { + buffer = importBuffer(); + } + } if (buffer) { m_currentBuffer = buffer; m_currentDamage = damagedRegion;