From 96bf3b7a74432675da68cd9f501a58db16af0402 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 1 Feb 2018 15:43:31 +0100 Subject: 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 --- .../eglfs_kms_vsp2/qvsp2blendingdevice.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/plugins/platforms/eglfs') 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) -- cgit v1.2.3