diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-02-08 10:17:44 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-02-15 15:17:20 +0000 |
commit | 5f96432ea968c4157539c7e4641303431d06252e (patch) | |
tree | 39385bcd711e94389b4c9f9f6036dac94228da2b /src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.cpp | |
parent | 6c4f5ecef0c9bc8bfb31ef4099d53ba02f0611aa (diff) |
eglfs_kms_vsp2: Recover if queuing input buffers fails
Clear all queued buffers, and reinitialize the Qt layer so we can try again
next time.
Change-Id: I921f6f457666206be92aadf2fe40b855e6ebff62
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.cpp index 88b401c920..475d9d55dd 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qeglfskmsvsp2screen.cpp @@ -141,10 +141,15 @@ void QEglFSKmsVsp2Screen::initDumbFrameBuffers() void QEglFSKmsVsp2Screen::initVsp2() { qCDebug(qLcEglfsKmsDebug, "Initializing Vsp2 hardware"); - const QSize screenSize = rawGeometry().size(); - m_blendDevice.reset(new QVsp2BlendingDevice(screenSize)); + m_blendDevice.reset(new QVsp2BlendingDevice(rawGeometry().size())); // Enable input for main buffer drawn by the compositor (always on) + initQtLayer(); +} + +void QEglFSKmsVsp2Screen::initQtLayer() +{ + const QSize screenSize = rawGeometry().size(); const uint bytesPerLine = uint(screenSize.width()) * 4; //TODO: is this ok? bool formatSet = m_blendDevice->enableInput(m_qtLayer, QRect(QPoint(), screenSize), m_output.drm_format, bytesPerLine); if (!formatSet) { @@ -298,8 +303,13 @@ void QEglFSKmsVsp2Screen::blendAndFlipDrm() vBlank.request.signal = 0; drmWaitVBlank(driFd, &vBlank); - if (!m_blendDevice->blend(backBuffer.dmabufFd)) - qWarning() << "Vsp2: blending failed"; + if (!m_blendDevice->blend(backBuffer.dmabufFd)) { + qWarning() << "Vsp2: Blending failed"; + + // For some reason, a failed blend may often mess up the qt layer, so reinitialize it here + m_blendDevice->disableInput(m_qtLayer); + initQtLayer(); + } for (auto cb : m_blendFinishedCallbacks) cb(); |