From: Seung-Woo Kim Date: Sat, 31 Oct 2015 08:24:54 +0000 (+0900) Subject: media: s5p-mfc: set src_bufs_cnt with requested buffer for DMABUF and USERPTR X-Git-Tag: submit/tizen/20151103.071105^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=204daf02766b36d3f652c3436b058dc484510916;p=platform%2Fkernel%2Flinux-exynos.git media: s5p-mfc: set src_bufs_cnt with requested buffer for DMABUF and USERPTR During start_streaming of output, it checks src_bufs_cnt compared with pb_count. But it is only meaningful for MMAP memory. So this patch fixes to set src_bufs_cnt with requested buffer for non MMAP memory. Change-Id: Icd447f1b82a6b805be4aa54843ce979265f7e17d Signed-off-by: Seung-Woo Kim --- diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index e370623e68d6..e0eb1dc5a491 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -1200,6 +1200,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, mfc_err("error in vb2_reqbufs() for E(S)\n"); return ret; } + if (reqbufs->memory != V4L2_MEMORY_MMAP) + ctx->src_bufs_cnt = reqbufs->count; ctx->output_state = QUEUE_BUFS_REQUESTED; } else { mfc_err("invalid buf type\n"); @@ -1892,7 +1894,8 @@ static int s5p_mfc_buf_init(struct vb2_buffer *vb) vb2_dma_contig_plane_dma_addr(vb, 0); ctx->src_bufs[i].cookie.raw.chroma = vb2_dma_contig_plane_dma_addr(vb, 1); - ctx->src_bufs_cnt++; + if (vb->v4l2_buf.memory == V4L2_MEMORY_MMAP) + ctx->src_bufs_cnt++; } else { mfc_err("inavlid queue type: %d\n", vq->type); return -EINVAL;