From 51371b49e59eb9deb861d4127cf3459c606ea371 Mon Sep 17 00:00:00 2001 From: Ayoung Sim Date: Mon, 18 Jun 2018 16:49:21 +0900 Subject: [PATCH] [COMMON] media: mfc: DRV4.0: update prefix [DPB] Change-Id: I446df75e07f08bbb85116351bb023962c8131fc6 Signed-off-by: Ayoung Sim --- .../media/platform/exynos/mfc/s5p_mfc_dec.c | 6 +- .../media/platform/exynos/mfc/s5p_mfc_irq.c | 36 +++++------ .../media/platform/exynos/mfc/s5p_mfc_nal_q.c | 48 +++++++------- .../media/platform/exynos/mfc/s5p_mfc_opr.c | 4 +- .../media/platform/exynos/mfc/s5p_mfc_queue.c | 63 +++++++++---------- .../media/platform/exynos/mfc/s5p_mfc_reg.c | 5 +- 6 files changed, 80 insertions(+), 82 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c index 41734b1d13f1..64c0b3988de3 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c @@ -762,7 +762,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) for (ncount = 0; ncount < MFC_MAX_DPBS; ncount++) { if (srcBuf->dpb[ncount].fd[0] == MFC_INFO_INIT_FD) break; - mfc_debug(2, "DQ index[%d] Released FD = %d\n", + mfc_debug(2, "[DPB] DQ index[%d] Released FD = %d\n", buf->index, srcBuf->dpb[ncount].fd[0]); } @@ -1076,7 +1076,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, ctx->wait_state = ctrl->value; break; case V4L2_CID_MPEG_MFC_SET_DUAL_DPB_MODE: - mfc_err_dev("not supported CID: 0x%x\n",ctrl->id); + mfc_err_dev("[DPB] not supported CID: 0x%x\n",ctrl->id); break; case V4L2_CID_MPEG_VIDEO_QOS_RATIO: ctx->qos_ratio = ctrl->value; @@ -1085,7 +1085,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, case V4L2_CID_MPEG_MFC_SET_DYNAMIC_DPB_MODE: dec->is_dynamic_dpb = ctrl->value; if (dec->is_dynamic_dpb == 0) - mfc_err_dev("is_dynamic_dpb is 0. it has to be enabled.\n"); + mfc_err_dev("[DPB] is_dynamic_dpb is 0. it has to be enabled.\n"); break; case V4L2_CID_MPEG_MFC_SET_USER_SHARED_HANDLE: if (dec->sh_handle.fd == -1) { diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index c26e1f6267af..6e5e452ac64a 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -194,21 +194,20 @@ static void mfc_handle_frame_output_move(struct s5p_mfc_ctx *ctx, ref_mb = s5p_mfc_find_move_buf(&ctx->buf_queue_lock, &ctx->dst_buf_queue, &ctx->ref_buf_queue, dspl_y_addr, released_flag); if (ref_mb) { - mfc_debug(2, "Listing: %d\n", ref_mb->vb.vb2_buf.index); - /* Check if this is the buffer we're looking for */ - mfc_debug(2, "Found 0x%08llx, looking for 0x%08llx\n", - ref_mb->addr[0][0], dspl_y_addr); - 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); + if (released_flag & (1 << index)) { dec->available_dpb &= ~(1 << index); released_flag &= ~(1 << index); - mfc_debug(2, "Corrupted frame(%d), it will be re-used(release)\n", + mfc_debug(2, "[DPB] Corrupted frame(%d), it will be re-used(release)\n", s5p_mfc_get_warn(s5p_mfc_get_int_err())); } else { dec->err_reuse_flag |= 1 << index; - mfc_debug(2, "Corrupted frame(%d), it will be re-used(not released)\n", + mfc_debug(2, "[DPB] Corrupted frame(%d), it will be re-used(not released)\n", s5p_mfc_get_warn(s5p_mfc_get_int_err())); } dec->dynamic_used |= released_flag; @@ -255,12 +254,10 @@ static void mfc_handle_frame_output_del(struct s5p_mfc_ctx *ctx, ref_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock, &ctx->ref_buf_queue, dspl_y_addr); if (ref_mb) { - mfc_debug(2, "Listing: %d\n", ref_mb->vb.vb2_buf.index); - /* Check if this is the buffer we're looking for */ - mfc_debug(2, "Found 0x%08llx, looking for 0x%08llx\n", - ref_mb->addr[0][0], dspl_y_addr); - 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); ref_mb->vb.sequence = ctx->sequence; ref_mb->vb.field = mfc_handle_frame_field(ctx); @@ -415,8 +412,8 @@ static void mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err) dec->dynamic_used = s5p_mfc_get_dec_used_flag(); released_flag = prev_flag & (~dec->dynamic_used); - mfc_debug(2, "Used flag = %08x, Released Buffer = %08x\n", - dec->dynamic_used, released_flag); + mfc_debug(2, "[DPB] Used flag: old = %08x, new = %08x, Released buffer = %08x\n", + prev_flag, dec->dynamic_used, released_flag); /* decoder dst buffer CFW UNPROT */ s5p_mfc_unprotect_released_dpb(ctx, released_flag); @@ -480,21 +477,24 @@ static void mfc_handle_ref_frame(struct s5p_mfc_ctx *ctx) struct s5p_mfc_dev *dev = ctx->dev; struct s5p_mfc_dec *dec = ctx->dec_priv; struct s5p_mfc_buf *dst_mb; - dma_addr_t dec_addr; + dma_addr_t dec_addr, disp_addr; dec_addr = (dma_addr_t)s5p_mfc_get_dec_y_addr(); + disp_addr = (dma_addr_t)s5p_mfc_get_disp_y_addr(); + mfc_debug(2, "[DPB] dec addr: 0x%08llx, disp addr: 0x%08llx\n", + dec_addr, disp_addr); /* Try to search decoded address in whole dst queue */ dst_mb = s5p_mfc_find_move_buf_used(&ctx->buf_queue_lock, &ctx->ref_buf_queue, &ctx->dst_buf_queue, dec_addr); if (dst_mb) { - mfc_debug(2, "Found in dst queue = 0x%08llx, buf = 0x%08llx\n", + mfc_debug(2, "[DPB] Found in dst queue = 0x%08llx, buf = 0x%08llx\n", dec_addr, dst_mb->addr[0][0]); if (!(dec->dynamic_set & s5p_mfc_get_dec_used_flag())) dec->dynamic_used |= dec->dynamic_set; } else { - mfc_debug(2, "Can't find buffer for addr = 0x%08llx\n", dec_addr); + mfc_debug(2, "[DPB] Can't find buffer for addr = 0x%08llx\n", dec_addr); } } @@ -616,7 +616,7 @@ static void mfc_handle_frame(struct s5p_mfc_ctx *ctx, mfc_debug(4, "[HDR] SEI display primaries: 0x%08x, 0x%08x, 0x%08x\n", s5p_mfc_get_sei_mastering3(), s5p_mfc_get_sei_mastering4(), s5p_mfc_get_sei_mastering5()); - mfc_debug(2, "Used flag: old = %08x, new = %08x\n", + mfc_debug(2, "[DPB] Used flag: old = %08x, new = %08x\n", dec->dynamic_used, s5p_mfc_get_dec_used_flag()); if (ctx->state == MFCINST_RES_CHANGE_INIT) 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 a3db2d0b5d7c..24398a55d289 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -84,7 +84,7 @@ int s5p_mfc_nal_q_check_enable(struct s5p_mfc_dev *dev) return 0; } if (dec->is_dpb_full) { - mfc_debug(2, "All buffers are referenced\n"); + mfc_debug(2, "[DPB] All buffers are referenced\n"); return 0; } if (dec->is_interlaced) { @@ -772,7 +772,7 @@ static int mfc_nal_q_run_in_buf_dec(struct s5p_mfc_ctx *ctx, DecoderInputStr *pI /* Try to use the non-referenced DPB on dst-queue */ dst_mb = s5p_mfc_search_move_dpb_nal_q(ctx, dec->dynamic_used); if (!dst_mb) { - mfc_debug(2, "NAL Q: no dst buffers.\n"); + mfc_debug(2, "NAL Q:[DPB] couldn't find dst buffers\n"); return -EAGAIN; } @@ -821,9 +821,9 @@ 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: dst addr[0]: 0x%08llx\n", - dst_mb->addr[0][0]); pInStr->ScratchBufAddr = ctx->codec_buf.daddr; pInStr->ScratchBufSize = ctx->scratch_buf_size; @@ -1092,12 +1092,12 @@ static void mfc_nal_q_handle_reuse_buffer(struct s5p_mfc_ctx *ctx, DecoderOutput /* reuse not used buf: dst_buf_nal_queue -> dst_queue */ disp_addr = pOutStr->DisplayAddr[0]; if (disp_addr) { - mfc_debug(2, "NAL Q: decoding only but there is disp addr: 0x%llx\n", disp_addr); + mfc_debug(2, "NAL Q:[DPB] decoding only but there is disp addr: 0x%llx\n", disp_addr); dst_mb = s5p_mfc_get_move_buf_addr(&ctx->buf_queue_lock, &ctx->dst_buf_queue, &ctx->dst_buf_nal_queue, disp_addr); if (dst_mb) { - mfc_debug(2, "NAL Q: buf[%d] will reused. addr: 0x%08llx\n", + mfc_debug(2, "NAL Q:[DPB] buf[%d] will reused. addr: 0x%08llx\n", dst_mb->vb.vb2_buf.index, disp_addr); dst_mb->used = 0; clear_bit(dst_mb->vb.vb2_buf.index, &dec->available_dpb); @@ -1135,14 +1135,14 @@ static void mfc_nal_q_handle_ref_frame(struct s5p_mfc_ctx *ctx, DecoderOutputStr dec_addr = pOutStr->DecodedAddr[0]; disp_addr = pOutStr->DisplayAddr[0]; - mfc_debug(2, "NAL Q: dec addr: 0x%08llx, disp addr: 0x%08llx\n", + mfc_debug(2, "NAL Q:[DPB] dec addr: 0x%08llx, disp addr: 0x%08llx\n", dec_addr, disp_addr); dst_mb = s5p_mfc_find_move_buf_used(&ctx->buf_queue_lock, &ctx->ref_buf_queue, &ctx->dst_buf_nal_queue, dec_addr); if (dst_mb) { buf_addr = dst_mb->addr[0][0]; - mfc_debug(2, "NAL Q: Found in dst queue, " + mfc_debug(2, "NAL Q:[DPB] Found in dst queue, " "dec addr: 0x%08llx, buf addr: 0x%08llx, used: %d\n", dec_addr, buf_addr, dst_mb->used); @@ -1150,7 +1150,7 @@ static void mfc_nal_q_handle_ref_frame(struct s5p_mfc_ctx *ctx, DecoderOutputStr if (!((1 << index) & pOutStr->UsedDpbFlagLower)) dec->dynamic_used |= 1 << index; } else { - mfc_debug(2, "NAL Q: Can't find buffer for addr: 0x%08llx\n", dec_addr); + mfc_debug(2, "NAL Q:[DPB] Can't find buffer for addr: 0x%08llx\n", dec_addr); } mfc_debug_leave(); @@ -1200,21 +1200,20 @@ static void mfc_nal_q_handle_frame_output_move(struct s5p_mfc_ctx *ctx, dst_mb = s5p_mfc_find_move_buf(&ctx->buf_queue_lock, &ctx->dst_buf_queue, &ctx->ref_buf_queue, dspl_y_addr, released_flag); if (dst_mb) { - mfc_debug(2, "NAL Q: find display buf, index: %d\n", dst_mb->vb.vb2_buf.index); - /* Check if this is the buffer we're looking for */ - mfc_debug(2, "NAL Q: buf addr: 0x%08llx, disp addr: 0x%08llx\n", - dst_mb->addr[0][0], dspl_y_addr); - index = dst_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, dst_mb->addr[0][0], dspl_y_addr); + if (released_flag & (1 << index)) { dec->available_dpb &= ~(1 << index); released_flag &= ~(1 << index); - mfc_debug(2, "NAL Q: Corrupted frame(%d), it will be re-used(release)\n", + mfc_debug(2, "NAL Q:[DPB] Corrupted frame(%d), it will be re-used(release)\n", s5p_mfc_get_warn(s5p_mfc_get_int_err())); } else { dec->err_reuse_flag |= 1 << index; - mfc_debug(2, "NAL Q: Corrupted frame(%d), it will be re-used(not released)\n", + mfc_debug(2, "NAL Q:[DPB] Corrupted frame(%d), it will be re-used(not released)\n", s5p_mfc_get_warn(s5p_mfc_get_int_err())); } dec->dynamic_used |= released_flag; @@ -1262,13 +1261,12 @@ static void mfc_nal_q_handle_frame_output_del(struct s5p_mfc_ctx *ctx, ref_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock, &ctx->ref_buf_queue, dspl_y_addr); if (ref_mb) { - mfc_debug(2, "NAL Q: find display buf, index: %d\n", ref_mb->vb.vb2_buf.index); - /* Check if this is the buffer we're looking for */ - mfc_debug(2, "NAL Q: buf addr: 0x%08llx, disp addr: 0x%08llx\n", - ref_mb->addr[0][0], dspl_y_addr); - 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); + ref_mb->vb.sequence = ctx->sequence; /* Set reserved2 bits in order to inform SEI information */ @@ -1398,8 +1396,8 @@ static void mfc_nal_q_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err dec->dynamic_used = pOutStr->UsedDpbFlagLower; released_flag = prev_flag & (~dec->dynamic_used); - mfc_debug(2, "NAL Q: Used flag = %08x, Released Buffer = %08x\n", - dec->dynamic_used, released_flag); + mfc_debug(2, "NAL Q:[DPB] Used flag: old = %08x, new = %08x, Released buffer = %08x\n", + prev_flag, dec->dynamic_used, released_flag); if ((IS_VC1_RCV_DEC(ctx) && (disp_err == S5P_FIMV_ERR_SYNC_POINT_NOT_RECEIVED)) || @@ -1508,7 +1506,7 @@ void mfc_nal_q_handle_frame(struct s5p_mfc_ctx *ctx, DecoderOutputStr *pOutStr) mfc_debug(2, "NAL Q: Frame Status: %x\n", dst_frame_status); mfc_debug(4, "NAL Q:[HDR] SEI available status: %x\n", sei_avail_status); - mfc_debug(2, "NAL Q: Used flag: old = %08x, new = %08x\n", + mfc_debug(2, "NAL Q:[DPB] Used flag: old = %08x, new = %08x\n", dec->dynamic_used, pOutStr->UsedDpbFlagLower); if (ctx->state == MFCINST_RES_CHANGE_INIT) { @@ -1573,7 +1571,7 @@ void mfc_nal_q_handle_frame(struct s5p_mfc_ctx *ctx, DecoderOutputStr *pOutStr) if (dst_frame_status != S5P_FIMV_DEC_STATUS_DISPLAY_ONLY) mfc_nal_q_handle_frame_input(ctx, err, pOutStr); else - mfc_debug(2, "NAL Q: can't support display only in NAL-Q, is_dpb_full: %d\n", + mfc_debug(2, "NAL Q:[DPB] can't support display only in NAL-Q, is_dpb_full: %d\n", dec->is_dpb_full); leave_handle_frame: diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c b/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c index 9006a54b2129..f4cdc83c7b7f 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c @@ -131,7 +131,7 @@ int s5p_mfc_run_dec_frame(struct s5p_mfc_ctx *ctx) /* Try to use the non-referenced DPB on dst-queue */ dst_mb = s5p_mfc_search_for_dpb(ctx, dec->dynamic_used); if (!dst_mb) { - mfc_debug(2, "no dst buffers.\n"); + mfc_debug(2, "[DPB] couldn't find dst buffers\n"); return -EAGAIN; } @@ -202,7 +202,7 @@ int s5p_mfc_run_dec_last_frames(struct s5p_mfc_ctx *ctx) /* Try to use the non-referenced DPB on dst-queue */ dst_mb = s5p_mfc_search_for_dpb(ctx, dec->dynamic_used); if (!dst_mb) { - mfc_debug(2, "no dst buffers.\n"); + mfc_debug(2, "[DPB] couldn't find dst buffers\n"); return -EAGAIN; } diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c b/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c index 57740d049a8f..2df70eaf17bc 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c @@ -238,7 +238,7 @@ struct s5p_mfc_buf *s5p_mfc_get_move_buf_addr(spinlock_t *plock, spin_lock_irqsave(plock, flags); if (list_empty(&from_queue->head)) { - mfc_debug(2, "from_queue is empty\n"); + mfc_debug(2, "[DPB] from_queue is empty\n"); spin_unlock_irqrestore(plock, flags); return NULL; } @@ -246,8 +246,7 @@ struct s5p_mfc_buf *s5p_mfc_get_move_buf_addr(spinlock_t *plock, mfc_buf = list_entry(from_queue->head.next, struct s5p_mfc_buf, list); if (mfc_buf->addr[0][0] == addr) { - mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf); - mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0][0]); + mfc_debug(2, "[DPB] First plane address: 0x%08llx\n", mfc_buf->addr[0][0]); list_del(&mfc_buf->list); from_queue->count--; @@ -350,12 +349,12 @@ struct s5p_mfc_buf *s5p_mfc_find_del_buf(spinlock_t *plock, struct s5p_mfc_buf_q spin_lock_irqsave(plock, flags); - mfc_debug(2, "Looking for this address: 0x%08llx\n", addr); + mfc_debug(4, "Looking for this address: 0x%08llx\n", addr); list_for_each_entry(mfc_buf, &queue->head, list) { if (mfc_buf->num_bufs_in_vb > 0) { for (i = 0; i < mfc_buf->num_bufs_in_vb; i++) { mb_addr = mfc_buf->addr[i][0]; - mfc_debug(2, "batch buf[%d] plane[0] addr: 0x%08llx\n", i, mb_addr); + mfc_debug(4, "batch buf[%d] plane[0] addr: 0x%08llx\n", i, mb_addr); if (addr == mb_addr) { found = 1; @@ -367,7 +366,7 @@ struct s5p_mfc_buf *s5p_mfc_find_del_buf(spinlock_t *plock, struct s5p_mfc_buf_q break; } else { mb_addr = mfc_buf->addr[0][0]; - mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr); + mfc_debug(4, "plane[0] addr: 0x%08llx\n", mb_addr); if (addr == mb_addr) { found = 1; @@ -399,10 +398,10 @@ struct s5p_mfc_buf *s5p_mfc_find_move_buf(spinlock_t *plock, spin_lock_irqsave(plock, flags); - mfc_debug(2, "Looking for this address: 0x%08llx\n", addr); + mfc_debug(4, "[DPB] Looking for this address: 0x%08llx\n", addr); list_for_each_entry(mfc_buf, &from_queue->head, list) { mb_addr = mfc_buf->addr[0][0]; - mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr); + mfc_debug(4, "[DPB] plane[0] addr: 0x%08llx\n", mb_addr); if (addr == mb_addr) { found = 1; @@ -438,10 +437,10 @@ struct s5p_mfc_buf *s5p_mfc_find_move_buf_used(spinlock_t *plock, spin_lock_irqsave(plock, flags); - mfc_debug(2, "Looking for this address: 0x%08llx\n", addr); + mfc_debug(4, "[DPB] Looking for this address: 0x%08llx\n", addr); list_for_each_entry(mfc_buf, &from_queue->head, list) { mb_addr = mfc_buf->addr[0][0]; - mfc_debug(2, "plane[0] addr: 0x%08llx, used: %d\n", + mfc_debug(4, "[DPB] plane[0] addr: 0x%08llx, used: %d\n", mb_addr, mfc_buf->used); if ((addr == mb_addr) && (mfc_buf->used == 1)) { @@ -590,12 +589,12 @@ struct s5p_mfc_buf *mfc_find_buf_index(spinlock_t *plock, struct s5p_mfc_buf_que spin_lock_irqsave(plock, flags); - mfc_debug(2, "Looking for index: %d\n", index); + mfc_debug(4, "[DPB] Looking for index: %d\n", index); list_for_each_entry(mfc_buf, &queue->head, list) { buf_index = mfc_buf->vb.vb2_buf.index; if (index == buf_index) { - mfc_debug(2, "Found index: %d\n", buf_index); + mfc_debug(2, "[DPB] Found index: %d\n", buf_index); spin_unlock_irqrestore(plock, flags); return mfc_buf; } @@ -634,7 +633,7 @@ static void mfc_check_ref_frame(spinlock_t *plock, struct s5p_mfc_buf_queue *dst dec->assigned_fd[index] = ref_mb->vb.vb2_buf.planes[0].m.fd; clear_bit(index, &dec->available_dpb); - mfc_debug(2, "Move buffer[%d], fd[%d] to dst queue\n", + mfc_debug(2, "[DPB] Move buffer[%d], fd[%d] to dst queue\n", index, dec->assigned_fd[index]); found = 1; break; @@ -649,7 +648,7 @@ static void mfc_check_ref_frame(spinlock_t *plock, struct s5p_mfc_buf_queue *dst dec->assigned_fd[index] = ref_mb->vb.vb2_buf.planes[0].m.fd; clear_bit(index, &dec->available_dpb); - mfc_debug(2, "re-assigned buffer[%d], fd[%d]\n", + mfc_debug(2, "[DPB] re-assigned buffer[%d], fd[%d]\n", index, dec->assigned_fd[index]); break; } @@ -669,7 +668,7 @@ void s5p_mfc_handle_released_info(struct s5p_mfc_ctx *ctx, dec = ctx->dec_priv; if (!dec) { - mfc_err_dev("no decoder context to run\n"); + mfc_err_dev("[DPB] no decoder context to run\n"); return; } refBuf = &dec->ref_info[index]; @@ -677,7 +676,7 @@ void s5p_mfc_handle_released_info(struct s5p_mfc_ctx *ctx, if (dec->dec_only_release_flag) { for (t = 0; t < MFC_MAX_DPBS; t++) { if (dec->dec_only_release_flag & (1 << t)) { - mfc_debug(2, "Release FD[%d] = %03d (already released in dec only)\n", + mfc_debug(2, "[DPB] Release FD[%d] = %03d (already released in dec only)\n", t, dec->assigned_fd[t]); refBuf->dpb[ncount].fd[0] = dec->assigned_fd[t]; ncount++; @@ -691,17 +690,17 @@ void s5p_mfc_handle_released_info(struct s5p_mfc_ctx *ctx, if (released_flag & (1 << t)) { if (dec->err_reuse_flag & (1 << t)) { /* reuse buffer with error : do not update released info */ - mfc_debug(2, "Released, but reuse(error frame). FD[%d] = %03d\n", + mfc_debug(2, "[DPB] Released, but reuse(error frame). FD[%d] = %03d\n", t, dec->assigned_fd[t]); dec->err_reuse_flag &= ~(1 << t); } else if ((t != index) && mfc_find_buf_index(&ctx->buf_queue_lock, &ctx->ref_buf_queue, t)) { /* decoding only frame: do not update released info */ - mfc_debug(2, "Released, but reuse(decoding only). FD[%d] = %03d\n", + mfc_debug(2, "[DPB] Released, but reuse(decoding only). FD[%d] = %03d\n", t, dec->assigned_fd[t]); } else { /* displayed and released frame */ - mfc_debug(2, "Release FD[%d] = %03d\n", + mfc_debug(2, "[DPB] Release FD[%d] = %03d\n", t, dec->assigned_fd[t]); refBuf->dpb[ncount].fd[0] = dec->assigned_fd[t]; ncount++; @@ -743,7 +742,7 @@ struct s5p_mfc_buf *s5p_mfc_move_reuse_buffer(struct s5p_mfc_ctx *ctx, int relea dst_queue->count++; clear_bit(index, &dec->available_dpb); - mfc_debug(2, "buffer[%d] is moved to dst queue for reuse\n", index); + mfc_debug(2, "[DPB] buffer[%d] is moved to dst queue for reuse\n", index); spin_unlock_irqrestore(plock, flags); return ref_mb; @@ -836,7 +835,7 @@ struct s5p_mfc_buf *mfc_check_full_refered_dpb(struct s5p_mfc_ctx *ctx) dec = ctx->dec_priv; if (!dec) { - mfc_err_dev("no decoder context to run\n"); + mfc_err_dev("[DPB] no decoder context to run\n"); return NULL; } @@ -844,23 +843,23 @@ struct s5p_mfc_buf *mfc_check_full_refered_dpb(struct s5p_mfc_ctx *ctx) if ((ctx->dst_buf_queue.count > 1) && (sum_dpb >= (ctx->dpb_count + 5))) { if (list_empty(&ctx->dst_buf_queue.head)) { - mfc_err_ctx("dst_buf_queue is empty\n"); + mfc_err_ctx("[DPB] dst_buf_queue is empty\n"); return NULL; } - mfc_debug(2, "We should use this buffer.\n"); + mfc_debug(3, "[DPB] We should use this buffer.\n"); mfc_buf = list_entry(ctx->dst_buf_queue.head.next, struct s5p_mfc_buf, list); } else if ((ctx->dst_buf_queue.count == 0) && ((ctx->ref_buf_queue.count) == (ctx->dpb_count + 5))) { if (list_empty(&ctx->ref_buf_queue.head)) { - mfc_err_ctx("ref_buf_queue is empty\n"); + mfc_err_ctx("[DPB] ref_buf_queue is empty\n"); return NULL; } - mfc_debug(2, "All buffers are referenced.\n"); + mfc_debug(3, "[DPB] All buffers are referenced.\n"); mfc_buf = list_entry(ctx->ref_buf_queue.head.next, struct s5p_mfc_buf, list); } else { - mfc_debug(2, "waiting for dst buffer, ref = %d, dst = %d\n", + mfc_debug(3, "[DPB] waiting for dst buffer, ref = %d, dst = %d\n", ctx->ref_buf_queue.count, ctx->dst_buf_queue.count); ctx->clear_work_bit = 1; } @@ -879,7 +878,7 @@ struct s5p_mfc_buf *s5p_mfc_search_for_dpb(struct s5p_mfc_ctx *ctx, unsigned int spin_lock_irqsave(&ctx->buf_queue_lock, flags); - mfc_debug(2, "Try to find non-referenced DPB. dynamic_used: 0x%x\n", dynamic_used); + mfc_debug(2, "[DPB] Try to find non-referenced DPB. dynamic_used: 0x%x\n", dynamic_used); list_for_each_entry(mfc_buf, &ctx->dst_buf_queue.head, list) { if ((dynamic_used & (1 << mfc_buf->vb.vb2_buf.index)) == 0) { mfc_buf->used = 1; @@ -909,7 +908,7 @@ struct s5p_mfc_buf *s5p_mfc_search_move_dpb_nal_q(struct s5p_mfc_ctx *ctx, unsig spin_lock_irqsave(&ctx->buf_queue_lock, flags); - mfc_debug(2, "Try to find non-referenced DPB. dynamic_used: 0x%x\n", dynamic_used); + mfc_debug(2, "NAL Q:[DPB] Try to find non-referenced DPB. dynamic_used: 0x%x\n", dynamic_used); list_for_each_entry(mfc_buf, &ctx->dst_buf_queue.head, list) { if ((dynamic_used & (1 << mfc_buf->vb.vb2_buf.index)) == 0) { mfc_buf->used = 1; @@ -928,7 +927,7 @@ struct s5p_mfc_buf *s5p_mfc_search_move_dpb_nal_q(struct s5p_mfc_ctx *ctx, unsig mfc_buf = mfc_check_full_refered_dpb(ctx); if (mfc_buf) { - mfc_debug(2, "DPB is full. stop NAL-Q if started\n"); + mfc_debug(2, "NAL Q:[DPB] DPB is full. stop NAL-Q if started\n"); dec->is_dpb_full = 1; } @@ -946,13 +945,13 @@ void s5p_mfc_store_dpb(struct s5p_mfc_ctx *ctx, struct vb2_buffer *vb) int index; if (!ctx) { - mfc_err_dev("no mfc context to run\n"); + mfc_err_dev("[DPB] no mfc context to run\n"); return; } dec = ctx->dec_priv; if (!dec) { - mfc_err_dev("no mfc decoder to run\n"); + mfc_err_dev("[DPB] no mfc decoder to run\n"); return; } @@ -963,7 +962,7 @@ void s5p_mfc_store_dpb(struct s5p_mfc_ctx *ctx, struct vb2_buffer *vb) index = vb->index; dec->assigned_fd[index] = vb->planes[0].m.fd; - mfc_debug(2, "Assigned FD[%d] = %d (%s)\n", index, dec->assigned_fd[index], + mfc_debug(2, "[DPB] Assigned FD[%d] = %d (%s)\n", index, dec->assigned_fd[index], (dec->dynamic_used & (1 << index) ? "used" : "non-used")); list_add_tail(&mfc_buf->list, &ctx->dst_buf_queue.head); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c index 7a525e15d05d..a812e8382e80 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c @@ -455,8 +455,7 @@ int s5p_mfc_set_dynamic_dpb(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *dst_mb) dst_index = dst_mb->vb.vb2_buf.index; set_bit(dst_index, &dec->available_dpb); dec->dynamic_set = 1 << dst_index; - mfc_debug(2, "ADDING Flag after: 0x%lx\n", dec->available_dpb); - mfc_debug(2, "Dst addr [%d] = 0x%08llx\n", dst_index, dst_mb->addr[0][0]); + mfc_debug(2, "[DPB] ADDING Flag after: 0x%lx\n", dec->available_dpb); /* for debugging about black bar detection */ if (MFC_FEATURE_SUPPORT(dev, dev->pdata->black_bar) && dec->detect_black_bar) { @@ -483,6 +482,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_TRACE_CTX("Set dst[%d] fd: %d, %#llx / avail %#lx used %#x\n", -- 2.20.1