From: Ayoung Sim Date: Wed, 11 Oct 2017 00:04:18 +0000 (+0900) Subject: media: mfc: change the unmap location X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=86c95db3a927102ba5ae18ef455dd9e1ce7dbf54;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git media: mfc: change the unmap location Dma buffers in buffer container is mapped in buf_init, so it should be unmapped in buf_cleanup. Change-Id: Id1d354e8d51a6652306ef6a98d92492a3ebaf980 Signed-off-by: Ayoung Sim --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c b/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c index 757e77d66240..56c8d61587cf 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c @@ -297,6 +297,13 @@ static void s5p_mfc_enc_buf_cleanup(struct vb2_buffer *vb) MFC_CTRL_TYPE_DST, index) < 0) mfc_err_ctx("failed in cleanup_buf_ctrls\n"); } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + if (IS_BUFFER_BATCH_MODE(ctx)) { + struct s5p_mfc_buf *buf = vb_to_mfc_buf(vb); + int i; + + for (i = 0; i < ctx->src_fmt->num_planes; i++) + s5p_mfc_bufcon_put_daddr(ctx, buf, i); + } if (call_cop(ctx, cleanup_buf_ctrls, ctx, MFC_CTRL_TYPE_SRC, index) < 0) mfc_err_ctx("failed in cleanup_buf_ctrls\n"); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index 4e04919021c2..bb06159d2f2a 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -833,11 +833,8 @@ static void mfc_handle_stream_input(struct s5p_mfc_ctx *ctx, int slice_type) src_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock, &ctx->src_buf_queue, enc_addr[0], ctx->num_bufs_in_vb); - if (src_mb) { - for (i = 0; i < raw->num_planes; i++) - s5p_mfc_bufcon_put_daddr(ctx, src_mb, i); + if (src_mb) vb2_buffer_done(&src_mb->vb.vb2_buf, VB2_BUF_STATE_DONE); - } } /* encoder src buffer CFW UNPROT */ diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c index f4b6503c295f..bad76fcd96a1 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -877,11 +877,8 @@ static void mfc_nal_q_handle_stream_input(struct s5p_mfc_ctx *ctx, int slice_typ src_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock, &ctx->src_buf_nal_queue, enc_addr[0], ctx->num_bufs_in_vb); - if (src_mb) { - for (i = 0; i < raw->num_planes; i++) - s5p_mfc_bufcon_put_daddr(ctx, src_mb, i); + if (src_mb) vb2_buffer_done(&src_mb->vb.vb2_buf, VB2_BUF_STATE_DONE); - } } } }