From 3b7180d5cc72f0d23cb76529b4a8baf64e8ce5a7 Mon Sep 17 00:00:00 2001 From: Ayoung Sim Date: Fri, 29 Jun 2018 14:42:44 +0900 Subject: [PATCH] [COMMON] media: mfc: DRV4.0: clean up the some debug log Change-Id: I82982e2dc7475c567bdb2dfec94df59817ff8b55 Signed-off-by: Ayoung Sim --- drivers/media/platform/exynos/mfc/mfc.c | 2 +- drivers/media/platform/exynos/mfc/mfc_cmd.c | 8 +++--- .../media/platform/exynos/mfc/mfc_dec_ctrl.c | 6 ++--- .../media/platform/exynos/mfc/mfc_dec_v4l2.c | 13 +++++----- .../media/platform/exynos/mfc/mfc_dec_vb2.c | 4 +++ .../media/platform/exynos/mfc/mfc_enc_ctrl.c | 8 +++--- .../media/platform/exynos/mfc/mfc_enc_v4l2.c | 25 +++++++++---------- drivers/media/platform/exynos/mfc/mfc_isr.c | 2 +- drivers/media/platform/exynos/mfc/mfc_mem.c | 3 +-- drivers/media/platform/exynos/mfc/mfc_nal_q.c | 4 +-- drivers/media/platform/exynos/mfc/mfc_qos.c | 5 +--- drivers/media/platform/exynos/mfc/mfc_queue.c | 2 +- drivers/media/platform/exynos/mfc/mfc_run.c | 6 ++--- drivers/media/platform/exynos/mfc/mfc_sync.c | 4 +-- 14 files changed, 45 insertions(+), 47 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/mfc.c b/drivers/media/platform/exynos/mfc/mfc.c index cc5c950b2a35..e2cc0913dbef 100644 --- a/drivers/media/platform/exynos/mfc/mfc.c +++ b/drivers/media/platform/exynos/mfc/mfc.c @@ -1015,7 +1015,7 @@ static void __mfc_parse_dt(struct device_node *np, struct mfc_dev *mfc) sizeof(struct mfc_qos_boost), GFP_KERNEL); np_qos = of_find_node_by_name(np, "mfc_perf_boost_table"); if (!np_qos) { - pr_err("%s:[QoS] could not find mfc_perf_boost_table node\n", node_name); + pr_err("%s:[QoS][BOOST] could not find mfc_perf_boost_table node\n", node_name); return; } of_property_read_u32(np_qos, "num_cluster", &pdata->qos_boost_table->num_cluster); diff --git a/drivers/media/platform/exynos/mfc/mfc_cmd.c b/drivers/media/platform/exynos/mfc/mfc_cmd.c index 1591c1cddf45..9f4076ebac54 100644 --- a/drivers/media/platform/exynos/mfc/mfc_cmd.c +++ b/drivers/media/platform/exynos/mfc/mfc_cmd.c @@ -87,11 +87,11 @@ int mfc_cmd_open_inst(struct mfc_ctx *ctx) if (ctx->otf_handle) { /* Set OTF_CONTROL[2:1], 0: Non-OTF, 1: OTF+HWFC, 2: OTF only */ reg |= (0x1 << 1); - mfc_info_ctx("HWFC + OTF enabled\n"); + mfc_info_ctx("[OTF] HWFC + OTF enabled\n"); if (otf_dump && !ctx->is_drm) { /* Set OTF_DEBUG[3] for OTF path dump */ reg |= (0x1 << 3); - mfc_info_ctx("Debugging mode enabled\n"); + mfc_info_ctx("[OTF] Debugging mode enabled\n"); } } MFC_WRITEL(reg, MFC_REG_CODEC_CONTROL); @@ -366,7 +366,7 @@ int mfc_cmd_init_decode(struct mfc_ctx *ctx) reg |= (0x1 << MFC_REG_D_SEI_ENABLE_RECOVERY_PARSING_SHIFT); MFC_WRITEL(reg, MFC_REG_D_SEI_ENABLE); - mfc_debug(2, "SEI enable was set, 0x%x\n", MFC_READL(MFC_REG_D_SEI_ENABLE)); + mfc_debug(2, "[HDR] SEI enable was set, 0x%x\n", MFC_READL(MFC_REG_D_SEI_ENABLE)); MFC_WRITEL(ctx->inst_no, MFC_REG_INSTANCE_ID); @@ -386,7 +386,7 @@ int mfc_cmd_dec_one_frame(struct mfc_ctx *ctx, int last_frame) struct mfc_dec *dec = ctx->dec_priv; u32 reg = 0; - mfc_debug(2, "Dynamic:0x%08x, Available:0x%lx\n", + mfc_debug(2, "[DPB] Dynamic:0x%08x, Available:0x%lx\n", dec->dynamic_set, dec->available_dpb); reg = MFC_READL(MFC_REG_D_NAL_START_OPTIONS); diff --git a/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c b/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c index 6cbedd71880b..958434cbb635 100644 --- a/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c +++ b/drivers/media/platform/exynos/mfc/mfc_dec_ctrl.c @@ -370,7 +370,7 @@ static int mfc_dec_init_ctx_ctrls(struct mfc_ctx *ctx) for (i = 0; i < NUM_CTRL_CFGS; i++) { ctx_ctrl = kzalloc(sizeof(struct mfc_ctx_ctrl), GFP_KERNEL); if (ctx_ctrl == NULL) { - mfc_err_dev("Failed to allocate context control "\ + mfc_err_dev("Failed to allocate context control " "id: 0x%08x, type: %d\n", mfc_ctrl_list[i].id, mfc_ctrl_list[i].type); @@ -465,7 +465,7 @@ static int mfc_dec_init_buf_ctrls(struct mfc_ctx *ctx, } if (i == NUM_CTRL_CFGS) { - mfc_err_dev("Failed to find buffer control "\ + mfc_err_dev("Failed to find buffer control " "id: 0x%08x, type: %d\n", ctx_ctrl->id, ctx_ctrl->type); continue; @@ -473,7 +473,7 @@ static int mfc_dec_init_buf_ctrls(struct mfc_ctx *ctx, buf_ctrl = kzalloc(sizeof(struct mfc_buf_ctrl), GFP_KERNEL); if (buf_ctrl == NULL) { - mfc_err_dev("Failed to allocate buffer control "\ + mfc_err_dev("Failed to allocate buffer control " "id: 0x%08x, type: %d\n", mfc_ctrl_list[i].id, mfc_ctrl_list[i].type); diff --git a/drivers/media/platform/exynos/mfc/mfc_dec_v4l2.c b/drivers/media/platform/exynos/mfc/mfc_dec_v4l2.c index 1e3c13b73088..06053d72dd33 100644 --- a/drivers/media/platform/exynos/mfc/mfc_dec_v4l2.c +++ b/drivers/media/platform/exynos/mfc/mfc_dec_v4l2.c @@ -1008,8 +1008,8 @@ static int __mfc_dec_get_ctrl_val(struct mfc_ctx *ctx, struct v4l2_control *ctrl ctx_ctrl->has_new = 0; ctrl->value = ctx_ctrl->val; } else { - mfc_debug(5, "[CTRLS] Control value "\ - "is not up to date: "\ + mfc_debug(5, "[CTRLS] Control value " + "is not up to date: " "0x%08x\n", ctrl->id); return -EINVAL; } @@ -1110,7 +1110,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("[DPB] 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; @@ -1126,9 +1126,8 @@ static int vidioc_s_ctrl(struct file *file, void *priv, dec->sh_handle.fd = ctrl->value; if (mfc_mem_get_user_shared_handle(ctx, &dec->sh_handle)) return -EINVAL; - else - mfc_debug(2, "[MEMINFO][DPB] shared handle fd: %d, vaddr: 0x%p\n", - dec->sh_handle.fd, dec->sh_handle.vaddr); + mfc_debug(2, "[MEMINFO][DPB] shared handle fd: %d, vaddr: 0x%p\n", + dec->sh_handle.fd, dec->sh_handle.vaddr); } break; case V4L2_CID_MPEG_MFC_SET_BUF_PROCESS_TYPE: @@ -1196,7 +1195,7 @@ static int vidioc_g_crop(struct file *file, void *priv, cr->c.top = dec->cr_top; cr->c.width = ctx->img_width - dec->cr_left - dec->cr_right; cr->c.height = ctx->img_height - dec->cr_top - dec->cr_bot; - mfc_debug(2, "[FRAME] Cropping info: l=%d t=%d " \ + mfc_debug(2, "[FRAME] Cropping info: l=%d t=%d " "w=%d h=%d (r=%d b=%d fw=%d fh=%d)\n", dec->cr_left, dec->cr_top, cr->c.width, cr->c.height, diff --git a/drivers/media/platform/exynos/mfc/mfc_dec_vb2.c b/drivers/media/platform/exynos/mfc/mfc_dec_vb2.c index 9d5850ba6c27..4478ceb2f4f4 100644 --- a/drivers/media/platform/exynos/mfc/mfc_dec_vb2.c +++ b/drivers/media/platform/exynos/mfc/mfc_dec_vb2.c @@ -591,6 +591,10 @@ static void mfc_dec_buf_queue(struct vb2_buffer *vb) mfc_add_tail_buf(&ctx->buf_queue_lock, &ctx->src_buf_queue, buf); + if (debug_ts == 1) + mfc_info_ctx("[TS] framerate: %ld, timestamp: %lld\n", + ctx->framerate, buf->vb.vb2_buf.timestamp); + MFC_TRACE_CTX("Q src[%d] fd: %d, %#llx\n", vb->index, vb->planes[0].m.fd, buf->addr[0][0]); } else if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { diff --git a/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c b/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c index eb6269a046ec..eb83d5f10e89 100644 --- a/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c +++ b/drivers/media/platform/exynos/mfc/mfc_enc_ctrl.c @@ -707,7 +707,7 @@ static int mfc_enc_init_ctx_ctrls(struct mfc_ctx *ctx) for (i = 0; i < NUM_CTRL_CFGS; i++) { ctx_ctrl = kzalloc(sizeof(struct mfc_ctx_ctrl), GFP_KERNEL); if (ctx_ctrl == NULL) { - mfc_err_dev("Failed to allocate context control "\ + mfc_err_dev("Failed to allocate context control " "id: 0x%08x, type: %d\n", mfc_ctrl_list[i].id, mfc_ctrl_list[i].type); @@ -795,7 +795,7 @@ static int mfc_enc_init_buf_ctrls(struct mfc_ctx *ctx, buf_ctrl = kzalloc(sizeof(struct mfc_buf_ctrl), GFP_KERNEL); if (buf_ctrl == NULL) { - mfc_err_dev("Failed to allocate buffer control "\ + mfc_err_dev("Failed to allocate buffer control " "id: 0x%08x, type: %d\n", mfc_ctrl_list[i].id, mfc_ctrl_list[i].type); @@ -898,7 +898,7 @@ static int mfc_enc_to_buf_ctrls(struct mfc_ctx *ctx, struct list_head *head) reg |= (enc->roi_info[index].lower_qp << 8); reg &= ~(0xFFFF << 16); reg |= (enc->roi_info[index].upper_qp << 16); - mfc_debug(3, "[ROI] buffer[%d] en %d, "\ + mfc_debug(3, "[ROI] buffer[%d] en %d, " "QP lower %d upper %d reg %#x\n", index, enc->roi_info[index].enable, enc->roi_info[index].lower_qp, @@ -934,7 +934,7 @@ static int mfc_enc_to_ctx_ctrls(struct mfc_ctx *ctx, struct list_head *head) if (ctx_ctrl->id == buf_ctrl->id) { if (ctx_ctrl->has_new) mfc_debug(8, - "Overwrite context control "\ + "Overwrite context control " "value id: 0x%08x, val: %d\n", ctx_ctrl->id, ctx_ctrl->val); diff --git a/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c b/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c index aff1dc8b3abf..09eb5b74cfe0 100644 --- a/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c +++ b/drivers/media/platform/exynos/mfc/mfc_enc_v4l2.c @@ -931,8 +931,8 @@ static int __mfc_enc_get_ctrl_val(struct mfc_ctx *ctx, struct v4l2_control *ctrl ctx_ctrl->has_new = 0; ctrl->value = ctx_ctrl->val; } else { - mfc_debug(5, "[CTRLS] Control value "\ - "is not up to date: "\ + mfc_debug(5, "[CTRLS] Control value " + "is not up to date: " "0x%08x\n", ctrl->id); return -EINVAL; } @@ -1841,23 +1841,23 @@ static int __mfc_enc_set_ctrl_val(struct mfc_ctx *ctx, struct v4l2_control *ctrl ctx_ctrl->val &= ~(0xFFFF); ctx_ctrl->val |= p->rc_frame_delta & 0xFFFF; } - if (((ctx_ctrl->id == \ + if ((ctx_ctrl->id == \ V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_CH) || (ctx_ctrl->id == \ V4L2_CID_MPEG_VIDEO_VP8_HIERARCHICAL_CODING_LAYER_CH) || (ctx_ctrl->id == \ V4L2_CID_MPEG_VIDEO_VP9_HIERARCHICAL_CODING_LAYER_CH) || (ctx_ctrl->id == \ - V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_CH)) && - (enc->sh_handle_svc.fd == -1)) { + V4L2_CID_MPEG_VIDEO_HEVC_HIERARCHICAL_CODING_LAYER_CH)) { + if (enc->sh_handle_svc.fd == -1) { enc->sh_handle_svc.fd = ctrl->value; if (mfc_mem_get_user_shared_handle(ctx, &enc->sh_handle_svc)) return -EINVAL; - else - mfc_debug(2, "[MEMINFO][HIERARCHICAL] shared handle fd: %d, vaddr: 0x%p\n", - enc->sh_handle_svc.fd, - enc->sh_handle_svc.vaddr); + mfc_debug(2, "[MEMINFO][HIERARCHICAL] shared handle fd: %d, vaddr: 0x%p\n", + enc->sh_handle_svc.fd, + enc->sh_handle_svc.vaddr); + } } if (ctx_ctrl->id == V4L2_CID_MPEG_MFC51_VIDEO_I_PERIOD_CH && p->i_frm_ctrl_mode) { @@ -1878,10 +1878,9 @@ static int __mfc_enc_set_ctrl_val(struct mfc_ctx *ctx, struct v4l2_control *ctrl if (mfc_mem_get_user_shared_handle(ctx, &enc->sh_handle_roi)) return -EINVAL; - else - mfc_debug(2, "[MEMINFO][ROI] shared handle fd: %d, vaddr: 0x%p\n", - enc->sh_handle_roi.fd, - enc->sh_handle_roi.vaddr); + mfc_debug(2, "[MEMINFO][ROI] shared handle fd: %d, vaddr: 0x%p\n", + enc->sh_handle_roi.fd, + enc->sh_handle_roi.vaddr); } index = enc->roi_index; memcpy(&enc->roi_info[index], diff --git a/drivers/media/platform/exynos/mfc/mfc_isr.c b/drivers/media/platform/exynos/mfc/mfc_isr.c index cbd1cc1d14ee..53c4059a5d8c 100644 --- a/drivers/media/platform/exynos/mfc/mfc_isr.c +++ b/drivers/media/platform/exynos/mfc/mfc_isr.c @@ -631,7 +631,7 @@ static void __mfc_handle_frame(struct mfc_ctx *ctx, mfc_debug(2, "[DRC] Resolution change set to %d\n", res_change); mfc_change_state(ctx, MFCINST_RES_CHANGE_INIT); ctx->wait_state = WAIT_DECODING; - mfc_debug(7, "[DRC] Decoding waiting! : %d\n", ctx->wait_state); + mfc_debug(2, "[DRC] Decoding waiting! : %d\n", ctx->wait_state); return; } diff --git a/drivers/media/platform/exynos/mfc/mfc_mem.c b/drivers/media/platform/exynos/mfc/mfc_mem.c index c88efba09c5e..a090ccfeda18 100644 --- a/drivers/media/platform/exynos/mfc/mfc_mem.c +++ b/drivers/media/platform/exynos/mfc/mfc_mem.c @@ -223,9 +223,8 @@ int mfc_bufcon_get_daddr(struct mfc_ctx *ctx, struct mfc_buf *mfc_buf, if (dmabuf_container_get_mask(bufcon_dmabuf, &mask)) { mfc_err_ctx("[BUFCON] it is not buffer container\n"); return -1; - } else { - mfc_debug(3, "[BUFCON] bufcon mask info %#x\n", mask); } + mfc_debug(3, "[BUFCON] bufcon mask info %#x\n", mask); for (i = 0; i < mfc_buf->num_bufs_in_batch; i++) { if ((mask & (1 << i)) == 0) { diff --git a/drivers/media/platform/exynos/mfc/mfc_nal_q.c b/drivers/media/platform/exynos/mfc/mfc_nal_q.c index ac533e3fdc2f..411f206ee72d 100644 --- a/drivers/media/platform/exynos/mfc/mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/mfc_nal_q.c @@ -1175,7 +1175,7 @@ static void __mfc_nal_q_handle_frame_copy_timestamp(struct mfc_ctx *ctx, Decoder mfc_debug_enter(); if (!ctx) { - mfc_err_dev("[TS] no mfc context to run\n"); + mfc_err_dev("[NALQ][TS] no mfc context to run\n"); return; } @@ -1187,7 +1187,7 @@ static void __mfc_nal_q_handle_frame_copy_timestamp(struct mfc_ctx *ctx, Decoder /* Get the next source buffer */ src_mb = mfc_get_buf(&ctx->buf_queue_lock, &ctx->src_buf_nal_queue, MFC_BUF_NO_TOUCH_USED); if (!src_mb) { - mfc_err_dev("[NALQ] no src buffers\n"); + mfc_err_dev("[NALQ][TS] no src buffers\n"); return; } diff --git a/drivers/media/platform/exynos/mfc/mfc_qos.c b/drivers/media/platform/exynos/mfc/mfc_qos.c index 738cf783305e..de820efa6a13 100644 --- a/drivers/media/platform/exynos/mfc/mfc_qos.c +++ b/drivers/media/platform/exynos/mfc/mfc_qos.c @@ -741,7 +741,7 @@ static unsigned long __mfc_qos_get_fps_by_timestamp(struct mfc_ctx *ctx, struct if (debug_ts == 1) { /* Debug info */ mfc_info_ctx("===================[TS]===================\n"); - mfc_info_ctx("[TS] New timestamp = %ld.%06ld, count = %d \n", + mfc_info_ctx("[TS] New timestamp = %ld.%06ld, count = %d\n", time->tv_sec, time->tv_usec, ctx->ts_count); } @@ -794,9 +794,6 @@ static unsigned long __mfc_qos_get_fps_by_timestamp(struct mfc_ctx *ctx, struct } mfc_info_ctx("[TS] Min interval = %d, It is %ld fps\n", min_interval, max_framerate); - } else if (debug_ts == 2) { - mfc_info_ctx("[TS] Min interval = %d, It is %ld fps\n", - min_interval, max_framerate); } if (!ctx->ts_is_full) { diff --git a/drivers/media/platform/exynos/mfc/mfc_queue.c b/drivers/media/platform/exynos/mfc/mfc_queue.c index a6419de56d44..a28a1069496b 100644 --- a/drivers/media/platform/exynos/mfc/mfc_queue.c +++ b/drivers/media/platform/exynos/mfc/mfc_queue.c @@ -1049,7 +1049,7 @@ int mfc_is_last_frame(struct mfc_ctx *ctx) src_mb = list_entry(ctx->src_buf_queue.head.next, struct mfc_buf, list); - mfc_debug(4, "addr[0]: 0x%08llx\n", src_mb->addr[0][0]); + mfc_debug(2, "[BUFINFO] addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]); if (src_mb->vb.reserved2 & FLAG_LAST_FRAME) { mfc_debug(2, "last frame!\n"); diff --git a/drivers/media/platform/exynos/mfc/mfc_run.c b/drivers/media/platform/exynos/mfc/mfc_run.c index ffc17c1ef524..d27743d2249a 100644 --- a/drivers/media/platform/exynos/mfc/mfc_run.c +++ b/drivers/media/platform/exynos/mfc/mfc_run.c @@ -330,7 +330,7 @@ int mfc_run_dec_init(struct mfc_ctx *ctx) } mfc_debug(2, "Preparing to init decoding\n"); - mfc_debug(2, "Header size: %d, (offset: %lu)\n", + mfc_debug(2, "[STREAM] Header size: %d, (offset: %lu)\n", src_mb->vb.vb2_buf.planes[0].bytesused, dec->consumed); if (dec->consumed) { @@ -347,7 +347,7 @@ int mfc_run_dec_init(struct mfc_ctx *ctx) 0, src_mb->vb.vb2_buf.planes[0].bytesused); } - mfc_debug(2, "Header addr: 0x%08llx\n", src_mb->addr[0][0]); + mfc_debug(2, "[BUFINFO] Header addr: 0x%08llx\n", src_mb->addr[0][0]); mfc_clean_ctx_int_flags(ctx); mfc_cmd_init_decode(ctx); @@ -492,7 +492,7 @@ int mfc_run_enc_init(struct mfc_ctx *ctx) mfc_set_enc_stride(ctx); - mfc_debug(2, "Header addr: 0x%08llx\n", dst_mb->addr[0][0]); + mfc_debug(2, "[BUFINFO] Header addr: 0x%08llx\n", dst_mb->addr[0][0]); mfc_clean_ctx_int_flags(ctx); ret = mfc_cmd_init_encode(ctx); diff --git a/drivers/media/platform/exynos/mfc/mfc_sync.c b/drivers/media/platform/exynos/mfc/mfc_sync.c index b3a85415e45f..c2a4c6a93e08 100644 --- a/drivers/media/platform/exynos/mfc/mfc_sync.c +++ b/drivers/media/platform/exynos/mfc/mfc_sync.c @@ -62,7 +62,7 @@ int mfc_wait_for_done_dev(struct mfc_dev *dev, int command) wait_condition(dev, command), msecs_to_jiffies(MFC_INT_TIMEOUT * MFC_INT_TIMEOUT_CNT)); if (ret == 0) { - mfc_err_dev("Timeout: MFC driver waited for upward of %dsec\n", + mfc_err_dev("Timeout: MFC driver waited for upward of %dmsec\n", 3 * MFC_INT_TIMEOUT); } else { goto wait_done; @@ -104,7 +104,7 @@ int mfc_wait_for_done_ctx(struct mfc_ctx *ctx, int command) wait_condition(ctx, command), msecs_to_jiffies(MFC_INT_TIMEOUT * MFC_INT_TIMEOUT_CNT)); if (ret == 0) { - mfc_err_dev("Timeout: MFC driver waited for upward of %dsec\n", + mfc_err_dev("Timeout: MFC driver waited for upward of %dmsec\n", 3 * MFC_INT_TIMEOUT); } else { goto wait_done; -- 2.20.1