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>
This commit is contained in:
Johan Klokkhammer Helsing 2018-02-01 15:43:31 +01:00 committed by Liang Qi
parent 3d35501591
commit 96bf3b7a74

View File

@ -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)