]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: amphion: Clear last_buffer_dequeued flag for DEC_CMD_START
authorMing Qian <ming.qian@oss.nxp.com>
Wed, 17 Dec 2025 03:02:22 +0000 (11:02 +0800)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 13 Jan 2026 08:41:59 +0000 (09:41 +0100)
The V4L2_DEC_CMD_START command may be used to handle the dynamic source
change, which will triggers an implicit decoder drain.
The last_buffer_dequeued flag is set in the implicit decoder drain,
so driver need to clear it to continue the following decoding flow.

Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/amphion/vdec.c

index c0d2aabb9e0e33ff17bd69a6b76793b21dca768d..f25dbcebdccf6839d3b6cab7840d1b7a93041cc9 100644 (file)
@@ -724,6 +724,7 @@ static int vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd
        switch (cmd->cmd) {
        case V4L2_DEC_CMD_START:
                vdec_cmd_start(inst);
+               vb2_clear_last_buffer_dequeued(v4l2_m2m_get_dst_vq(inst->fh.m2m_ctx));
                break;
        case V4L2_DEC_CMD_STOP:
                vdec_cmd_stop(inst);