diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-02-01 15:43:31 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-02-07 20:29:34 +0000 |
commit | 96bf3b7a74432675da68cd9f501a58db16af0402 (patch) | |
tree | f8978cbce822337e07e2001bca3319e1a6b06900 /src/plugins/platforms | |
parent | 3d355015917ff2991b7d01deed2a1abfa15020b7 (diff) |
eglfs_kms_vsp2: Try to recover when failing in the middle of a blend
Blending can fail if one of the input buffers is destroyed in the middle of the
streaming operation. In that case, turn streaming off so blending can be
attempted again after disabling the input.
Change-Id: Id5c82b22a2ed0858ab20902395830efa0e64177d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qvsp2blendingdevice.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qvsp2blendingdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qvsp2blendingdevice.cpp index 58ffd31afd..879d312341 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qvsp2blendingdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_vsp2/qvsp2blendingdevice.cpp @@ -251,6 +251,8 @@ bool QVsp2BlendingDevice::blend(int outputDmabufFd) if (!m_wpfOutput->dequeueBuffer()) { qWarning() << "Vsp2: Failed to dequeue blending output buffer"; + if (!streamOff()) + qWarning() << "Vsp2: Failed to stop streaming when recovering after a broken blend."; return false; } @@ -284,19 +286,12 @@ bool QVsp2BlendingDevice::streamOn() bool QVsp2BlendingDevice::streamOff() { - if (!m_wpfOutput->streamOff()) { - //TODO: perhaps it's better to try to continue with the other inputs? - return false; - } - + bool succeeded = m_wpfOutput->streamOff(); for (auto &input : m_inputs) { - if (input.enabled) { - if (!input.rpfInput->streamOff()) - return false; - } + if (input.enabled) + succeeded &= input.rpfInput->streamOff(); } - - return true; + return succeeded; } bool QVsp2BlendingDevice::setInputFormat(int i, const QRect &bufferGeometry, uint pixelFormat, uint bytesPerLine) |