media: mfc: change the unmap location
authorAyoung Sim <a.sim@samsung.com>
Wed, 11 Oct 2017 00:04:18 +0000 (09:04 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:21 +0000 (20:22 +0300)
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 <a.sim@samsung.com>
drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c
drivers/media/platform/exynos/mfc/s5p_mfc_irq.c
drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c

index 757e77d6624083bb543e9c9938091d928b7a2de1..56c8d61587cf334034a0afde9e4995b57c49f831 100644 (file)
@@ -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");
index 4e04919021c263e55589163d818fb379ac6b0b00..bb06159d2f2ae1e93ae536bc8f03e5e309604354 100644 (file)
@@ -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 */
index f4b6503c295f13583488af8c0a63bac3d11fc924..bad76fcd96a10bb556bb92c57eee568905a391e9 100644 (file)
@@ -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);
-                                               }
                                        }
                                }
                        }