From: Ayoung Sim Date: Wed, 20 Jun 2018 00:24:16 +0000 (+0900) Subject: [COMMON] media: mfc: DRV4.0: update prefix [FRAME] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8c46a88af37b8039eafb9bf89ffbdb08eaba0bfd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] media: mfc: DRV4.0: update prefix [FRAME] Change-Id: I25ca69ac74814219bde3294583f4eb792daa6ff9 Signed-off-by: Ayoung Sim --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_cmd.c b/drivers/media/platform/exynos/mfc/s5p_mfc_cmd.c index d8cc47840c85..1c49db999f78 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_cmd.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_cmd.c @@ -202,7 +202,7 @@ int s5p_mfc_cmd_dec_init_buffers(struct s5p_mfc_ctx *ctx) reg &= ~(0xF); reg |= pix_val & 0xF; MFC_WRITEL(reg, S5P_FIMV_PIXEL_FORMAT); - mfc_debug(2, "pixel format: %d, mem_type_10bit should be fixed on SEQ_START(reg: %#x)\n", + mfc_debug(2, "[FRAME] pixel format: %d, mem_type_10bit should be fixed on SEQ_START(reg: %#x)\n", pix_val, reg); s5p_mfc_clean_ctx_int_flags(ctx); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c index 15d30cc2386e..ba9b7dad0879 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_dec.c @@ -42,11 +42,11 @@ static struct s5p_mfc_fmt *mfc_dec_find_format(struct s5p_mfc_ctx *ctx, } if (!dev->pdata->support_10bit && (fmt->type & MFC_FMT_10BIT)) { - mfc_err_ctx("10bit is not supported\n"); + mfc_err_ctx("[FRAME] 10bit is not supported\n"); fmt = NULL; } if (!dev->pdata->support_422 && (fmt->type & MFC_FMT_422)) { - mfc_err_ctx("422 is not supported\n"); + mfc_err_ctx("[FRAME] 422 is not supported\n"); fmt = NULL; } @@ -262,7 +262,7 @@ static void mfc_dec_change_format(struct s5p_mfc_ctx *ctx) } if (org_fmt != ctx->dst_fmt->fourcc) - mfc_info_ctx("format is changed to %s\n", ctx->dst_fmt->name); + mfc_info_ctx("[FRAME] format is changed to %s\n", ctx->dst_fmt->name); } /* Get format */ @@ -275,13 +275,15 @@ static int vidioc_g_fmt_vid_cap_mplane(struct file *file, void *priv, struct s5p_mfc_raw_info *raw; int i; + mfc_debug_enter(); + dec = ctx->dec_priv; if (!dec) { mfc_err_dev("no mfc decoder to run\n"); return -EINVAL; } - mfc_debug_enter(); - mfc_debug(2, "f->type = %d ctx->state = %d\n", f->type, ctx->state); + + mfc_debug(2, "dec dst g_fmt, state: %d\n", ctx->state); if (ctx->state == MFCINST_GOT_INST || ctx->state == MFCINST_RES_CHANGE_FLUSH || @@ -355,7 +357,8 @@ static int vidioc_g_fmt_vid_out_mplane(struct file *file, void *priv, mfc_err_dev("no mfc decoder to run\n"); return -EINVAL; } - mfc_debug(2, "f->type = %d ctx->state = %d\n", f->type, ctx->state); + + mfc_debug(4, "dec src g_fmt, state: %d\n", ctx->state); /* This is run on OUTPUT The buffer contains compressed image @@ -410,7 +413,7 @@ static int vidioc_s_fmt_vid_cap_mplane(struct file *file, void *priv, return -EINVAL; } ctx->raw_buf.num_planes = ctx->dst_fmt->num_planes; - mfc_info_ctx("Dec output pixelformat : %s\n", ctx->dst_fmt->name); + mfc_info_ctx("[FRAME] dec dst pixelformat : %s\n", ctx->dst_fmt->name); mfc_debug_leave(); @@ -553,7 +556,6 @@ static int vidioc_reqbufs(struct file *file, void *priv, int ret = 0; mfc_debug_enter(); - mfc_info_ctx("Memory type: %d\n", reqbufs->memory); if (!dev) { mfc_err_dev("no mfc device to run\n"); @@ -572,11 +574,11 @@ static int vidioc_reqbufs(struct file *file, void *priv, } if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "dec src reqbuf(%d)\n", reqbufs->count); /* Can only request buffers after an instance has been opened.*/ if (ctx->state == MFCINST_GOT_INST) { if (reqbufs->count == 0) { - mfc_debug(2, "Freeing buffers.\n"); ret = vb2_reqbufs(&ctx->vq_src, reqbufs); ctx->output_state = QUEUE_FREE; return ret; @@ -597,8 +599,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, ctx->output_state = QUEUE_BUFS_REQUESTED; } } else if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "dec dst reqbuf(%d)\n", reqbufs->count); if (reqbufs->count == 0) { - mfc_debug(2, "Freeing buffers.\n"); ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); if (dev->has_mmcache && dev->mmcache.is_on_status) @@ -661,14 +663,15 @@ static int vidioc_querybuf(struct file *file, void *priv, mfc_debug_enter(); - mfc_debug(2, "State: %d, buf->type: %d\n", ctx->state, buf->type); if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "dec dst querybuf, state: %d\n", ctx->state); ret = vb2_querybuf(&ctx->vq_dst, buf); if (ret != 0) { mfc_err_dev("dec dst: error in vb2_querybuf()\n"); return ret; } } else if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "dec src querybuf, state: %d\n", ctx->state); ret = vb2_querybuf(&ctx->vq_src, buf); if (ret != 0) { mfc_err_dev("dec src: error in vb2_querybuf()\n"); @@ -692,7 +695,6 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) mfc_debug_enter(); - mfc_debug(2, "Enqueued buf: %d, (type = %d)\n", buf->index, buf->type); if (ctx->state == MFCINST_ERROR) { mfc_err_ctx("Call on QBUF after unrecoverable error.\n"); return -EIO; @@ -704,6 +706,7 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) } if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "dec src buf[%d] Q\n", buf->index); if (buf->m.planes[0].bytesused > buf->m.planes[0].length) { mfc_err_ctx("data size (%d) must be less than " "buffer size(%d)\n", @@ -723,8 +726,8 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) } ret = vb2_qbuf(&ctx->vq_src, buf); } else { + mfc_debug(4, "dec dst buf[%d] Q\n", buf->index); ret = vb2_qbuf(&ctx->vq_dst, buf); - mfc_debug(2, "End of enqueue(%d) : %d\n", buf->index, ret); } mfc_debug_leave(); @@ -741,15 +744,16 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) int ncount = 0; mfc_debug_enter(); - mfc_debug(2, "Addr: 0x%p 0x%p 0x%p Type: %d\n", &ctx->vq_src, buf, buf->m.planes, - buf->type); + if (ctx->state == MFCINST_ERROR) { mfc_err_ctx("Call on DQBUF after unrecoverable error.\n"); return -EIO; } if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "dec src buf[%d] DQ\n", buf->index); ret = vb2_dqbuf(&ctx->vq_src, buf, file->f_flags & O_NONBLOCK); } else { + mfc_debug(4, "dec dst buf[%d] DQ\n", buf->index); ret = vb2_dqbuf(&ctx->vq_dst, buf, file->f_flags & O_NONBLOCK); if (buf->index >= MFC_MAX_DPBS) { @@ -787,8 +791,10 @@ static int vidioc_streamon(struct file *file, void *priv, mfc_debug_enter(); if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "dec src streamon\n"); ret = vb2_streamon(&ctx->vq_src, type); } else if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "dec dst streamon\n"); ret = vb2_streamon(&ctx->vq_dst, type); if (!ret) @@ -817,10 +823,12 @@ static int vidioc_streamoff(struct file *file, void *priv, mfc_debug_enter(); if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "dec src streamoff\n"); s5p_mfc_qos_reset_last_framerate(ctx); ret = vb2_streamoff(&ctx->vq_src, type); } else if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "dec dst streamoff\n"); ret = vb2_streamoff(&ctx->vq_dst, type); if (!ret) s5p_mfc_qos_off(ctx); @@ -828,7 +836,6 @@ static int vidioc_streamoff(struct file *file, void *priv, mfc_err_ctx("unknown v4l2 buffer type\n"); } - mfc_debug(2, "streamoff\n"); mfc_debug_leave(); return ret; @@ -1149,7 +1156,7 @@ static int vidioc_g_crop(struct file *file, void *priv, cr->c.top = dec->black_bar.top; cr->c.width = dec->black_bar.width; cr->c.height = dec->black_bar.height; - mfc_debug(2, "[BLACKBAR] Cropping info: l=%d t=%d w=%d h=%d\n", + mfc_debug(2, "[FRAME][BLACKBAR] Cropping info: l=%d t=%d w=%d h=%d\n", dec->black_bar.left, dec->black_bar.top, dec->black_bar.width, @@ -1162,7 +1169,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, "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, @@ -1173,7 +1180,7 @@ static int vidioc_g_crop(struct file *file, void *priv, cr->c.top = 0; cr->c.width = ctx->img_width; cr->c.height = ctx->img_height; - mfc_debug(2, "Cropping info: w=%d h=%d fw=%d fh=%d\n", + mfc_debug(2, "[FRAME] Cropping info: w=%d h=%d fw=%d fh=%d\n", cr->c.width, cr->c.height, ctx->img_width, ctx->img_height); } 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 57c86ffae5d7..aa6cb1b046bc 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 @@ -61,7 +61,7 @@ static int s5p_mfc_dec_queue_setup(struct vb2_queue *vq, * this can be set after getting an instance */ if (ctx->state == MFCINST_GOT_INST && vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { - mfc_debug(2, "setting for VIDEO output\n"); + mfc_debug(4, "dec src\n"); /* A single plane is required for input */ *plane_count = 1; if (*buf_count < 1) @@ -75,7 +75,7 @@ static int s5p_mfc_dec_queue_setup(struct vb2_queue *vq, * this can be set after the header was parsed */ } else if (ctx->state == MFCINST_HEAD_PARSED && vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { - mfc_debug(2, "setting for VIDEO capture\n"); + mfc_debug(4, "dec dst\n"); /* Output plane count is different by the pixel format */ *plane_count = ctx->dst_fmt->mem_planes; /* Setup buffer count */ @@ -98,11 +98,11 @@ static int s5p_mfc_dec_queue_setup(struct vb2_queue *vq, ctx->state, vq->type); return -EINVAL; } - mfc_debug(2, "buffer count=%d, plane count=%d type=0x%x\n", - *buf_count, *plane_count, vq->type); - mfc_debug(2, "plane=0, size=%d\n", psize[0]); - mfc_debug(2, "plane=1, size=%d\n", psize[1]); + mfc_debug(2, "buf_count: %d, plane_count: %d, type: %#x\n", + *buf_count, *plane_count, vq->type); + for (i = 0; i < *plane_count; i++) + mfc_debug(2, "plane[%d] size: %d\n", i, psize[i]); mfc_debug_leave(); @@ -230,6 +230,7 @@ static int s5p_mfc_dec_buf_prepare(struct vb2_buffer *vb) struct s5p_mfc_dec *dec; struct s5p_mfc_raw_info *raw; unsigned int index = vb->index; + size_t buf_size; int i; if (!ctx) { @@ -245,20 +246,22 @@ static int s5p_mfc_dec_buf_prepare(struct vb2_buffer *vb) raw = &ctx->raw_buf; /* check the size per plane */ if (ctx->dst_fmt->mem_planes == 1) { - mfc_debug(2, "Plane size = %lu, dst size:%d\n", - vb2_plane_size(vb, 0), - raw->total_plane_size); - if (vb2_plane_size(vb, 0) < raw->total_plane_size) { - mfc_err_ctx("Capture plane is too small\n"); + buf_size = vb2_plane_size(vb, 0); + mfc_debug(2, "[FRAME] single plane vb size: %lu, calc size: %d\n", + buf_size, raw->total_plane_size); + if (buf_size < raw->total_plane_size) { + mfc_err_ctx("[FRAME] single plane size(%d) is smaller than (%d)\n", + buf_size, raw->total_plane_size); return -EINVAL; } } else { for (i = 0; i < ctx->dst_fmt->mem_planes; i++) { - mfc_debug(2, "Plane[%d] size: %lu, dst[%d] size: %d\n", - i, vb2_plane_size(vb, i), - i, raw->plane_size[i]); - if (vb2_plane_size(vb, i) < raw->plane_size[i]) { - mfc_err_ctx("Capture plane[%d] is too small\n", i); + buf_size = vb2_plane_size(vb, i); + mfc_debug(2, "[FRAME] plane[%d] vb size: %lu, calc size: %d\n", + i, buf_size, raw->plane_size[i]); + if (buf_size < raw->plane_size[i]) { + mfc_err_ctx("[FRAME] plane[%d] size(%d) is smaller than (%d)\n", + i, buf_size, raw->plane_size[i]); return -EINVAL; } } @@ -554,7 +557,7 @@ static void s5p_mfc_dec_buf_queue(struct vb2_buffer *vb) struct s5p_mfc_dev *dev; struct s5p_mfc_dec *dec; struct s5p_mfc_buf *buf = vb_to_mfc_buf(vb); - int index, i; + int i; unsigned char *stream_vir = NULL; mfc_debug_enter(); @@ -576,10 +579,8 @@ static void s5p_mfc_dec_buf_queue(struct vb2_buffer *vb) } if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { - mfc_debug(2, "Src queue: 0x%p\n", &ctx->src_buf_queue); - mfc_debug(2, "Adding to src: 0x%p (0x%08llx, 0x%08llx)\n", vb, - s5p_mfc_mem_get_daddr_vb(vb, 0), - buf->addr[0][0]); + mfc_debug(2, "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) stream_vir = vb2_plane_vaddr(vb, 0); @@ -591,13 +592,9 @@ static void s5p_mfc_dec_buf_queue(struct vb2_buffer *vb) 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) { - index = vb->index; - mfc_debug(2, "Dst queue: 0x%p\n", &ctx->dst_buf_queue); - mfc_debug(2, "Adding to dst: 0x%p (0x%08llx)\n", vb, - s5p_mfc_mem_get_daddr_vb(vb, 0)); - for (i = 0; i < ctx->dst_fmt->num_planes; i++) - mfc_debug(2, "dec dst plane[%d]: %08llx\n", - i, buf->addr[0][i]); + 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]); s5p_mfc_store_dpb(ctx, vb); if ((dec->dst_memtype == V4L2_MEMORY_USERPTR || dec->dst_memtype == V4L2_MEMORY_DMABUF) && @@ -606,7 +603,7 @@ static void s5p_mfc_dec_buf_queue(struct vb2_buffer *vb) ctx->capture_state = QUEUE_BUFS_MMAPED; MFC_TRACE_CTX("Q dst[%d] fd: %d, %#llx / avail %#lx used %#x\n", - index, vb->planes[0].m.fd, buf->addr[0][0], + vb->index, vb->planes[0].m.fd, buf->addr[0][0], dec->available_dpb, dec->dynamic_used); } else { mfc_err_ctx("Unsupported buffer type (%d)\n", vq->type); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c b/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c index 24e030ee949f..6fd9a2446e48 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_enc.c @@ -39,15 +39,15 @@ static struct s5p_mfc_fmt *mfc_enc_find_format(struct s5p_mfc_ctx *ctx, } if (!dev->pdata->support_10bit && (fmt->type & MFC_FMT_10BIT)) { - mfc_err_ctx("10bit is not supported\n"); + mfc_err_ctx("[FRAME] 10bit is not supported\n"); fmt = NULL; } if (!dev->pdata->support_422 && (fmt->type & MFC_FMT_422)) { - mfc_err_ctx("422 is not supported\n"); + mfc_err_ctx("[FRAME] 422 is not supported\n"); fmt = NULL; } if (!dev->pdata->support_rgb && (fmt->type & MFC_FMT_RGB)) { - mfc_err_ctx("RGB is not supported\n"); + mfc_err_ctx("[FRAME] RGB is not supported\n"); fmt = NULL; } @@ -202,9 +202,8 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) mfc_debug_enter(); - mfc_debug(2, "f->type = %d ctx->state = %d\n", f->type, ctx->state); - if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "enc dst g_fmt\n"); /* This is run on output (encoder dest) */ pix_fmt_mp->width = 0; pix_fmt_mp->height = 0; @@ -215,6 +214,7 @@ static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) pix_fmt_mp->plane_fmt[0].bytesperline = enc->dst_buf_size; pix_fmt_mp->plane_fmt[0].sizeimage = enc->dst_buf_size; } else if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src g_fmt\n"); /* This is run on capture (encoder src) */ raw = &ctx->raw_buf; @@ -260,13 +260,13 @@ static void mfc_enc_check_format(struct s5p_mfc_ctx *ctx) case V4L2_PIX_FMT_NV61M_S10B: case V4L2_PIX_FMT_NV16M_P210: case V4L2_PIX_FMT_NV61M_P210: - mfc_debug(2, "[10BIT] is 422 and 10bit format\n"); + mfc_debug(2, "[FRAME][10BIT] is 422 and 10bit format\n"); ctx->is_10bit = 1; ctx->is_422 = 1; break; case V4L2_PIX_FMT_NV16M: case V4L2_PIX_FMT_NV61M: - mfc_debug(2, "is 422 format\n"); + mfc_debug(2, "[FRAME] is 422 format\n"); ctx->is_10bit = 0; ctx->is_422 = 1; break; @@ -274,7 +274,7 @@ static void mfc_enc_check_format(struct s5p_mfc_ctx *ctx) case V4L2_PIX_FMT_NV12M_P010: case V4L2_PIX_FMT_NV21M_S10B: case V4L2_PIX_FMT_NV21M_P010: - mfc_debug(2, "[10BIT] is 10bit format\n"); + mfc_debug(2, "[FRAME][10BIT] is 10bit format\n"); ctx->is_10bit = 1; ctx->is_422 = 0; break; @@ -283,7 +283,7 @@ static void mfc_enc_check_format(struct s5p_mfc_ctx *ctx) ctx->is_422 = 0; break; } - mfc_debug(2, "10bit: %d, 422: %d\n", ctx->is_10bit, ctx->is_422); + mfc_debug(2, "[FRAME] 10bit: %d, 422: %d\n", ctx->is_10bit, ctx->is_422); } static int vidioc_s_fmt_vid_cap_mplane(struct file *file, void *priv, @@ -416,7 +416,7 @@ static int vidioc_s_fmt_vid_out_mplane(struct file *file, void *priv, } if (ctx->src_fmt->mem_planes != pix_fmt_mp->num_planes) { - mfc_err_ctx("plane number is different (%d != %d)\n", + mfc_err_ctx("[FRAME] enc src plane number is different (%d != %d)\n", ctx->src_fmt->mem_planes, pix_fmt_mp->num_planes); return -EINVAL; } @@ -433,8 +433,8 @@ static int vidioc_s_fmt_vid_out_mplane(struct file *file, void *priv, mfc_info_ctx("[DRC] Enc resolution is changed\n"); } - mfc_info_ctx("Enc input pixelformat : %s\n", ctx->src_fmt->name); - mfc_info_ctx("fmt - w: %d, h: %d, stride: %d\n", + mfc_info_ctx("[FRAME] enc src pixelformat : %s\n", ctx->src_fmt->name); + mfc_info_ctx("[FRAME] resolution w: %d, h: %d, stride: %d\n", pix_fmt_mp->width, pix_fmt_mp->height, ctx->buf_stride); /* @@ -462,7 +462,7 @@ static int vidioc_g_crop(struct file *file, void *fh, struct v4l2_crop *cr) cr->c.width = ctx->crop_width; cr->c.height = ctx->crop_height; - mfc_debug(3, "enc crop w: %d, h: %d, offset l: %d t: %d\n", + mfc_debug(2, "[FRAME] enc crop w: %d, h: %d, offset l: %d t: %d\n", ctx->crop_width, ctx->crop_height, ctx->crop_left, ctx->crop_top); mfc_debug_leave(); @@ -482,7 +482,7 @@ static int vidioc_s_crop(struct file *file, void *priv, const struct v4l2_crop * } if (cr->c.left < 0 || cr->c.top < 0) { - mfc_err_ctx("crop position is negative\n"); + mfc_err_ctx("[FRAME] crop position is negative\n"); return -EINVAL; } @@ -490,7 +490,7 @@ static int vidioc_s_crop(struct file *file, void *priv, const struct v4l2_crop * (cr->c.width > ctx->img_width) || (cr->c.left > ctx->img_width) || (cr->c.left <= (ctx->img_width - cr->c.width)) || (cr->c.top <= (ctx->img_height - cr->c.height))) { - mfc_err_ctx("Out of crop range: (%d,%d,%d,%d) from %dx%d\n", + mfc_err_ctx("[FRAME] Out of crop range: (%d,%d,%d,%d) from %dx%d\n", cr->c.left, cr->c.top, cr->c.width, cr->c.height, ctx->img_width, ctx->img_height); return -EINVAL; @@ -501,7 +501,7 @@ static int vidioc_s_crop(struct file *file, void *priv, const struct v4l2_crop * ctx->crop_height = cr->c.height; ctx->crop_width = cr->c.width; - mfc_debug(3, "enc original: %dx%d, crop: %dx%d, offset l: %d t: %d\n", + mfc_debug(3, "[FRAME] enc original: %dx%d, crop: %dx%d, offset l: %d t: %d\n", ctx->img_width, ctx->img_height, ctx->crop_width, ctx->crop_height, ctx->crop_left, ctx->crop_top); @@ -517,8 +517,6 @@ static int vidioc_reqbufs(struct file *file, void *priv, mfc_debug_enter(); - mfc_debug(2, "type: %d\n", reqbufs->memory); - if (reqbufs->memory == V4L2_MEMORY_MMAP) { mfc_err_ctx("Not supported memory type (%d).\n", reqbufs->memory); return -EINVAL; @@ -530,8 +528,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, } if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "enc dst reqbuf(%d)\n", reqbufs->count); if (reqbufs->count == 0) { - mfc_debug(2, "Freeing buffers.\n"); ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); ctx->capture_state = QUEUE_FREE; return ret; @@ -550,8 +548,8 @@ static int vidioc_reqbufs(struct file *file, void *priv, ctx->capture_state = QUEUE_BUFS_REQUESTED; } else if (reqbufs->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src reqbuf(%d)\n", reqbufs->count); if (reqbufs->count == 0) { - mfc_debug(2, "Freeing buffers.\n"); ret = vb2_reqbufs(&ctx->vq_src, reqbufs); ctx->output_state = QUEUE_FREE; return ret; @@ -592,14 +590,15 @@ static int vidioc_querybuf(struct file *file, void *priv, return 0; } - mfc_debug(2, "state: %d, buf->type: %d\n", ctx->state, buf->type); if (buf->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "enc dst querybuf, state: %d\n", ctx->state); ret = vb2_querybuf(&ctx->vq_dst, buf); if (ret != 0) { mfc_err_dev("enc dst: error in vb2_querybuf()\n"); return ret; } } else if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src querybuf, state: %d\n", ctx->state); ret = vb2_querybuf(&ctx->vq_src, buf); if (ret != 0) { mfc_err_dev("enc src: error in vb2_querybuf()\n"); @@ -628,7 +627,6 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) return 0; } - mfc_debug(2, "Enqueued buf: %d (type = %d)\n", buf->index, buf->type); if (ctx->state == MFCINST_ERROR) { mfc_err_ctx("Call on QBUF after unrecoverable error.\n"); return -EIO; @@ -640,19 +638,21 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf) } if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src buf[%d] Q\n", buf->index); for (i = 0; i < ctx->src_fmt->num_planes; i++) { if (!buf->m.planes[i].bytesused) { - mfc_debug(2, "Src input[%d] size zero, " + mfc_debug(2, "[FRAME] enc src[%d] size zero, " "changed to buf size %d\n", i, buf->m.planes[i].length); buf->m.planes[i].bytesused = buf->m.planes[i].length; } else { - mfc_debug(2, "Src input[%d] size %d\n", + mfc_debug(2, "[FRAME] enc src[%d] size %d\n", i, buf->m.planes[i].bytesused); } } ret = vb2_qbuf(&ctx->vq_src, buf); } else { + mfc_debug(4, "enc dst buf[%d] Q\n", buf->index); ret = vb2_qbuf(&ctx->vq_dst, buf); } @@ -673,16 +673,17 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf) return 0; } - mfc_debug(2, "Addr: 0x%p 0x%p 0x%p Type: %d\n", &ctx->vq_src, buf, buf->m.planes, - buf->type); if (ctx->state == MFCINST_ERROR) { mfc_err_ctx("Call on DQBUF after unrecoverable error.\n"); return -EIO; } - if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + if (buf->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src buf[%d] DQ\n", buf->index); ret = vb2_dqbuf(&ctx->vq_src, buf, file->f_flags & O_NONBLOCK); - else + } else { + mfc_debug(4, "enc dst buf[%d] DQ\n", buf->index); ret = vb2_dqbuf(&ctx->vq_dst, buf, file->f_flags & O_NONBLOCK); + } mfc_debug_leave(); return ret; } @@ -702,14 +703,17 @@ static int vidioc_streamon(struct file *file, void *priv, } if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src streamon\n"); ret = vb2_streamon(&ctx->vq_src, type); if (!ret) { s5p_mfc_qos_on(ctx); } } else { + mfc_debug(4, "enc dst streamon\n"); ret = vb2_streamon(&ctx->vq_dst, type); } + mfc_debug(2, "src: %d, dst: %d, state = %d, dpb_count = %d\n", s5p_mfc_get_queue_count(&ctx->buf_queue_lock, &ctx->src_buf_queue), s5p_mfc_get_queue_count(&ctx->buf_queue_lock, &ctx->dst_buf_queue), @@ -734,16 +738,17 @@ static int vidioc_streamoff(struct file *file, void *priv, ret = -EINVAL; if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src streamoff\n"); s5p_mfc_qos_reset_last_framerate(ctx); ret = vb2_streamoff(&ctx->vq_src, type); if (!ret) s5p_mfc_qos_off(ctx); } else { + mfc_debug(4, "enc dst streamoff\n"); ret = vb2_streamoff(&ctx->vq_dst, type); } - mfc_debug(2, "streamoff\n"); mfc_debug_leave(); return ret; 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 f4ad41562a7d..913aec68aec5 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 @@ -53,6 +53,7 @@ static int s5p_mfc_enc_queue_setup(struct vb2_queue *vq, } if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { + mfc_debug(4, "enc dst\n"); if (ctx->dst_fmt) *plane_count = ctx->dst_fmt->mem_planes; else @@ -66,6 +67,7 @@ static int s5p_mfc_enc_queue_setup(struct vb2_queue *vq, psize[0] = enc->dst_buf_size; alloc_devs[0] = dev->device; } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { + mfc_debug(4, "enc src\n"); raw = &ctx->raw_buf; if (ctx->src_fmt) @@ -92,9 +94,10 @@ static int s5p_mfc_enc_queue_setup(struct vb2_queue *vq, return -EINVAL; } - mfc_debug(2, "buf_count: %d, plane_count: %d\n", *buf_count, *plane_count); + mfc_debug(2, "buf_count: %d, plane_count: %d, type: %#x\n", + *buf_count, *plane_count, vq->type); for (i = 0; i < *plane_count; i++) - mfc_debug(2, "plane[%d] size=%d\n", i, psize[i]); + mfc_debug(2, "plane[%d] size: %d\n", i, psize[i]); mfc_debug_leave(); @@ -162,6 +165,7 @@ static int s5p_mfc_enc_buf_prepare(struct vb2_buffer *vb) struct s5p_mfc_buf *buf = vb_to_mfc_buf(vb); struct dma_buf *dmabuf[MFC_MAX_PLANES]; int i, mem_get_count = 0; + size_t buf_size; mfc_debug_enter(); @@ -178,20 +182,22 @@ static int s5p_mfc_enc_buf_prepare(struct vb2_buffer *vb) } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { raw = &ctx->raw_buf; if (ctx->src_fmt->mem_planes == 1) { - mfc_debug(2, "Plane size = %lu, src size:%d\n", - vb2_plane_size(vb, 0), - raw->total_plane_size); - if (vb2_plane_size(vb, 0) < raw->total_plane_size) { - mfc_err_ctx("Output plane is too small\n"); + buf_size = vb2_plane_size(vb, 0); + mfc_debug(2, "[FRAME] single plane vb size: %lu, calc size: %d\n", + buf_size, raw->total_plane_size); + if (buf_size < raw->total_plane_size) { + mfc_err_ctx("[FRAME] single plane size(%d) is smaller than (%d)\n", + buf_size, raw->total_plane_size); return -EINVAL; } } else { for (i = 0; i < ctx->src_fmt->mem_planes; i++) { - mfc_debug(2, "plane[%d] size: %lu, src[%d] size: %d\n", - i, vb2_plane_size(vb, i), - i, raw->plane_size[i]); - if (vb2_plane_size(vb, i) < raw->plane_size[i]) { - mfc_err_ctx("Output plane[%d] is too smalli\n", i); + buf_size = vb2_plane_size(vb, i); + mfc_debug(2, "[FRAME] plane[%d] vb size: %lu, calc size: %d\n", + i, buf_size, raw->plane_size[i]); + if (buf_size < raw->plane_size[i]) { + mfc_err_ctx("[FRAME] plane[%d] size(%d) is smaller than (%d)\n", + i, buf_size, raw->plane_size[i]); return -EINVAL; } } @@ -423,6 +429,7 @@ static void s5p_mfc_enc_buf_queue(struct vb2_buffer *vb) struct s5p_mfc_ctx *ctx = vq->drv_priv; struct s5p_mfc_dev *dev = ctx->dev; struct s5p_mfc_buf *buf = vb_to_mfc_buf(vb); + int i; mfc_debug_enter(); @@ -430,12 +437,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, "dst queue: 0x%p\n", &ctx->dst_buf_queue); - mfc_debug(2, "Adding to dst vb: 0x%p, addr: %08llx\n", vb, buf->addr[0][0]); + mfc_debug(2, "Adding to dst index[%d] 0x%08llx\n", + 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]); 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 5b004101020f..52de8281a0a7 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -387,8 +387,6 @@ static void mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err) frame_type = s5p_mfc_get_disp_frame_type(); mvc_view_id = s5p_mfc_get_mvc_disp_view_id(); - mfc_debug(2, "frame_type : %d\n", frame_type); - if (IS_H264_MVC_DEC(ctx)) { if (mvc_view_id == 0) ctx->sequence++; @@ -403,6 +401,8 @@ static void mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err) frame_type = s5p_mfc_get_dec_frame_type(); } + mfc_debug(2, "[FRAME] frame type: %d\n", frame_type); + /* If frame is same as previous then skip and do not dequeue */ if (frame_type == S5P_FIMV_DISPLAY_FRAME_NOT_CODED) if (!CODEC_NOT_CODED(ctx)) @@ -477,12 +477,9 @@ 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, disp_addr; + dma_addr_t dec_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, @@ -607,7 +604,14 @@ static void mfc_handle_frame(struct s5p_mfc_ctx *ctx, if (dec->immediate_display == 1) dst_frame_status = s5p_mfc_get_dec_status(); - mfc_debug(2, "Frame Status: %x\n", dst_frame_status); + mfc_debug(2, "[FRAME] frame status: %d\n", dst_frame_status); + mfc_debug(2, "[FRAME] display status: %d, type: %d, yaddr: %#x\n", + s5p_mfc_get_disp_status(), s5p_mfc_get_disp_frame_type(), + s5p_mfc_get_disp_y_addr()); + mfc_debug(2, "[FRAME] decoded status: %d, type: %d, yaddr: %#x\n", + s5p_mfc_get_dec_status(), s5p_mfc_get_dec_frame_type(), + s5p_mfc_get_dec_y_addr()); + mfc_debug(4, "[HDR] SEI available status: 0x%08x\n", s5p_mfc_get_sei_avail()); mfc_debug(4, "[HDR] SEI content light: 0x%08x\n", s5p_mfc_get_sei_content_light()); mfc_debug(4, "[HDR] SEI luminance: 0x%08x, 0x%08x white point: 0x%08x\n", @@ -771,7 +775,7 @@ 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, "encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]); + mfc_debug(2, "[FRAME] encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]); if (IS_BUFFER_BATCH_MODE(ctx)) { src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock, 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 24398a55d289..995ee1847a37 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -917,7 +917,7 @@ 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: encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]); + mfc_debug(2, "NAL Q:[FRAME] encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]); if (IS_BUFFER_BATCH_MODE(ctx)) { src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock, @@ -1128,23 +1128,18 @@ static void mfc_nal_q_handle_ref_frame(struct s5p_mfc_ctx *ctx, DecoderOutputStr { struct s5p_mfc_dec *dec = ctx->dec_priv; struct s5p_mfc_buf *dst_mb; - dma_addr_t dec_addr, buf_addr, disp_addr; + dma_addr_t dec_addr; int index = 0; mfc_debug_enter(); dec_addr = pOutStr->DecodedAddr[0]; - disp_addr = pOutStr->DisplayAddr[0]; - 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:[DPB] Found in dst queue, " - "dec addr: 0x%08llx, buf addr: 0x%08llx, used: %d\n", - dec_addr, buf_addr, dst_mb->used); + mfc_debug(2, "NAL Q:[DPB] Found in dst queue = 0x%08llx, buf = 0x%08llx\n", + dec_addr, dst_mb->addr[0][0]); index = dst_mb->vb.vb2_buf.index; if (!((1 << index) & pOutStr->UsedDpbFlagLower)) @@ -1375,8 +1370,6 @@ static void mfc_nal_q_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err frame_type = pOutStr->DisplayFrameType & S5P_FIMV_DISPLAY_FRAME_MASK; disp_err = s5p_mfc_get_warn(pOutStr->ErrorCode); - mfc_debug(2, "NAL_Q: frame_type in nal q : %d\n", frame_type); - ctx->sequence++; dspl_y_addr = pOutStr->DisplayAddr[0]; @@ -1386,6 +1379,8 @@ static void mfc_nal_q_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err frame_type = pOutStr->DecodedFrameType & S5P_FIMV_DECODED_FRAME_MASK; } + mfc_debug(2, "NAL Q:[FRAME] frame type: %d\n", frame_type); + /* If frame is same as previous then skip and do not dequeue */ if (frame_type == S5P_FIMV_DISPLAY_FRAME_NOT_CODED) { if (!CODEC_NOT_CODED(ctx)) @@ -1504,10 +1499,18 @@ void mfc_nal_q_handle_frame(struct s5p_mfc_ctx *ctx, DecoderOutputStr *pOutStr) dst_frame_status = pOutStr->DecodedStatus & S5P_FIMV_DEC_STATUS_DECODED_STATUS_MASK; - mfc_debug(2, "NAL Q: Frame Status: %x\n", dst_frame_status); + mfc_debug(2, "NAL Q:[FRAME] frame status: %d\n", dst_frame_status); + mfc_debug(2, "NAL Q:[FRAME] display status: %d, type: %d, yaddr: %#x\n", + pOutStr->DisplayStatus & S5P_FIMV_DISP_STATUS_DISPLAY_STATUS_MASK, + pOutStr->DisplayFrameType & S5P_FIMV_DISPLAY_FRAME_MASK, + pOutStr->DisplayAddr[0]); + mfc_debug(2, "NAL Q:[FRAME] decoded status: %d, type: %d, yaddr: %#x\n", + pOutStr->DecodedStatus & S5P_FIMV_DEC_STATUS_DECODED_STATUS_MASK, + pOutStr->DecodedFrameType & S5P_FIMV_DECODED_FRAME_MASK, + pOutStr->DecodedAddr[0]); mfc_debug(4, "NAL Q:[HDR] SEI available status: %x\n", sei_avail_status); mfc_debug(2, "NAL Q:[DPB] Used flag: old = %08x, new = %08x\n", - dec->dynamic_used, pOutStr->UsedDpbFlagLower); + dec->dynamic_used, pOutStr->UsedDpbFlagLower); if (ctx->state == MFCINST_RES_CHANGE_INIT) { mfc_debug(2, "NAL Q:[DRC] return until NAL-Q stopped in try_run\n"); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c index d8ec3015eb14..e7f1f03c7da4 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_otf.c @@ -63,6 +63,10 @@ static int mfc_otf_set_buf_info(struct s5p_mfc_ctx *ctx) return -EINVAL; } + mfc_debug(2, "OTF:[FRAME] resolution w: %d, h: %d, format: %s, bufcnt: %d\n", + buf_info->width, buf_info->height, + ctx->src_fmt->name, buf_info->buffer_count); + /* set source information */ ctx->raw_buf.num_planes = ctx->src_fmt->num_planes; ctx->img_width = buf_info->width; @@ -186,9 +190,6 @@ static int mfc_otf_init_hwfc_buf(struct s5p_mfc_ctx *ctx) } #endif mfc_debug(2, "OTF: recieved buffer information\n"); - mfc_debug(2, "OTF: w(%d), h(%d), format(0x%x), bufcnt(%d)\n", - buf_info->width, buf_info->height, - buf_info->pixel_format, buf_info->buffer_count); /* set buffer information to ctx, and calculate buffer size */ if (mfc_otf_set_buf_info(ctx)) { diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c index 3582dadfe318..94cb2fe5b86f 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c @@ -45,8 +45,8 @@ void s5p_mfc_otf_set_frame_addr(struct s5p_mfc_ctx *ctx, int num_planes) int i; for (i = 0; i < num_planes; i++) { - mfc_debug(2, "OTF: set frame buffer[i], 0x%08llx)\n", - buf_addr->otf_daddr[index][i]); + mfc_debug(2, "OTF:[FRAME] set frame buffer[%d], 0x%08llx)\n", + i, buf_addr->otf_daddr[index][i]); MFC_WRITEL(buf_addr->otf_daddr[index][i], S5P_FIMV_E_SOURCE_FIRST_ADDR + (i * 4)); } @@ -117,13 +117,23 @@ int s5p_mfc_set_dec_codec_buffers(struct s5p_mfc_ctx *ctx) mfc_debug(2, "Total DPB COUNT: %d, display delay: %d\n", dec->total_dpb_count, dec->display_delay); + /* set decoder DPB size, stride */ MFC_WRITEL(dec->total_dpb_count, S5P_FIMV_D_NUM_DPB); - mfc_debug(2, "raw->num_planes %d\n", raw->num_planes); for (i = 0; i < raw->num_planes; i++) { - mfc_debug(2, "raw->plane_size[%d]= %d\n", i, raw->plane_size[i]); + mfc_debug(2, "[FRAME] buf[%d] size: %d, stride: %d\n", + i, raw->plane_size[i], raw->stride[i]); MFC_WRITEL(raw->plane_size[i], S5P_FIMV_D_FIRST_PLANE_DPB_SIZE + (i * 4)); + MFC_WRITEL(ctx->raw_buf.stride[i], + S5P_FIMV_D_FIRST_PLANE_DPB_STRIDE_SIZE + (i * 4)); + if (ctx->is_10bit) { + MFC_WRITEL(raw->stride_2bits[i], S5P_FIMV_D_FIRST_PLANE_2BIT_DPB_STRIDE_SIZE + (i * 4)); + MFC_WRITEL(raw->plane_size_2bits[i], S5P_FIMV_D_FIRST_PLANE_2BIT_DPB_SIZE + (i * 4)); + mfc_debug(2, "[FRAME][10BIT] 2bits buf[%d] size: %d, stride: %d\n", + i, raw->plane_size_2bits[i], raw->stride_2bits[i]); + } } + /* set codec buffers */ MFC_WRITEL(buf_addr, S5P_FIMV_D_SCRATCH_BUFFER_ADDR); MFC_WRITEL(ctx->scratch_buf_size, S5P_FIMV_D_SCRATCH_BUFFER_SIZE); buf_addr += ctx->scratch_buf_size; @@ -172,23 +182,6 @@ int s5p_mfc_set_dec_codec_buffers(struct s5p_mfc_ctx *ctx) MFC_WRITEL(reg, S5P_FIMV_D_INIT_BUFFER_OPTIONS); - /* set decoder stride size */ - for (i = 0; i < ctx->raw_buf.num_planes; i++) { - MFC_WRITEL(ctx->raw_buf.stride[i], - S5P_FIMV_D_FIRST_PLANE_DPB_STRIDE_SIZE + (i * 4)); - mfc_debug(2, "# plane%d.size = %d, stride = %d\n", i, - ctx->raw_buf.plane_size[i], ctx->raw_buf.stride[i]); - } - - if (ctx->is_10bit) { - for (i = 0; i < ctx->raw_buf.num_planes; i++) { - MFC_WRITEL(raw->stride_2bits[i], S5P_FIMV_D_FIRST_PLANE_2BIT_DPB_STRIDE_SIZE + (i * 4)); - MFC_WRITEL(raw->plane_size_2bits[i], S5P_FIMV_D_FIRST_PLANE_2BIT_DPB_SIZE + (i * 4)); - mfc_debug(2, "[10BIT] : 2bits plane%d.size = %d, stride = %d\n", i, - ctx->raw_buf.plane_size_2bits[i], ctx->raw_buf.stride_2bits[i]); - } - } - frame_size_mv = ctx->mv_size; MFC_WRITEL(dec->mv_count, S5P_FIMV_D_NUM_MV); if (IS_H264_DEC(ctx) || IS_H264_MVC_DEC(ctx) || IS_HEVC_DEC(ctx) || IS_BPG_DEC(ctx)) { @@ -538,6 +531,6 @@ void s5p_mfc_set_pixel_format(struct s5p_mfc_dev *dev, unsigned int format) reg |= pix_val; reg |= (mem_type_10bit << 4); MFC_WRITEL(reg, S5P_FIMV_PIXEL_FORMAT); - mfc_debug(2, "pixel format: %d, mem_type_10bit for 10bit: %d (reg: %#x)\n", + mfc_debug(2, "[FRAME] pixel format: %d, mem_type_10bit for 10bit: %d (reg: %#x)\n", pix_val, mem_type_10bit, reg); } diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_utils.c b/drivers/media/platform/exynos/mfc/s5p_mfc_utils.c index 2db6a2c2b564..7927c42c0c07 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_utils.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_utils.c @@ -280,7 +280,7 @@ void s5p_mfc_dec_calc_dpb_size(struct s5p_mfc_ctx *ctx) for (i = 0; i < raw->num_planes; i++) { if (raw->plane_size[i] < ctx->min_dpb_size[i]) { - mfc_info_dev("plane[%d] size is changed %d -> %d\n", + mfc_info_dev("[FRAME] plane[%d] size is changed %d -> %d\n", i, raw->plane_size[i], ctx->min_dpb_size[i]); raw->plane_size[i] = ctx->min_dpb_size[i]; } @@ -288,18 +288,18 @@ void s5p_mfc_dec_calc_dpb_size(struct s5p_mfc_ctx *ctx) for (i = 0; i < raw->num_planes; i++) { raw->total_plane_size += raw->plane_size[i]; - mfc_debug(2, "Plane[%d] size = %d, stride = %d\n", + mfc_debug(2, "[FRAME] Plane[%d] size = %d, stride = %d\n", i, raw->plane_size[i], raw->stride[i]); } if (ctx->is_10bit) { for (i = 0; i < raw->num_planes; i++) { raw->total_plane_size += raw->plane_size_2bits[i]; - mfc_debug(2, "[10BIT] Plane[%d] 2bit size = %d, stride = %d\n", + mfc_debug(2, "[FRAME][10BIT] Plane[%d] 2bit size = %d, stride = %d\n", i, raw->plane_size_2bits[i], raw->stride_2bits[i]); } } - mfc_debug(2, "total plane size: %d\n", raw->total_plane_size); + mfc_debug(2, "[FRAME] total plane size: %d\n", raw->total_plane_size); if (IS_H264_DEC(ctx) || IS_H264_MVC_DEC(ctx)) { ctx->mv_size = DEC_MV_SIZE_MB(ctx->img_width, ctx->img_height); @@ -390,18 +390,19 @@ void s5p_mfc_enc_calc_src_size(struct s5p_mfc_ctx *ctx) for (i = 0; i < raw->num_planes; i++) { raw->total_plane_size += raw->plane_size[i]; - mfc_debug(2, "Plane[%d] size = %d, stride = %d\n", + mfc_debug(2, "[FRAME] Plane[%d] size = %d, stride = %d\n", i, raw->plane_size[i], raw->stride[i]); } if (ctx->is_10bit) { for (i = 0; i < raw->num_planes; i++) { raw->total_plane_size += raw->plane_size_2bits[i]; - mfc_debug(2, "[10BIT] Plane[%d] 2bit size = %d, stride = %d\n", + mfc_debug(2, "[FRAME][10BIT] Plane[%d] 2bit size = %d, stride = %d\n", i, raw->plane_size_2bits[i], raw->stride_2bits[i]); } } - mfc_debug(2, "total plane size: %d\n", raw->total_plane_size); + + mfc_debug(2, "[FRAME] total plane size: %d\n", raw->total_plane_size); } void s5p_mfc_cleanup_assigned_dpb(struct s5p_mfc_ctx *ctx)