diff --git a/src/plugins/platforms/drm/drm_pipeline.cpp b/src/plugins/platforms/drm/drm_pipeline.cpp index b6966490ef..a67c5ff844 100644 --- a/src/plugins/platforms/drm/drm_pipeline.cpp +++ b/src/plugins/platforms/drm/drm_pipeline.cpp @@ -275,21 +275,12 @@ bool DrmPipeline::checkTestBuffer() if (!m_active) { return true; } + QSharedPointer buffer; #if HAVE_GBM auto backend = m_gpu->eglBackend(); if (backend && m_output) { - auto buffer = backend->renderTestFrame(m_output); - if (buffer && buffer->bufferId()) { - m_oldTestBuffer = m_primaryBuffer; - m_primaryBuffer = buffer; - return true; - } else { - return false; - } - } - // we either don't have a DrmOutput or we're using QPainter - QSharedPointer buffer; - if (backend && m_gpu->gbmDevice()) { + buffer = backend->renderTestFrame(m_output); + } else if (backend && m_gpu->gbmDevice()) { gbm_bo *bo = gbm_bo_create(m_gpu->gbmDevice(), sourceSize().width(), sourceSize().height(), GBM_FORMAT_XRGB8888, GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); if (!bo) { return false; @@ -299,7 +290,7 @@ bool DrmPipeline::checkTestBuffer() buffer = QSharedPointer::create(m_gpu, sourceSize()); } #else - auto buffer = QSharedPointer::create(m_gpu, sourceSize()); + buffer = QSharedPointer::create(m_gpu, sourceSize()); #endif if (buffer && buffer->bufferId()) { m_oldTestBuffer = m_primaryBuffer;