author | Nanxin Qin <nanxin.qin@amlogic.com> | 2020-05-21 03:18:07 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-05-28 02:37:54 (GMT) |
commit | 6c27635450014c78a9da7fbbabd5b25546122806 (patch) | |
tree | 818bddc5846488c09df604bbb2aa05ae14456412 | |
parent | f3eded78794916b1916c19658197f7bad05124fb (diff) | |
download | media_modules-6c27635450014c78a9da7fbbabd5b25546122806.zip media_modules-6c27635450014c78a9da7fbbabd5b25546122806.tar.gz media_modules-6c27635450014c78a9da7fbbabd5b25546122806.tar.bz2 |
v4l: fixed some issues of the v4l codec. [1/1]
PD#SWPL-26430
Problem:
1. the first picture output 2 times.
2. exception calltrace was found when exit multi-inst playbacks
Solution:
1. the first frame of es must be removed after probe done.
2. clean vb2 buffers status when cmd stream stop.
Verify:
u212
Change-Id: Ic90a5a48e0e2f966e150dc76ba7902a8a9920f3e
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
-rw-r--r-- | drivers/amvdec_ports/aml_vcodec_dec.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c index df27881..fb88ce5 100644 --- a/drivers/amvdec_ports/aml_vcodec_dec.c +++ b/drivers/amvdec_ports/aml_vcodec_dec.c @@ -2134,6 +2134,10 @@ static void vb2ops_vdec_buf_queue(struct vb2_buffer *vb) if (ctx->is_drm_mode && src_mem.model == VB2_MEMORY_DMABUF) { v4l2_m2m_src_buf_remove(ctx->m2m_ctx); aml_recycle_dma_buffers(ctx); + } else if (ctx->param_sets_from_ucode) { + v4l2_m2m_src_buf_remove(ctx->m2m_ctx); + v4l2_m2m_buf_done(to_vb2_v4l2_buffer(vb), + VB2_BUF_STATE_DONE); } if (vdec_if_get_param(ctx, GET_PARAM_PIC_INFO, &ctx->picinfo)) { @@ -2335,16 +2339,25 @@ static void vb2ops_vdec_stop_streaming(struct vb2_queue *q) codec_mm_bufs_cnt_clean(q); if (V4L2_TYPE_IS_OUTPUT(q->type)) { + if (ctx->is_drm_mode && q->memory == VB2_MEMORY_DMABUF) + aml_recycle_dma_buffers(ctx); + while ((vb2_v4l2 = v4l2_m2m_src_buf_remove(ctx->m2m_ctx))) v4l2_m2m_buf_done(vb2_v4l2, VB2_BUF_STATE_ERROR); - if (ctx->is_drm_mode && q->memory == VB2_MEMORY_DMABUF) - aml_recycle_dma_buffers(ctx); + for (i = 0; i < q->num_buffers; ++i) { + vb2_v4l2 = to_vb2_v4l2_buffer(q->bufs[i]); + if (vb2_v4l2->vb2_buf.state == VB2_BUF_STATE_ACTIVE) + v4l2_m2m_buf_done(vb2_v4l2, VB2_BUF_STATE_ERROR); + } } else { /* clean output cache and decoder status . */ if (ctx->state > AML_STATE_INIT) aml_vdec_reset(ctx); + while ((vb2_v4l2 = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx))) + v4l2_m2m_buf_done(vb2_v4l2, VB2_BUF_STATE_ERROR); + for (i = 0; i < q->num_buffers; ++i) { vb2_v4l2 = to_vb2_v4l2_buffer(q->bufs[i]); buf = container_of(vb2_v4l2, struct aml_video_dec_buf, vb); |