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);
}
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 (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 */
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 ||
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
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();
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");
}
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;
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)
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");
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;
}
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",
}
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();
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) {
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)
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);
mfc_err_ctx("unknown v4l2 buffer type\n");
}
- mfc_debug(2, "streamoff\n");
mfc_debug_leave();
return ret;
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,
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,
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);
}
* 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)
* 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 */
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();
struct s5p_mfc_dec *dec;
struct s5p_mfc_raw_info *raw;
unsigned int index = vb->index;
+ size_t buf_size;
int i;
if (!ctx) {
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;
}
}
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();
}
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);
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) &&
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);
}
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;
}
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;
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;
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;
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;
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,
}
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;
}
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);
/*
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();
}
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;
}
(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;
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);
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;
}
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;
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;
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");
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;
}
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);
}
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;
}
}
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),
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;
}
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
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)
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();
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();
} 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;
}
}
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();
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)
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++;
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))
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,
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",
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,
}
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,
{
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))
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];
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))
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");
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;
}
#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)) {
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));
}
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;
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)) {
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);
}
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];
}
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);
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)