From d4a384dacd27f1f5063914454275ad7f41b85fd5 Mon Sep 17 00:00:00 2001 From: Ayoung Sim Date: Wed, 20 Jun 2018 15:22:47 +0900 Subject: [PATCH] [COMMON] media: mfc: DRV4.0: update prefix [BUFINFO] Change-Id: I8439b59c2707cb8fd61682c23edf2d4cfe2074fc Signed-off-by: Ayoung Sim --- .../platform/exynos/mfc/s5p_mfc_dec_vb2_ops.c | 8 +-- .../platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c | 8 +-- .../media/platform/exynos/mfc/s5p_mfc_irq.c | 16 +++-- .../media/platform/exynos/mfc/s5p_mfc_nal_q.c | 61 ++++++++++++------- .../media/platform/exynos/mfc/s5p_mfc_otf.c | 4 +- .../media/platform/exynos/mfc/s5p_mfc_queue.c | 3 - .../media/platform/exynos/mfc/s5p_mfc_reg.c | 53 +++++++++------- 7 files changed, 91 insertions(+), 62 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_dec_vb2_ops.c b/drivers/media/platform/exynos/mfc/s5p_mfc_dec_vb2_ops.c index 7f6cbed1912d..962f53b130ef 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_dec_vb2_ops.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_dec_vb2_ops.c @@ -581,8 +581,8 @@ static void s5p_mfc_dec_buf_queue(struct vb2_buffer *vb) } if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { - mfc_debug(2, "[STREAM] Adding to src index[%d] 0x%08llx\n", - vb->index, buf->addr[0][0]); + mfc_debug(2, "[BUFINFO] ctx[%d] add src index:%d, addr: 0x%08llx\n", + ctx->num, vb->index, buf->addr[0][0]); if (dec->dst_memtype == V4L2_MEMORY_DMABUF && ctx->state < MFCINST_HEAD_PARSED && !ctx->is_drm) stream_vir = vb2_plane_vaddr(vb, 0); @@ -595,8 +595,8 @@ static void s5p_mfc_dec_buf_queue(struct vb2_buffer *vb) vb->index, vb->planes[0].m.fd, buf->addr[0][0]); } else if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { for (i = 0; i < ctx->dst_fmt->mem_planes; i++) - mfc_debug(2, "[FRAME] Adding to dst index[%d] plane[%d] 0x%08llx\n", - vb->index, i, buf->addr[0][i]); + mfc_debug(2, "[BUFINFO] ctx[%d] add dst index: %d, addr[%d]: 0x%08llx\n", + ctx->num, vb->index, i, buf->addr[0][i]); s5p_mfc_store_dpb(ctx, vb); if ((dec->dst_memtype == V4L2_MEMORY_USERPTR || dec->dst_memtype == V4L2_MEMORY_DMABUF) && 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 77df3f8884ea..6648d8a4e4b2 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 @@ -439,15 +439,15 @@ static void s5p_mfc_enc_buf_queue(struct vb2_buffer *vb) buf->done_index = 0; if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { - mfc_debug(2, "[STREAM] Adding to dst index[%d] 0x%08llx\n", - vb->index, buf->addr[0][0]); + mfc_debug(2, "[BUFINFO] ctx[%d] add dst index: %d, addr: 0x%08llx\n", + ctx->num, vb->index, buf->addr[0][0]); /* Mark destination as available for use by MFC */ s5p_mfc_add_tail_buf(&ctx->buf_queue_lock, &ctx->dst_buf_queue, buf); } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { for (i = 0; i < ctx->src_fmt->mem_planes; i++) - mfc_debug(2, "[FRAME] Adding to src index[%d] plane[%d] 0x%08llx\n", - vb->index, i, buf->addr[0][i]); + mfc_debug(2, "[BUFINFO] ctx[%d] add src index: %d, addr[%d]: 0x%08llx\n", + ctx->num, vb->index, i, buf->addr[0][i]); s5p_mfc_add_tail_buf(&ctx->buf_queue_lock, &ctx->src_buf_queue, buf); if (debug_ts == 1) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index e7a5c636a9d0..9d7ec9aab1c1 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -256,8 +256,8 @@ static void mfc_handle_frame_output_del(struct s5p_mfc_ctx *ctx, if (ref_mb) { index = ref_mb->vb.vb2_buf.index; /* Check if this is the buffer we're looking for */ - mfc_debug(2, "[DPB] Found buf[%d] 0x%08llx, looking for disp addr 0x%08llx\n", - index, ref_mb->addr[0][0], dspl_y_addr); + mfc_debug(2, "[BUFINFO][DPB] ctx[%d] get dst index: %d, addr[0]: 0x%08llx\n", + ctx->num, index, ref_mb->addr[0][0]); ref_mb->vb.sequence = ctx->sequence; ref_mb->vb.field = mfc_handle_frame_field(ctx); @@ -550,6 +550,10 @@ static void mfc_handle_frame_input(struct s5p_mfc_ctx *ctx, unsigned int err) return; } + index = src_mb->vb.vb2_buf.index; + mfc_debug(2, "[BUFINFO] ctx[%d] get src index: %d, addr: 0x%08llx\n", + ctx->num, index, src_mb->addr[0][0]); + if (!deleted) { /* Run MFC again on the same buffer */ mfc_debug(2, "Running again the same buffer.\n"); @@ -568,11 +572,9 @@ static void mfc_handle_frame_input(struct s5p_mfc_ctx *ctx, unsigned int err) return; } - index = src_mb->vb.vb2_buf.index; if (call_cop(ctx, recover_buf_ctrls_val, ctx, &ctx->src_ctrls[index]) < 0) mfc_err_ctx("failed in recover_buf_ctrls_val\n"); - mfc_debug(2, "MFC needs next buffer.\n"); dec->consumed = 0; dec->remained_size = 0; @@ -775,7 +777,8 @@ static void mfc_handle_stream_input(struct s5p_mfc_ctx *ctx) goto move_buf; } for (i = 0; i < raw->num_planes; i++) - mfc_debug(2, "[FRAME] encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]); + mfc_debug(2, "[BUFINFO] ctx[%d] get src addr[%d]: 0x%08llx\n", + ctx->num, i, enc_addr[i]); if (IS_BUFFER_BATCH_MODE(ctx)) { src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock, @@ -877,6 +880,9 @@ static void mfc_handle_stream_output(struct s5p_mfc_ctx *ctx, int slice_type, return; } + mfc_debug(2, "[BUFINFO] ctx[%d] get dst addr: 0x%08llx\n", + ctx->num, dst_mb->addr[0][0]); + dst_mb->vb.flags &= ~(V4L2_BUF_FLAG_KEYFRAME | V4L2_BUF_FLAG_PFRAME | V4L2_BUF_FLAG_BFRAME); 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 6282dc7adb91..e4176dad4e9c 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -651,10 +651,11 @@ static int mfc_nal_q_run_in_buf_enc(struct s5p_mfc_ctx *ctx, EncoderInputStr *pI } } + index = src_mb->vb.vb2_buf.index; for (i = 0; i < raw->num_planes; i++) { src_addr[i] = src_mb->addr[src_mb->next_index][i]; - mfc_debug(2, "NAL Q: enc batch buf[%d] src[%d] addr: 0x%08llx\n", - src_mb->next_index, i, src_addr[i]); + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src index:%d, batch[%d], addr[%d]: 0x%08llx\n", + ctx->num, index, src_mb->next_index, i, src_addr[i]); } src_mb->next_index++; } else { @@ -667,10 +668,11 @@ static int mfc_nal_q_run_in_buf_enc(struct s5p_mfc_ctx *ctx, EncoderInputStr *pI return -EAGAIN; } + index = src_mb->vb.vb2_buf.index; for (i = 0; i < raw->num_planes; i++) { src_addr[i] = src_mb->addr[0][i]; - mfc_debug(2, "NAL Q: enc src[%d] addr: 0x%08llx\n", - i, src_addr[i]); + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src index:%d, addr[%d]: 0x%08llx\n", + ctx->num, index, i, src_addr[i]); } } @@ -682,15 +684,21 @@ static int mfc_nal_q_run_in_buf_enc(struct s5p_mfc_ctx *ctx, EncoderInputStr *pI addr_2bit[0] = src_addr[0] + NV12N_Y_SIZE(ctx->img_width, ctx->img_height); addr_2bit[1] = src_addr[1] + NV12N_CBCR_SIZE(ctx->img_width, ctx->img_height); - for (i = 0; i < raw->num_planes; i++) + for (i = 0; i < raw->num_planes; i++) { pInStr->Frame2bitAddr[i] = addr_2bit[i]; + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n", + ctx->num, index, i, addr_2bit[i]); + } } else if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV16M_S10B || ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV61M_S10B) { addr_2bit[0] = src_addr[0] + NV16M_Y_SIZE(ctx->img_width, ctx->img_height); addr_2bit[1] = src_addr[1] + NV16M_CBCR_SIZE(ctx->img_width, ctx->img_height); - for (i = 0; i < raw->num_planes; i++) + for (i = 0; i < raw->num_planes; i++) { pInStr->Frame2bitAddr[i] = addr_2bit[i]; + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n", + ctx->num, index, i, addr_2bit[i]); + } } /* move dst_queue -> dst_queue_nal_q */ @@ -705,12 +713,11 @@ static int mfc_nal_q_run_in_buf_enc(struct s5p_mfc_ctx *ctx, EncoderInputStr *pI pInStr->StreamBufferSize = (unsigned int)vb2_plane_size(&dst_mb->vb.vb2_buf, 0); pInStr->StreamBufferSize = ALIGN(pInStr->StreamBufferSize, 512); - mfc_debug(2, "NAL Q: enc dst addr: 0x%x\n", pInStr->StreamBufferAddr); - - index = src_mb->vb.vb2_buf.index; if (call_cop(ctx, set_buf_ctrls_val_nal_q_enc, ctx, &ctx->src_ctrls[index], pInStr) < 0) mfc_err_ctx("NAL Q: failed in set_buf_ctrals_val in nal q\n"); + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set dst index: %d, addr: 0x%08llx\n", + ctx->num, dst_mb->vb.vb2_buf.index, pInStr->StreamBufferAddr); mfc_debug(2, "NAL Q: input queue, src_buf_queue -> src_buf_nal_queue, index:%d\n", src_mb->vb.vb2_buf.index); mfc_debug(2, "NAL Q: input queue, dst_buf_queue -> dst_buf_nal_queue, index:%d\n", @@ -786,10 +793,10 @@ static int mfc_nal_q_run_in_buf_dec(struct s5p_mfc_ctx *ctx, DecoderInputStr *pI } /* src buffer setting */ + src_index = src_mb->vb.vb2_buf.index; buf_addr = src_mb->addr[0][0]; strm_size = src_mb->vb.vb2_buf.planes[0].bytesused; cpb_buf_size = ALIGN(dec->src_buf_size, STREAM_BUF_ALIGN); - mfc_debug(2, "NAL Q: Src addr: 0x%08llx, size: %d\n", buf_addr, strm_size); if (strm_size > set_strm_size_max(cpb_buf_size)) { mfc_info_ctx("NAL Q: Decrease strm_size : %u -> %u, gap : %d\n", @@ -798,6 +805,11 @@ static int mfc_nal_q_run_in_buf_dec(struct s5p_mfc_ctx *ctx, DecoderInputStr *pI src_mb->vb.vb2_buf.planes[0].bytesused = strm_size; } + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src index: %d, addr: 0x%08llx\n", + ctx->num, src_index, buf_addr); + mfc_debug(2, "NAL Q:[STREAM] strm_size: %#lx(%d), buf_size: %u\n", + strm_size, strm_size, cpb_buf_size); + if (strm_size == 0) mfc_info_ctx("stream size is 0\n"); @@ -807,9 +819,7 @@ static int mfc_nal_q_run_in_buf_dec(struct s5p_mfc_ctx *ctx, DecoderInputStr *pI pInStr->CpbBufferOffset = 0; MFC_TRACE_CTX("Set src[%d] fd: %d, %#llx\n", - src_mb->vb.vb2_buf.index, - src_mb->vb.vb2_buf.planes[0].m.fd, - buf_addr); + src_index, src_mb->vb.vb2_buf.planes[0].m.fd, buf_addr); /* dst buffer setting */ dst_index = dst_mb->vb.vb2_buf.index; @@ -821,14 +831,13 @@ static int mfc_nal_q_run_in_buf_dec(struct s5p_mfc_ctx *ctx, DecoderInputStr *pI pInStr->FrameAddr[i] = dst_mb->addr[0][i]; if (ctx->is_10bit) pInStr->Frame2BitSize[i] = raw->plane_size_2bits[i]; - mfc_debug(2, "NAL Q:[DPB] Dst buf[%d] plane[%d] addr 0x%08llx\n", - dst_index, i, dst_mb->addr[0][i]); + mfc_debug(2, "NAL Q:[BUFINFO][DPB] ctx[%d] set dst index: %d, addr[%d]: 0x%08llx\n", + ctx->num, dst_index, i, dst_mb->addr[0][i]); } pInStr->ScratchBufAddr = ctx->codec_buf.daddr; pInStr->ScratchBufSize = ctx->scratch_buf_size; - src_index = src_mb->vb.vb2_buf.index; if (call_cop(ctx, set_buf_ctrls_val_nal_q_dec, ctx, &ctx->src_ctrls[src_index], pInStr) < 0) mfc_err_ctx("NAL Q: failed in set_buf_ctrls_val\n"); @@ -860,8 +869,8 @@ static void mfc_nal_q_get_enc_frame_buffer(struct s5p_mfc_ctx *ctx, enc_recon_y_addr = pOutStr->ReconLumaDpbAddr; enc_recon_c_addr = pOutStr->ReconChromaDpbAddr; - mfc_debug(2, "NAL Q: recon y addr: 0x%08lx\n", enc_recon_y_addr); - mfc_debug(2, "NAL Q: recon c addr: 0x%08lx\n", enc_recon_c_addr); + mfc_debug(2, "NAL Q:[MEMINFO] recon y: 0x%08lx c: 0x%08lx\n", + enc_recon_y_addr, enc_recon_c_addr); } static void mfc_nal_q_handle_stream_copy_timestamp(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *src_mb) @@ -917,7 +926,8 @@ static void mfc_nal_q_handle_stream_input(struct s5p_mfc_ctx *ctx, EncoderOutput } for (i = 0; i < raw->num_planes; i++) - mfc_debug(2, "NAL Q:[FRAME] encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]); + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] get src addr[%d]: 0x%08llx\n", + ctx->num, i, enc_addr[i]); if (IS_BUFFER_BATCH_MODE(ctx)) { src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock, @@ -1015,6 +1025,9 @@ static void mfc_nal_q_handle_stream_output(struct s5p_mfc_ctx *ctx, int slice_ty return; } + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] get dst addr: 0x%08llx\n", + ctx->num, dst_mb->addr[0][0]); + dst_mb->vb.flags &= ~(V4L2_BUF_FLAG_KEYFRAME | V4L2_BUF_FLAG_PFRAME | V4L2_BUF_FLAG_BFRAME); @@ -1258,8 +1271,8 @@ static void mfc_nal_q_handle_frame_output_del(struct s5p_mfc_ctx *ctx, index = ref_mb->vb.vb2_buf.index; /* Check if this is the buffer we're looking for */ - mfc_debug(2, "NAL Q:[DPB] Found buf[%d] 0x%08llx, looking for disp addr 0x%08llx\n", - index, ref_mb->addr[0][0], dspl_y_addr); + mfc_debug(2, "NAL Q:[BUFINFO][DPB] ctx[%d] get dst index: %d, addr[0]: 0x%08llx\n", + ctx->num, index, ref_mb->addr[0][0]); ref_mb->vb.sequence = ctx->sequence; @@ -1433,6 +1446,10 @@ static void mfc_nal_q_handle_frame_input(struct s5p_mfc_ctx *ctx, unsigned int e return; } + index = src_mb->vb.vb2_buf.index; + mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] get src index: %d, addr: 0x%08llx\n", + ctx->num, index, src_mb->addr[0][0]); + if (!deleted) { /* Run MFC again on the same buffer */ mfc_debug(2, "NAL Q: Running again the same buffer.\n"); @@ -1452,12 +1469,10 @@ static void mfc_nal_q_handle_frame_input(struct s5p_mfc_ctx *ctx, unsigned int e return; } - index = src_mb->vb.vb2_buf.index; if (call_cop(ctx, get_buf_ctrls_val_nal_q_dec, ctx, &ctx->src_ctrls[index], pOutStr) < 0) mfc_err_ctx("NAL Q: failed in get_buf_ctrls_val\n"); - mfc_debug(2, "NAL Q: MFC needs next buffer.\n"); dec->consumed = 0; dec->remained_size = 0; diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c index 57af2d1e3c46..b4b83ae54b1c 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c @@ -528,8 +528,8 @@ int s5p_mfc_otf_handle_stream(struct s5p_mfc_ctx *ctx) s5p_mfc_get_enc_frame_buffer(ctx, &enc_addr[0], raw->num_planes); for (i = 0; i < raw->num_planes; i++) - mfc_debug(2, "OTF: encoded[%d] addr: 0x%08llx\n", - i, enc_addr[i]); + mfc_debug(2, "OTF:[BUFINFO] ctx[%d] get src addr[%d]: 0x%08llx\n", + ctx->num, i, enc_addr[i]); if (enc_addr[0] != buf_addr->otf_daddr[handle->otf_buf_index][0]) { mfc_err_ctx("OTF: address is not matched. 0x%08llx != 0x%08llx\n", enc_addr[0], buf_addr->otf_daddr[handle->otf_buf_index][0]); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c b/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c index 2df70eaf17bc..379d7d43a228 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c @@ -27,9 +27,6 @@ void s5p_mfc_add_tail_buf(spinlock_t *plock, struct s5p_mfc_buf_queue *queue, spin_lock_irqsave(plock, flags); - mfc_debug(2, "queue address: 0x%p\n", queue); - mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf); - mfc_buf->used = 0; list_add_tail(&mfc_buf->list, &queue->head); queue->count++; diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c index acb3a8e21cf1..665e98054e3d 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c @@ -271,6 +271,7 @@ int s5p_mfc_set_dec_stream_buffer(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *m struct s5p_mfc_dec *dec; unsigned int cpb_buf_size; dma_addr_t addr; + int index = -1; mfc_debug_enter(); if (!ctx) { @@ -291,6 +292,7 @@ int s5p_mfc_set_dec_stream_buffer(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *m cpb_buf_size = ALIGN(dec->src_buf_size, STREAM_BUF_ALIGN); if (mfc_buf) { + index = mfc_buf->vb.vb2_buf.index; addr = mfc_buf->addr[0][0]; if (strm_size > set_strm_size_max(cpb_buf_size)) { mfc_info_ctx("Decrease strm_size because of %d align: %u -> %u\n", @@ -302,9 +304,10 @@ int s5p_mfc_set_dec_stream_buffer(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *m addr = 0; } - mfc_debug(2, "inst_no: %d, buf_addr: 0x%08llx\n", ctx->inst_no, addr); - mfc_debug(2, "strm_size: %u cpb_buf_size: %u offset: %u\n", - strm_size, cpb_buf_size, start_num_byte); + mfc_debug(2, "[BUFINFO] ctx[%d] set src index: %d, addr: 0x%08llx\n", + ctx->num, index, addr); + mfc_debug(2, "[STREAM] strm_size: %#lx(%d), buf_size: %u, offset: %u\n", + strm_size, strm_size, cpb_buf_size, start_num_byte); if (strm_size == 0) mfc_info_ctx("stream size is 0\n"); @@ -316,9 +319,7 @@ int s5p_mfc_set_dec_stream_buffer(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *m if (mfc_buf) MFC_TRACE_CTX("Set src[%d] fd: %d, %#llx\n", - mfc_buf->vb.vb2_buf.index, - mfc_buf->vb.vb2_buf.planes[0].m.fd, - addr); + index, mfc_buf->vb.vb2_buf.planes[0].m.fd, addr); mfc_debug_leave(); return 0; @@ -330,24 +331,26 @@ void s5p_mfc_set_enc_frame_buffer(struct s5p_mfc_ctx *ctx, struct s5p_mfc_dev *dev = ctx->dev; dma_addr_t addr[3] = { 0, 0, 0 }; dma_addr_t addr_2bit[2] = { 0, 0 }; - int i; + int index, i; if (!mfc_buf) { mfc_debug(3, "enc zero buffer set\n"); goto buffer_set; } + index = mfc_buf->vb.vb2_buf.index; if (mfc_buf->num_bufs_in_vb > 0) { for (i = 0; i < num_planes; i++) { addr[i] = mfc_buf->addr[mfc_buf->next_index][i]; - mfc_debug(2, "enc batch buf[%d] src[%d] addr: 0x%08llx\n", - mfc_buf->next_index, i, addr[i]); + mfc_debug(2, "[BUFINFO] ctx[%d] set src index:%d, batch[%d], addr[%d]: 0x%08llx\n", + ctx->num, index, mfc_buf->next_index, i, addr[i]); } mfc_buf->next_index++; } else { for (i = 0; i < num_planes; i++) { addr[i] = mfc_buf->addr[0][i]; - mfc_debug(2, "enc src[%d] addr: 0x%08llx\n", i, addr[i]); + mfc_debug(2, "[BUFINFO] ctx[%d] set src index:%d, addr[%d]: 0x%08llx\n", + ctx->num, index, i, addr[i]); } } @@ -360,15 +363,21 @@ buffer_set: addr_2bit[0] = addr[0] + NV12N_10B_Y_8B_SIZE(ctx->img_width, ctx->img_height); addr_2bit[1] = addr[1] + NV12N_10B_CBCR_8B_SIZE(ctx->img_width, ctx->img_height); - for (i = 0; i < num_planes; i++) + for (i = 0; i < num_planes; i++) { MFC_WRITEL(addr_2bit[i], S5P_FIMV_E_SOURCE_FIRST_2BIT_ADDR + (i * 4)); + mfc_debug(2, "[BUFINFO][10BIT] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n", + ctx->num, i, addr_2bit[i]); + } } else if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV16M_S10B || ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV61M_S10B) { addr_2bit[0] = addr[0] + NV16M_Y_SIZE(ctx->img_width, ctx->img_height); addr_2bit[1] = addr[1] + NV16M_CBCR_SIZE(ctx->img_width, ctx->img_height); - for (i = 0; i < num_planes; i++) + for (i = 0; i < num_planes; i++) { MFC_WRITEL(addr_2bit[i], S5P_FIMV_E_SOURCE_FIRST_2BIT_ADDR + (i * 4)); + mfc_debug(2, "[BUFINFO][10BIT] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n", + ctx->num, i, addr_2bit[i]); + } } } @@ -378,8 +387,9 @@ int s5p_mfc_set_enc_stream_buffer(struct s5p_mfc_ctx *ctx, { struct s5p_mfc_dev *dev = ctx->dev; dma_addr_t addr; - unsigned int size, offset; + unsigned int size, offset, index; + index = mfc_buf->vb.vb2_buf.index; addr = mfc_buf->addr[0][0]; offset = mfc_buf->vb.vb2_buf.planes[0].data_offset; size = (unsigned int)vb2_plane_size(&mfc_buf->vb.vb2_buf, 0); @@ -389,8 +399,9 @@ int s5p_mfc_set_enc_stream_buffer(struct s5p_mfc_ctx *ctx, MFC_WRITEL(size, S5P_FIMV_E_STREAM_BUFFER_SIZE); MFC_WRITEL(offset, S5P_FIMV_E_STREAM_BUFFER_OFFSET); - mfc_debug(2, "stream buf addr: 0x%08llx, size: 0x%08x(%d), offset: %d\n", - addr, size, size, offset); + mfc_debug(2, "[BUFINFO] ctx[%d] set dst index: %d, addr: 0x%08llx\n", + ctx->num, index, addr); + mfc_debug(2, "[STREAM] buf_size: %u, offset: %d\n", size, offset); return 0; } @@ -410,8 +421,8 @@ void s5p_mfc_get_enc_frame_buffer(struct s5p_mfc_ctx *ctx, enc_recon_y_addr = MFC_READL(S5P_FIMV_E_RECON_LUMA_DPB_ADDR); enc_recon_c_addr = MFC_READL(S5P_FIMV_E_RECON_CHROMA_DPB_ADDR); - mfc_debug(2, "recon y addr: 0x%08lx\n", enc_recon_y_addr); - mfc_debug(2, "recon c addr: 0x%08lx\n", enc_recon_c_addr); + mfc_debug(2, "[MEMINFO] recon y: 0x%08lx c: 0x%08lx\n", + enc_recon_y_addr, enc_recon_c_addr); } void s5p_mfc_set_enc_stride(struct s5p_mfc_ctx *ctx) @@ -422,8 +433,8 @@ void s5p_mfc_set_enc_stride(struct s5p_mfc_ctx *ctx) for (i = 0; i < ctx->raw_buf.num_planes; i++) { MFC_WRITEL(ctx->raw_buf.stride[i], S5P_FIMV_E_SOURCE_FIRST_STRIDE + (i * 4)); - mfc_debug(2, "enc src[%d] stride: 0x%08lx\n", - i, (unsigned long)ctx->raw_buf.stride[i]); + mfc_debug(2, "[FRAME] enc src plane[%d] stride: %d\n", + i, ctx->raw_buf.stride[i]); } } @@ -465,8 +476,8 @@ int s5p_mfc_set_dynamic_dpb(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *dst_mb) if (ctx->is_10bit) MFC_WRITEL(raw->plane_size_2bits[i], S5P_FIMV_D_FIRST_PLANE_2BIT_DPB_SIZE + (i * 4)); - mfc_debug(2, "[DPB] Dst buf[%d] plane[%d] addr 0x%08llx\n", - dst_index, i, dst_mb->addr[0][i]); + mfc_debug(2, "[BUFINFO][DPB] ctx[%d] set dst index: %d, addr[%d]: 0x%08llx\n", + ctx->num, dst_index, i, dst_mb->addr[0][i]); } MFC_TRACE_CTX("Set dst[%d] fd: %d, %#llx / avail %#lx used %#x\n", -- 2.20.1