summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorMing Qian <ming.qian@nxp.com>2024-02-05 11:17:58 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-02-16 13:46:32 +0300
commit8cda891db3948ef311594270b663bbad2475f790 (patch)
tree060a54c54cd4f70973e3c0590fa3eb7a139a93c6 /drivers/media
parentc8027d79e0ab37ae7751e2e974ec06016cf9f56c (diff)
downloadlinux-8cda891db3948ef311594270b663bbad2475f790.tar.xz
media: amphion: Abort vpu parsing directly in seek
Driver abort vpu decoding when both output and capture queues are off, but if seek in parsing the sequence header, driver may miss aborting the parsing. so just abort the vpu parsing directly in seek. Meanwhile if capture is off unexpectedly, we still need to abort the decoding and return capture buffers. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/amphion/vdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c
index 133d77d1ea0c..a57f9f4f3b87 100644
--- a/drivers/media/platform/amphion/vdec.c
+++ b/drivers/media/platform/amphion/vdec.c
@@ -1595,9 +1595,11 @@ static int vdec_stop_session(struct vpu_inst *inst, u32 type)
if (V4L2_TYPE_IS_OUTPUT(type)) {
vdec_update_state(inst, VPU_CODEC_STATE_SEEK, 0);
vdec->drain = 0;
+ vdec_abort(inst);
} else {
if (inst->state != VPU_CODEC_STATE_DYAMIC_RESOLUTION_CHANGE) {
- vdec_abort(inst);
+ if (vb2_is_streaming(v4l2_m2m_get_src_vq(inst->fh.m2m_ctx)))
+ vdec_abort(inst);
vdec->eos_received = 0;
}
vdec_clear_slots(inst);