aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorStanimir Varbanov <stanimir.varbanov@linaro.org>2020-03-31 18:19:51 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-05-05 13:05:26 +0200
commit51df3c81ba10b00f4da81225310a3503b0583062 (patch)
treef9567ee40494f56855e8b2eb3ae0afeb666412cb /drivers/media/platform
parentmedia: venus: helpers: Done buffers per queue type (diff)
downloadwireguard-linux-51df3c81ba10b00f4da81225310a3503b0583062.tar.xz
wireguard-linux-51df3c81ba10b00f4da81225310a3503b0583062.zip
media: venus: vdec: Mark flushed buffers with error state
Once the hfi_session_flush is issued by the vdec all queued buffers to firmware should be returned to the v4l driver. Some of those buffers are not processed at the time of flush command, those buffers has filled len zero (no data). Catch that in buffer_done callback and mark not filled capture buffers with error state so that client can discard them. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/qcom/venus/vdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 7d093accbd59..5823537b3131 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1241,6 +1241,9 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
if (inst->codec_state == VENUS_DEC_STATE_DRAIN)
inst->codec_state = VENUS_DEC_STATE_STOPPED;
}
+
+ if (!bytesused)
+ state = VB2_BUF_STATE_ERROR;
} else {
vbuf->sequence = inst->sequence_out++;
}