From 2e8b3b7d5276500cc0c77dfb30140998c60157f5 Mon Sep 17 00:00:00 2001 From: Ayoung Sim Date: Wed, 20 Jun 2018 13:21:40 +0900 Subject: [PATCH] [COMMON] media: mfc: DRV4.0: update prefix [STREAM] Change-Id: I7fd785f5fc4f8485ea3c6ff202e39ef3bd5c3e3b Signed-off-by: Ayoung Sim --- .../media/platform/exynos/mfc/s5p_mfc_dec.c | 4 ++-- .../platform/exynos/mfc/s5p_mfc_dec_vb2_ops.c | 12 ++++++---- .../media/platform/exynos/mfc/s5p_mfc_enc.c | 4 ++-- .../platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c | 12 ++++++---- .../media/platform/exynos/mfc/s5p_mfc_irq.c | 24 +++++++++---------- .../media/platform/exynos/mfc/s5p_mfc_nal_q.c | 7 +++--- .../media/platform/exynos/mfc/s5p_mfc_otf.c | 12 ++++++---- .../media/platform/exynos/mfc/s5p_mfc_reg.c | 2 +- 8 files changed, 41 insertions(+), 36 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c index ba9b7dad0879..80f5adb63c0c 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c @@ -474,7 +474,7 @@ static int vidioc_s_fmt_vid_out_mplane(struct file *file, void *priv, } ctx->codec_mode = ctx->src_fmt->codec_mode; - mfc_info_ctx("Dec input codec(%d): %s\n", + mfc_info_ctx("[STREAM] Dec src codec(%d): %s\n", ctx->codec_mode, ctx->src_fmt->name); ctx->pix_format = pix_fmt_mp->pixelformat; @@ -489,7 +489,7 @@ static int vidioc_s_fmt_vid_out_mplane(struct file *file, void *priv, dec->src_buf_size = pix_fmt_mp->plane_fmt[0].sizeimage; else dec->src_buf_size = MAX_FRAME_SIZE; - mfc_debug(2, "sizeimage: %d\n", pix_fmt_mp->plane_fmt[0].sizeimage); + mfc_debug(2, "[STREAM] sizeimage: %d\n", pix_fmt_mp->plane_fmt[0].sizeimage); pix_fmt_mp->plane_fmt[0].bytesperline = 0; MFC_TRACE_CTX_HWLOCK("**DEC s_fmt\n"); 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 aa6cb1b046bc..7f6cbed1912d 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 @@ -267,11 +267,13 @@ static int s5p_mfc_dec_buf_prepare(struct vb2_buffer *vb) } } } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { - mfc_debug(2, "Plane size: %lu, dec->src_buf_size: %u\n", - vb2_plane_size(vb, 0), dec->src_buf_size); + buf_size = vb2_plane_size(vb, 0); + mfc_debug(2, "[STREAM] vb size: %lu, calc size: %d\n", + buf_size, dec->src_buf_size); - if (vb2_plane_size(vb, 0) < dec->src_buf_size) { - mfc_err_ctx("Plane buffer (OUTPUT) is too small.\n"); + if (buf_size < dec->src_buf_size) { + mfc_err_ctx("[STREAM] size(%d) is smaller than (%d)\n", + buf_size, dec->src_buf_size); return -EINVAL; } @@ -579,7 +581,7 @@ static void s5p_mfc_dec_buf_queue(struct vb2_buffer *vb) } if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { - mfc_debug(2, "Adding to src index[%d] 0x%08llx\n", + mfc_debug(2, "[STREAM] Adding to src index[%d] 0x%08llx\n", vb->index, buf->addr[0][0]); if (dec->dst_memtype == V4L2_MEMORY_DMABUF && ctx->state < MFCINST_HEAD_PARSED && !ctx->is_drm) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c b/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c index 6fd9a2446e48..c85f80e882ed 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c @@ -309,8 +309,8 @@ static int vidioc_s_fmt_vid_cap_mplane(struct file *file, void *priv, } ctx->codec_mode = ctx->dst_fmt->codec_mode; - mfc_info_ctx("Enc output codec(%d) : %s\n", - ctx->dst_fmt->codec_mode, ctx->dst_fmt->name); + mfc_info_ctx("[STREAM] Enc dst codec(%d) : %s\n", + ctx->codec_mode, ctx->dst_fmt->name); if (ctx->otf_handle) { if (ctx->dst_fmt->fourcc != V4L2_PIX_FMT_H264 && 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 913aec68aec5..77df3f8884ea 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 @@ -170,11 +170,13 @@ static int s5p_mfc_enc_buf_prepare(struct vb2_buffer *vb) mfc_debug_enter(); if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { - mfc_debug(2, "plane size: %lu, dst size: %u\n", - vb2_plane_size(vb, 0), enc->dst_buf_size); + buf_size = vb2_plane_size(vb, 0); + mfc_debug(2, "[STREAM] vb size: %lu, calc size: %u\n", + buf_size, enc->dst_buf_size); - if (vb2_plane_size(vb, 0) < enc->dst_buf_size) { - mfc_err_ctx("plane size is too small for capture\n"); + if (buf_size < enc->dst_buf_size) { + mfc_err_ctx("[STREAM] size(%d) is smaller than (%d)\n", + buf_size, enc->dst_buf_size); return -EINVAL; } @@ -437,7 +439,7 @@ 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, "Adding to dst index[%d] 0x%08llx\n", + mfc_debug(2, "[STREAM] Adding to dst index[%d] 0x%08llx\n", vb->index, buf->addr[0][0]); /* Mark destination as available for use by MFC */ diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index 52de8281a0a7..e7a5c636a9d0 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -894,7 +894,7 @@ static void mfc_handle_stream_output(struct s5p_mfc_ctx *ctx, int slice_type, dst_mb->vb.flags |= V4L2_BUF_FLAG_KEYFRAME; break; } - mfc_debug(2, "Slice type flag: %d\n", dst_mb->vb.flags); + mfc_debug(2, "[STREAM] Slice type flag: %d\n", dst_mb->vb.flags); if (IS_BPG_ENC(ctx)) { strm_size += enc->header_size; @@ -926,9 +926,8 @@ static int mfc_handle_stream(struct s5p_mfc_ctx *ctx) strm_size = s5p_mfc_get_enc_strm_size(); pic_count = s5p_mfc_get_enc_pic_count(); - mfc_debug(2, "encoded slice type: %d\n", slice_type); - mfc_debug(2, "encoded stream size: %d\n", strm_size); - mfc_debug(2, "display order: %d\n", pic_count); + mfc_debug(2, "[STREAM] encoded slice type: %d, size: %d, display order: %d\n", + slice_type, strm_size, pic_count); /* buffer full handling */ if (enc->buf_full) { @@ -1053,7 +1052,7 @@ static int mfc_handle_seq_dec(struct s5p_mfc_ctx *ctx) ctx->img_height = s5p_mfc_get_img_height(); ctx->crop_width = ctx->img_width; ctx->crop_height = ctx->img_height; - mfc_info_ctx("width: %d, height: %d\n", ctx->img_width, ctx->img_height); + mfc_info_ctx("[STREAM] resolution w: %d, h: %d\n", ctx->img_width, ctx->img_height); } ctx->dpb_count = s5p_mfc_get_dpb_count(); @@ -1068,7 +1067,7 @@ static int mfc_handle_seq_dec(struct s5p_mfc_ctx *ctx) s5p_mfc_get_chroma_bit_depth_minus8() || s5p_mfc_get_profile() == S5P_FIMV_D_PROFILE_HEVC_MAIN_10) { ctx->is_10bit = 1; - mfc_info_ctx("[10BIT] 10bit contents, profile: %d, depth: %d/%d\n", + mfc_info_ctx("[STREAM][10BIT] 10bit contents, profile: %d, depth: %d/%d\n", s5p_mfc_get_profile(), s5p_mfc_get_luma_bit_depth_minus8() + 8, s5p_mfc_get_chroma_bit_depth_minus8() + 8); @@ -1077,7 +1076,7 @@ static int mfc_handle_seq_dec(struct s5p_mfc_ctx *ctx) if (CODEC_422FORMAT(ctx) && dev->pdata->support_422) { if (s5p_mfc_get_chroma_format() == S5P_FIMV_D_CHROMA_422) { ctx->is_422 = 1; - mfc_info_ctx("422 chroma format\n"); + mfc_info_ctx("[STREAM] 422 chroma format\n"); } } @@ -1098,15 +1097,14 @@ static int mfc_handle_seq_dec(struct s5p_mfc_ctx *ctx) struct s5p_mfc_buf *src_mb = s5p_mfc_get_buf(&ctx->buf_queue_lock, &ctx->src_buf_queue, MFC_BUF_NO_TOUCH_USED); if (src_mb) { dec->consumed += s5p_mfc_get_consumed_stream(); - mfc_debug(2, "Check consumed size of header. "); - mfc_debug(2, "total size : %d, consumed : %lu\n", + mfc_debug(2, "[STREAM] header total size : %d, consumed : %lu\n", src_mb->vb.vb2_buf.planes[0].bytesused, dec->consumed); if ((dec->consumed > 0) && (src_mb->vb.vb2_buf.planes[0].bytesused > dec->consumed)) { dec->remained_size = src_mb->vb.vb2_buf.planes[0].bytesused - dec->consumed; - mfc_debug(2, "there is remained bytes after header parsing\n"); - mfc_debug(2, "remained_size: %lu\n", dec->remained_size); + mfc_debug(2, "[STREAM] there is remained bytes(%lu) after header parsing\n", + dec->remained_size); } else { dec->consumed = 0; dec->remained_size = 0; @@ -1134,7 +1132,9 @@ static int mfc_handle_seq_enc(struct s5p_mfc_ctx *ctx) int ret; enc->header_size = s5p_mfc_get_enc_strm_size(); - mfc_debug(2, "seq header size: %d\n", enc->header_size); + mfc_debug(2, "[STREAM] encoded slice type: %d, header size: %d, display order: %d\n", + s5p_mfc_get_enc_slice_type(), enc->header_size, + s5p_mfc_get_enc_pic_count()); if (IS_BPG_ENC(ctx)) { dst_mb = s5p_mfc_get_buf(&ctx->buf_queue_lock, &ctx->dst_buf_queue, MFC_BUF_NO_TOUCH_USED); 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 995ee1847a37..6282dc7adb91 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -1033,7 +1033,7 @@ static void mfc_nal_q_handle_stream_output(struct s5p_mfc_ctx *ctx, int slice_ty dst_mb->vb.flags |= V4L2_BUF_FLAG_KEYFRAME; break; } - mfc_debug(2, "NAL Q: Slice type flag: %d\n", dst_mb->vb.flags); + mfc_debug(2, "NAL Q:[STREAM] Slice type flag: %d\n", dst_mb->vb.flags); vb2_set_plane_payload(&dst_mb->vb.vb2_buf, 0, strm_size); @@ -1058,9 +1058,8 @@ static void mfc_nal_q_handle_stream(struct s5p_mfc_ctx *ctx, EncoderOutputStr *p strm_size = pOutStr->StreamSize; pic_count = pOutStr->EncCnt; - mfc_debug(2, "NAL Q: encoded slice type: %d\n", slice_type); - mfc_debug(2, "NAL Q: encoded stream size: %d\n", strm_size); - mfc_debug(2, "NAL Q: display order: %d\n", pic_count); + mfc_debug(2, "NAL Q:[STREAM] encoded slice type: %d, size: %d, display order: %d\n", + slice_type, strm_size, pic_count); /* buffer full handling */ if (ctx->state == MFCINST_RUNNING_BUF_FULL) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c index e7f1f03c7da4..57af2d1e3c46 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c @@ -473,8 +473,11 @@ int s5p_mfc_otf_handle_seq(struct s5p_mfc_ctx *ctx) enc->header_size = s5p_mfc_get_enc_strm_size(); ctx->dpb_count = s5p_mfc_get_enc_dpb_count(); ctx->scratch_buf_size = s5p_mfc_get_enc_scratch_size(); - mfc_debug(2, "OTF: header size: %d, cpb_count: %d, scratch size: %zu\n", - enc->header_size, ctx->dpb_count, ctx->scratch_buf_size); + mfc_debug(2, "OTF:[STREAM] encoded slice type: %d, header size: %d, display order: %d\n", + s5p_mfc_get_enc_slice_type(), enc->header_size, + s5p_mfc_get_enc_pic_count()); + mfc_debug(2, "OTF: cpb_count: %d, scratch size: %zu\n", + ctx->dpb_count, ctx->scratch_buf_size); s5p_mfc_change_state(ctx, MFCINST_HEAD_PARSED); @@ -514,9 +517,8 @@ int s5p_mfc_otf_handle_stream(struct s5p_mfc_ctx *ctx) pic_count = s5p_mfc_get_enc_pic_count(); strm_size = s5p_mfc_get_enc_strm_size(); - mfc_debug(2, "OTF: encoded slice type: %d\n", slice_type); - mfc_debug(2, "OTF: encoded stream size: %d\n", strm_size); - mfc_debug(2, "OTF: display order: %d\n", pic_count); + mfc_debug(2, "OTF:[STREAM] encoded slice type: %d, size: %d, display order: %d\n", + slice_type, strm_size, pic_count); /* set encoded frame type */ enc->frame_type = slice_type; diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c index 94cb2fe5b86f..acb3a8e21cf1 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c @@ -65,7 +65,7 @@ void s5p_mfc_otf_set_stream_size(struct s5p_mfc_ctx *ctx, unsigned int size) if (otf_dump && !ctx->is_drm) { buf = &debug->stream_buf[debug->frame_cnt]; mfc_debug(2, "OTF: set stream addr for debugging\n"); - mfc_debug(2, "OTF: buf[%d] daddr: 0x%08llx\n", + mfc_debug(2, "OTF:[STREAM] buf[%d] daddr: 0x%08llx\n", debug->frame_cnt, buf->daddr); MFC_WRITEL(buf->daddr, S5P_FIMV_E_STREAM_BUFFER_ADDR); } -- 2.20.1