}
if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
- mfc_debug(2, "[STREAM] Adding to src index[%d] 0x%08llx\n",
- vb->index, buf->addr[0][0]);
+ mfc_debug(2, "[BUFINFO] ctx[%d] add src index:%d, addr: 0x%08llx\n",
+ ctx->num, 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);
vb->index, vb->planes[0].m.fd, buf->addr[0][0]);
} else if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
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]);
+ mfc_debug(2, "[BUFINFO] ctx[%d] add dst index: %d, addr[%d]: 0x%08llx\n",
+ ctx->num, 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) &&
buf->done_index = 0;
if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
- mfc_debug(2, "[STREAM] Adding to dst index[%d] 0x%08llx\n",
- vb->index, buf->addr[0][0]);
+ mfc_debug(2, "[BUFINFO] ctx[%d] add dst index: %d, addr: 0x%08llx\n",
+ ctx->num, 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]);
+ mfc_debug(2, "[BUFINFO] ctx[%d] add src index: %d, addr[%d]: 0x%08llx\n",
+ ctx->num, 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)
if (ref_mb) {
index = ref_mb->vb.vb2_buf.index;
/* Check if this is the buffer we're looking for */
- mfc_debug(2, "[DPB] Found buf[%d] 0x%08llx, looking for disp addr 0x%08llx\n",
- index, ref_mb->addr[0][0], dspl_y_addr);
+ mfc_debug(2, "[BUFINFO][DPB] ctx[%d] get dst index: %d, addr[0]: 0x%08llx\n",
+ ctx->num, index, ref_mb->addr[0][0]);
ref_mb->vb.sequence = ctx->sequence;
ref_mb->vb.field = mfc_handle_frame_field(ctx);
return;
}
+ index = src_mb->vb.vb2_buf.index;
+ mfc_debug(2, "[BUFINFO] ctx[%d] get src index: %d, addr: 0x%08llx\n",
+ ctx->num, index, src_mb->addr[0][0]);
+
if (!deleted) {
/* Run MFC again on the same buffer */
mfc_debug(2, "Running again the same buffer.\n");
return;
}
- index = src_mb->vb.vb2_buf.index;
if (call_cop(ctx, recover_buf_ctrls_val, ctx, &ctx->src_ctrls[index]) < 0)
mfc_err_ctx("failed in recover_buf_ctrls_val\n");
- mfc_debug(2, "MFC needs next buffer.\n");
dec->consumed = 0;
dec->remained_size = 0;
goto move_buf;
}
for (i = 0; i < raw->num_planes; i++)
- mfc_debug(2, "[FRAME] encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]);
+ mfc_debug(2, "[BUFINFO] ctx[%d] get src addr[%d]: 0x%08llx\n",
+ ctx->num, i, enc_addr[i]);
if (IS_BUFFER_BATCH_MODE(ctx)) {
src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock,
return;
}
+ mfc_debug(2, "[BUFINFO] ctx[%d] get dst addr: 0x%08llx\n",
+ ctx->num, dst_mb->addr[0][0]);
+
dst_mb->vb.flags &= ~(V4L2_BUF_FLAG_KEYFRAME |
V4L2_BUF_FLAG_PFRAME |
V4L2_BUF_FLAG_BFRAME);
}
}
+ index = src_mb->vb.vb2_buf.index;
for (i = 0; i < raw->num_planes; i++) {
src_addr[i] = src_mb->addr[src_mb->next_index][i];
- mfc_debug(2, "NAL Q: enc batch buf[%d] src[%d] addr: 0x%08llx\n",
- src_mb->next_index, i, src_addr[i]);
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src index:%d, batch[%d], addr[%d]: 0x%08llx\n",
+ ctx->num, index, src_mb->next_index, i, src_addr[i]);
}
src_mb->next_index++;
} else {
return -EAGAIN;
}
+ index = src_mb->vb.vb2_buf.index;
for (i = 0; i < raw->num_planes; i++) {
src_addr[i] = src_mb->addr[0][i];
- mfc_debug(2, "NAL Q: enc src[%d] addr: 0x%08llx\n",
- i, src_addr[i]);
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src index:%d, addr[%d]: 0x%08llx\n",
+ ctx->num, index, i, src_addr[i]);
}
}
addr_2bit[0] = src_addr[0] + NV12N_Y_SIZE(ctx->img_width, ctx->img_height);
addr_2bit[1] = src_addr[1] + NV12N_CBCR_SIZE(ctx->img_width, ctx->img_height);
- for (i = 0; i < raw->num_planes; i++)
+ for (i = 0; i < raw->num_planes; i++) {
pInStr->Frame2bitAddr[i] = addr_2bit[i];
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n",
+ ctx->num, index, i, addr_2bit[i]);
+ }
} else if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV16M_S10B ||
ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV61M_S10B) {
addr_2bit[0] = src_addr[0] + NV16M_Y_SIZE(ctx->img_width, ctx->img_height);
addr_2bit[1] = src_addr[1] + NV16M_CBCR_SIZE(ctx->img_width, ctx->img_height);
- for (i = 0; i < raw->num_planes; i++)
+ for (i = 0; i < raw->num_planes; i++) {
pInStr->Frame2bitAddr[i] = addr_2bit[i];
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n",
+ ctx->num, index, i, addr_2bit[i]);
+ }
}
/* move dst_queue -> dst_queue_nal_q */
pInStr->StreamBufferSize = (unsigned int)vb2_plane_size(&dst_mb->vb.vb2_buf, 0);
pInStr->StreamBufferSize = ALIGN(pInStr->StreamBufferSize, 512);
- mfc_debug(2, "NAL Q: enc dst addr: 0x%x\n", pInStr->StreamBufferAddr);
-
- index = src_mb->vb.vb2_buf.index;
if (call_cop(ctx, set_buf_ctrls_val_nal_q_enc, ctx, &ctx->src_ctrls[index], pInStr) < 0)
mfc_err_ctx("NAL Q: failed in set_buf_ctrals_val in nal q\n");
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set dst index: %d, addr: 0x%08llx\n",
+ ctx->num, dst_mb->vb.vb2_buf.index, pInStr->StreamBufferAddr);
mfc_debug(2, "NAL Q: input queue, src_buf_queue -> src_buf_nal_queue, index:%d\n",
src_mb->vb.vb2_buf.index);
mfc_debug(2, "NAL Q: input queue, dst_buf_queue -> dst_buf_nal_queue, index:%d\n",
}
/* src buffer setting */
+ src_index = src_mb->vb.vb2_buf.index;
buf_addr = src_mb->addr[0][0];
strm_size = src_mb->vb.vb2_buf.planes[0].bytesused;
cpb_buf_size = ALIGN(dec->src_buf_size, STREAM_BUF_ALIGN);
- mfc_debug(2, "NAL Q: Src addr: 0x%08llx, size: %d\n", buf_addr, strm_size);
if (strm_size > set_strm_size_max(cpb_buf_size)) {
mfc_info_ctx("NAL Q: Decrease strm_size : %u -> %u, gap : %d\n",
src_mb->vb.vb2_buf.planes[0].bytesused = strm_size;
}
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] set src index: %d, addr: 0x%08llx\n",
+ ctx->num, src_index, buf_addr);
+ mfc_debug(2, "NAL Q:[STREAM] strm_size: %#lx(%d), buf_size: %u\n",
+ strm_size, strm_size, cpb_buf_size);
+
if (strm_size == 0)
mfc_info_ctx("stream size is 0\n");
pInStr->CpbBufferOffset = 0;
MFC_TRACE_CTX("Set src[%d] fd: %d, %#llx\n",
- src_mb->vb.vb2_buf.index,
- src_mb->vb.vb2_buf.planes[0].m.fd,
- buf_addr);
+ src_index, src_mb->vb.vb2_buf.planes[0].m.fd, buf_addr);
/* dst buffer setting */
dst_index = dst_mb->vb.vb2_buf.index;
pInStr->FrameAddr[i] = dst_mb->addr[0][i];
if (ctx->is_10bit)
pInStr->Frame2BitSize[i] = raw->plane_size_2bits[i];
- mfc_debug(2, "NAL Q:[DPB] Dst buf[%d] plane[%d] addr 0x%08llx\n",
- dst_index, i, dst_mb->addr[0][i]);
+ mfc_debug(2, "NAL Q:[BUFINFO][DPB] ctx[%d] set dst index: %d, addr[%d]: 0x%08llx\n",
+ ctx->num, dst_index, i, dst_mb->addr[0][i]);
}
pInStr->ScratchBufAddr = ctx->codec_buf.daddr;
pInStr->ScratchBufSize = ctx->scratch_buf_size;
- src_index = src_mb->vb.vb2_buf.index;
if (call_cop(ctx, set_buf_ctrls_val_nal_q_dec, ctx,
&ctx->src_ctrls[src_index], pInStr) < 0)
mfc_err_ctx("NAL Q: failed in set_buf_ctrls_val\n");
enc_recon_y_addr = pOutStr->ReconLumaDpbAddr;
enc_recon_c_addr = pOutStr->ReconChromaDpbAddr;
- mfc_debug(2, "NAL Q: recon y addr: 0x%08lx\n", enc_recon_y_addr);
- mfc_debug(2, "NAL Q: recon c addr: 0x%08lx\n", enc_recon_c_addr);
+ mfc_debug(2, "NAL Q:[MEMINFO] recon y: 0x%08lx c: 0x%08lx\n",
+ enc_recon_y_addr, enc_recon_c_addr);
}
static void mfc_nal_q_handle_stream_copy_timestamp(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *src_mb)
}
for (i = 0; i < raw->num_planes; i++)
- mfc_debug(2, "NAL Q:[FRAME] encoded[%d] addr: 0x%08llx\n", i, enc_addr[i]);
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] get src addr[%d]: 0x%08llx\n",
+ ctx->num, i, enc_addr[i]);
if (IS_BUFFER_BATCH_MODE(ctx)) {
src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock,
return;
}
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] get dst addr: 0x%08llx\n",
+ ctx->num, dst_mb->addr[0][0]);
+
dst_mb->vb.flags &= ~(V4L2_BUF_FLAG_KEYFRAME |
V4L2_BUF_FLAG_PFRAME |
V4L2_BUF_FLAG_BFRAME);
index = ref_mb->vb.vb2_buf.index;
/* Check if this is the buffer we're looking for */
- mfc_debug(2, "NAL Q:[DPB] Found buf[%d] 0x%08llx, looking for disp addr 0x%08llx\n",
- index, ref_mb->addr[0][0], dspl_y_addr);
+ mfc_debug(2, "NAL Q:[BUFINFO][DPB] ctx[%d] get dst index: %d, addr[0]: 0x%08llx\n",
+ ctx->num, index, ref_mb->addr[0][0]);
ref_mb->vb.sequence = ctx->sequence;
return;
}
+ index = src_mb->vb.vb2_buf.index;
+ mfc_debug(2, "NAL Q:[BUFINFO] ctx[%d] get src index: %d, addr: 0x%08llx\n",
+ ctx->num, index, src_mb->addr[0][0]);
+
if (!deleted) {
/* Run MFC again on the same buffer */
mfc_debug(2, "NAL Q: Running again the same buffer.\n");
return;
}
- index = src_mb->vb.vb2_buf.index;
if (call_cop(ctx, get_buf_ctrls_val_nal_q_dec, ctx,
&ctx->src_ctrls[index], pOutStr) < 0)
mfc_err_ctx("NAL Q: failed in get_buf_ctrls_val\n");
- mfc_debug(2, "NAL Q: MFC needs next buffer.\n");
dec->consumed = 0;
dec->remained_size = 0;
s5p_mfc_get_enc_frame_buffer(ctx, &enc_addr[0], raw->num_planes);
for (i = 0; i < raw->num_planes; i++)
- mfc_debug(2, "OTF: encoded[%d] addr: 0x%08llx\n",
- i, enc_addr[i]);
+ mfc_debug(2, "OTF:[BUFINFO] ctx[%d] get src addr[%d]: 0x%08llx\n",
+ ctx->num, i, enc_addr[i]);
if (enc_addr[0] != buf_addr->otf_daddr[handle->otf_buf_index][0]) {
mfc_err_ctx("OTF: address is not matched. 0x%08llx != 0x%08llx\n",
enc_addr[0], buf_addr->otf_daddr[handle->otf_buf_index][0]);
spin_lock_irqsave(plock, flags);
- mfc_debug(2, "queue address: 0x%p\n", queue);
- mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf);
-
mfc_buf->used = 0;
list_add_tail(&mfc_buf->list, &queue->head);
queue->count++;
struct s5p_mfc_dec *dec;
unsigned int cpb_buf_size;
dma_addr_t addr;
+ int index = -1;
mfc_debug_enter();
if (!ctx) {
cpb_buf_size = ALIGN(dec->src_buf_size, STREAM_BUF_ALIGN);
if (mfc_buf) {
+ index = mfc_buf->vb.vb2_buf.index;
addr = mfc_buf->addr[0][0];
if (strm_size > set_strm_size_max(cpb_buf_size)) {
mfc_info_ctx("Decrease strm_size because of %d align: %u -> %u\n",
addr = 0;
}
- mfc_debug(2, "inst_no: %d, buf_addr: 0x%08llx\n", ctx->inst_no, addr);
- mfc_debug(2, "strm_size: %u cpb_buf_size: %u offset: %u\n",
- strm_size, cpb_buf_size, start_num_byte);
+ mfc_debug(2, "[BUFINFO] ctx[%d] set src index: %d, addr: 0x%08llx\n",
+ ctx->num, index, addr);
+ mfc_debug(2, "[STREAM] strm_size: %#lx(%d), buf_size: %u, offset: %u\n",
+ strm_size, strm_size, cpb_buf_size, start_num_byte);
if (strm_size == 0)
mfc_info_ctx("stream size is 0\n");
if (mfc_buf)
MFC_TRACE_CTX("Set src[%d] fd: %d, %#llx\n",
- mfc_buf->vb.vb2_buf.index,
- mfc_buf->vb.vb2_buf.planes[0].m.fd,
- addr);
+ index, mfc_buf->vb.vb2_buf.planes[0].m.fd, addr);
mfc_debug_leave();
return 0;
struct s5p_mfc_dev *dev = ctx->dev;
dma_addr_t addr[3] = { 0, 0, 0 };
dma_addr_t addr_2bit[2] = { 0, 0 };
- int i;
+ int index, i;
if (!mfc_buf) {
mfc_debug(3, "enc zero buffer set\n");
goto buffer_set;
}
+ index = mfc_buf->vb.vb2_buf.index;
if (mfc_buf->num_bufs_in_vb > 0) {
for (i = 0; i < num_planes; i++) {
addr[i] = mfc_buf->addr[mfc_buf->next_index][i];
- mfc_debug(2, "enc batch buf[%d] src[%d] addr: 0x%08llx\n",
- mfc_buf->next_index, i, addr[i]);
+ mfc_debug(2, "[BUFINFO] ctx[%d] set src index:%d, batch[%d], addr[%d]: 0x%08llx\n",
+ ctx->num, index, mfc_buf->next_index, i, addr[i]);
}
mfc_buf->next_index++;
} else {
for (i = 0; i < num_planes; i++) {
addr[i] = mfc_buf->addr[0][i];
- mfc_debug(2, "enc src[%d] addr: 0x%08llx\n", i, addr[i]);
+ mfc_debug(2, "[BUFINFO] ctx[%d] set src index:%d, addr[%d]: 0x%08llx\n",
+ ctx->num, index, i, addr[i]);
}
}
addr_2bit[0] = addr[0] + NV12N_10B_Y_8B_SIZE(ctx->img_width, ctx->img_height);
addr_2bit[1] = addr[1] + NV12N_10B_CBCR_8B_SIZE(ctx->img_width, ctx->img_height);
- for (i = 0; i < num_planes; i++)
+ for (i = 0; i < num_planes; i++) {
MFC_WRITEL(addr_2bit[i], S5P_FIMV_E_SOURCE_FIRST_2BIT_ADDR + (i * 4));
+ mfc_debug(2, "[BUFINFO][10BIT] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n",
+ ctx->num, i, addr_2bit[i]);
+ }
} else if (ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV16M_S10B ||
ctx->src_fmt->fourcc == V4L2_PIX_FMT_NV61M_S10B) {
addr_2bit[0] = addr[0] + NV16M_Y_SIZE(ctx->img_width, ctx->img_height);
addr_2bit[1] = addr[1] + NV16M_CBCR_SIZE(ctx->img_width, ctx->img_height);
- for (i = 0; i < num_planes; i++)
+ for (i = 0; i < num_planes; i++) {
MFC_WRITEL(addr_2bit[i], S5P_FIMV_E_SOURCE_FIRST_2BIT_ADDR + (i * 4));
+ mfc_debug(2, "[BUFINFO][10BIT] ctx[%d] set src 2bit addr[%d]: 0x%08llx\n",
+ ctx->num, i, addr_2bit[i]);
+ }
}
}
{
struct s5p_mfc_dev *dev = ctx->dev;
dma_addr_t addr;
- unsigned int size, offset;
+ unsigned int size, offset, index;
+ index = mfc_buf->vb.vb2_buf.index;
addr = mfc_buf->addr[0][0];
offset = mfc_buf->vb.vb2_buf.planes[0].data_offset;
size = (unsigned int)vb2_plane_size(&mfc_buf->vb.vb2_buf, 0);
MFC_WRITEL(size, S5P_FIMV_E_STREAM_BUFFER_SIZE);
MFC_WRITEL(offset, S5P_FIMV_E_STREAM_BUFFER_OFFSET);
- mfc_debug(2, "stream buf addr: 0x%08llx, size: 0x%08x(%d), offset: %d\n",
- addr, size, size, offset);
+ mfc_debug(2, "[BUFINFO] ctx[%d] set dst index: %d, addr: 0x%08llx\n",
+ ctx->num, index, addr);
+ mfc_debug(2, "[STREAM] buf_size: %u, offset: %d\n", size, offset);
return 0;
}
enc_recon_y_addr = MFC_READL(S5P_FIMV_E_RECON_LUMA_DPB_ADDR);
enc_recon_c_addr = MFC_READL(S5P_FIMV_E_RECON_CHROMA_DPB_ADDR);
- mfc_debug(2, "recon y addr: 0x%08lx\n", enc_recon_y_addr);
- mfc_debug(2, "recon c addr: 0x%08lx\n", enc_recon_c_addr);
+ mfc_debug(2, "[MEMINFO] recon y: 0x%08lx c: 0x%08lx\n",
+ enc_recon_y_addr, enc_recon_c_addr);
}
void s5p_mfc_set_enc_stride(struct s5p_mfc_ctx *ctx)
for (i = 0; i < ctx->raw_buf.num_planes; i++) {
MFC_WRITEL(ctx->raw_buf.stride[i],
S5P_FIMV_E_SOURCE_FIRST_STRIDE + (i * 4));
- mfc_debug(2, "enc src[%d] stride: 0x%08lx\n",
- i, (unsigned long)ctx->raw_buf.stride[i]);
+ mfc_debug(2, "[FRAME] enc src plane[%d] stride: %d\n",
+ i, ctx->raw_buf.stride[i]);
}
}
if (ctx->is_10bit)
MFC_WRITEL(raw->plane_size_2bits[i],
S5P_FIMV_D_FIRST_PLANE_2BIT_DPB_SIZE + (i * 4));
- mfc_debug(2, "[DPB] Dst buf[%d] plane[%d] addr 0x%08llx\n",
- dst_index, i, dst_mb->addr[0][i]);
+ mfc_debug(2, "[BUFINFO][DPB] ctx[%d] set dst index: %d, addr[%d]: 0x%08llx\n",
+ ctx->num, dst_index, i, dst_mb->addr[0][i]);
}
MFC_TRACE_CTX("Set dst[%d] fd: %d, %#llx / avail %#lx used %#x\n",