Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ming Qian and committed by
Hans Verkuil
8cda891d c8027d79

+3 -1
+3 -1
drivers/media/platform/amphion/vdec.c
··· 1595 1595 if (V4L2_TYPE_IS_OUTPUT(type)) { 1596 1596 vdec_update_state(inst, VPU_CODEC_STATE_SEEK, 0); 1597 1597 vdec->drain = 0; 1598 + vdec_abort(inst); 1598 1599 } else { 1599 1600 if (inst->state != VPU_CODEC_STATE_DYAMIC_RESOLUTION_CHANGE) { 1600 - vdec_abort(inst); 1601 + if (vb2_is_streaming(v4l2_m2m_get_src_vq(inst->fh.m2m_ctx))) 1602 + vdec_abort(inst); 1601 1603 vdec->eos_received = 0; 1602 1604 } 1603 1605 vdec_clear_slots(inst);