vdec->type = VDEC_TYPE_STREAM_PARSER;
vdec->port->type &= ~PORT_TYPE_FRAME;
vdec->port->type |= PORT_TYPE_ES;
- ada_ctx->ctx->is_stream_mode = true;
} else if (aml_set_vdec_type == VDEC_TYPE_FRAME_BLOCK) {
vdec->type = VDEC_TYPE_FRAME_BLOCK;
vdec->port->type &= ~PORT_TYPE_ES;
vdec->port->type |= PORT_TYPE_FRAME;
- ada_ctx->ctx->is_stream_mode = false;
}
}
ATRACE_COUNTER("v4l2_dqin_eagain", 0);
else
ATRACE_COUNTER("v4l2_dqin_ok", 0);
- } else if (!V4L2_TYPE_IS_OUTPUT(buf->type)) {
+ } else {
if (ret == -EAGAIN)
ATRACE_COUNTER("v4l2_dqout_eagain", 0);
}
struct aml_video_dec_buf *aml_buf = NULL;
struct file *file = NULL;
+ if (ctx->is_drm_mode && ctx->output_dma_mode)
+ aml_recycle_dma_buffers(ctx);
+
vq = v4l2_m2m_get_vq(ctx->m2m_ctx, buf->type);
vb2_v4l2 = to_vb2_v4l2_buffer(vq->bufs[buf->index]);
aml_buf = container_of(vb2_v4l2, struct aml_video_dec_buf, vb);
src_mem.size = vb->planes[0].bytesused;
src_mem.model = vb->memory;
+ if (vb->memory == VB2_MEMORY_DMABUF) {
+ v4l_dbg(ctx, V4L_DEBUG_CODEC_INPUT,
+ "%s, output_dma_mode set", __func__);
+ ctx->output_dma_mode = true;
+ }
+
if (vdec_if_probe(ctx, &src_mem, NULL)) {
v4l2_m2m_src_buf_remove(ctx->m2m_ctx);