mem_get_count++;
buf->num_bufs_in_batch = s5p_mfc_bufcon_get_buf_count(bufcon_dmabuf[i]);
- mfc_debug(3, "bufcon count:%d\n", buf->num_bufs_in_batch);
+ mfc_debug(3, "[BUFCON] num bufs in batch: %d\n", buf->num_bufs_in_batch);
if (buf->num_bufs_in_batch == 0) {
- mfc_err_ctx("bufcon count couldn't be zero\n");
+ mfc_err_ctx("[BUFCON] bufs count couldn't be zero\n");
goto err_mem_put;
}
if (!ctx->batch_mode && buf->num_bufs_in_batch > 0) {
ctx->batch_mode = 1;
- mfc_debug(3, "buffer batch mode enable\n");
+ mfc_debug(2, "[BUFCON] buffer batch mode enable\n");
}
if (buf->num_bufs_in_batch > 0) {
if (s5p_mfc_bufcon_get_daddr(ctx, buf, bufcon_dmabuf[i], i)) {
- mfc_err_ctx("failed to get daddr[%d] in buffer container\n", i);
+ mfc_err_ctx("[BUFCON] failed to get daddr[%d] in buffer container\n", i);
goto err_mem_put;
}
ctx->framerate = buf->num_valid_bufs * ENC_DEFAULT_CAM_CAPTURE_FPS;
- mfc_debug(3, "framerate: %ld\n", ctx->framerate);
+ mfc_debug(3, "[BUFCON] framerate: %ld\n", ctx->framerate);
dma_buf_put(bufcon_dmabuf[i]);
} else {
mfc_err_dev("no mfc device to run\n");
return;
}
- mfc_debug(2, "Try run dev: 0x%p\n", dev);
spin_lock_irqsave(&dev->hwlock.lock, flags);
mfc_print_hwlock(dev);
u64 new_timestamp;
if (!ctx) {
- mfc_err_dev("[TS] no mfc context to run\n");
+ mfc_err_dev("[BUFCON][TS] no mfc context to run\n");
return;
}
dev = ctx->dev;
if (!dev) {
- mfc_err_dev("[TS] no device to run\n");
+ mfc_err_dev("[BUFCON][TS] no device to run\n");
return;
}
start_timestamp = src_mb->vb.vb2_buf.timestamp;
interval = NSEC_PER_SEC / p->rc_framerate;
if (debug_ts == 1)
- mfc_info_ctx("[TS] %dfps, start timestamp: %lld, base interval: %d\n",
+ mfc_info_ctx("[BUFCON][TS] %dfps, start timestamp: %lld, base interval: %d\n",
p->rc_framerate, start_timestamp, interval);
new_timestamp = start_timestamp + (interval * src_mb->done_index);
if (debug_ts == 1)
- mfc_info_ctx("[TS] new timestamp: %lld, interval: %d\n",
+ mfc_info_ctx("[BUFCON][TS] new timestamp: %lld, interval: %d\n",
new_timestamp, interval * src_mb->done_index);
/* Get the destination buffer */
mfc_handle_stream_copy_timestamp(ctx, src_mb);
src_mb->done_index++;
- mfc_debug(4, "batch buf done_index: %d\n", src_mb->done_index);
+ mfc_debug(4, "[BUFCON] batch buf done_index: %d\n", src_mb->done_index);
index = src_mb->vb.vb2_buf.index;
for (i = 0; i < mfc_buf->num_valid_bufs; i++) {
if (mfc_buf->addr[i][plane]) {
- mfc_debug(4, "put batch buf addr[%d][%d]: 0x%08llx\n",
+ mfc_debug(4, "[BUFCON] put batch buf addr[%d][%d]: 0x%08llx\n",
i, plane, mfc_buf->addr[i][plane]);
ion_iovmm_unmap(mfc_buf->attachments[i][plane], mfc_buf->addr[i][plane]);
}
u32 mask;
if (dmabuf_container_get_mask(bufcon_dmabuf, &mask)) {
- mfc_err_ctx("it is not buffer container\n");
+ mfc_err_ctx("[BUFCON] it is not buffer container\n");
return -1;
} else {
- mfc_debug(3, "bufcon mask info %#x\n", mask);
+ mfc_debug(3, "[BUFCON] bufcon mask info %#x\n", mask);
}
for (i = 0; i < mfc_buf->num_bufs_in_batch; i++) {
if ((mask & (1 << i)) == 0) {
- mfc_debug(3, "unmasked buf[%d]\n", i);
+ mfc_debug(4, "[BUFCON] unmasked buf[%d]\n", i);
continue;
}
mfc_buf->dmabufs[j][plane] = dmabuf_container_get_buffer(bufcon_dmabuf, i);
if (IS_ERR(mfc_buf->dmabufs[i][plane])) {
- mfc_err_ctx("Failed to get dma_buf (err %ld)",
+ mfc_err_ctx("[BUFCON] Failed to get dma_buf (err %ld)",
PTR_ERR(mfc_buf->dmabufs[i][plane]));
call_dop(dev, dump_and_stop_debug_mode, dev);
goto err_get_daddr;
mfc_buf->attachments[j][plane] = dma_buf_attach(mfc_buf->dmabufs[i][plane], dev->device);
if (IS_ERR(mfc_buf->attachments[i][plane])) {
- mfc_err_ctx("Failed to get dma_buf_attach (err %ld)",
+ mfc_err_ctx("[BUFCON] Failed to get dma_buf_attach (err %ld)",
PTR_ERR(mfc_buf->attachments[i][plane]));
call_dop(dev, dump_and_stop_debug_mode, dev);
goto err_get_daddr;
mfc_buf->addr[j][plane] = ion_iovmm_map(mfc_buf->attachments[i][plane], 0,
raw->plane_size[plane], DMA_BIDIRECTIONAL, 0);
if (IS_ERR_VALUE(mfc_buf->addr[i][plane])) {
- mfc_err_ctx("Failed to allocate iova (err %pa)",
+ mfc_err_ctx("[BUFCON] Failed to allocate iova (err %pa)",
&mfc_buf->addr[i][plane]);
call_dop(dev, dump_and_stop_debug_mode, dev);
goto err_get_daddr;
}
- mfc_debug(4, "get batch buf addr[%d][%d]: 0x%08llx, size: %d\n",
+ mfc_debug(4, "[BUFCON] get batch buf addr[%d][%d]: 0x%08llx, size: %d\n",
j, plane, mfc_buf->addr[j][plane], raw->plane_size[plane]);
j++;
}
mfc_buf->num_valid_bufs = j;
- mfc_debug(3, "batch buffer has %d buffers\n", mfc_buf->num_valid_bufs);
+ mfc_debug(3, "[BUFCON] batch buffer has %d buffers\n", mfc_buf->num_valid_bufs);
return 0;
if (IS_BUFFER_BATCH_MODE(ctx)) {
src_mb = s5p_mfc_get_buf(&ctx->buf_queue_lock, &ctx->src_buf_queue, MFC_BUF_SET_USED);
if (!src_mb) {
- mfc_err_dev("[NALQ] no src buffers\n");
+ mfc_err_dev("[NALQ][BUFCON] no src buffers\n");
return -EAGAIN;
}
&ctx->src_buf_nal_queue, &ctx->src_buf_queue,
MFC_BUF_SET_USED, MFC_QUEUE_ADD_BOTTOM);
if (!src_mb) {
- mfc_err_dev("[NALQ] no src buffers\n");
+ mfc_err_dev("[NALQ][BUFCON] no src buffers\n");
return -EAGAIN;
}
}
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, "[NALQ][BUFINFO] ctx[%d] set src index:%d, batch[%d], addr[%d]: 0x%08llx\n",
+ mfc_debug(2, "[NALQ][BUFCON][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++;
u64 new_timestamp;
if (!ctx) {
- mfc_err_dev("[NALQ][TS] no mfc context to run\n");
+ mfc_err_dev("[NALQ][BUFCON][TS] no mfc context to run\n");
return;
}
dev = ctx->dev;
if (!dev) {
- mfc_err_dev("[NALQ][TS] no device to run\n");
+ mfc_err_dev("[NALQ][BUFCON][TS] no device to run\n");
return;
}
start_timestamp = src_mb->vb.vb2_buf.timestamp;
interval = NSEC_PER_SEC / p->rc_framerate;
if (debug_ts == 1)
- mfc_info_ctx("[NALQ][TS] %dfps, start timestamp: %lld, base interval: %d\n",
+ mfc_info_ctx("[NALQ][BUFCON][TS] %dfps, start timestamp: %lld, base interval: %d\n",
p->rc_framerate, start_timestamp, interval);
new_timestamp = start_timestamp + (interval * src_mb->done_index);
if (debug_ts == 1)
- mfc_info_ctx("[NALQ][TS] new timestamp: %lld, interval: %d\n",
+ mfc_info_ctx("[NALQ][BUFCON][TS] new timestamp: %lld, interval: %d\n",
new_timestamp, interval * src_mb->done_index);
/* Get the destination buffer */
mfc_nal_q_handle_stream_copy_timestamp(ctx, src_mb);
src_mb->done_index++;
- mfc_debug(4, "[NALQ] batch buf done_index: %d\n", src_mb->done_index);
+ mfc_debug(4, "[NALQ][BUFCON] batch buf done_index: %d\n", src_mb->done_index);
} else {
src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock,
&ctx->src_buf_nal_queue, enc_addr[0]);
mfc_nal_q_handle_stream_copy_timestamp(ctx, src_mb);
src_mb->done_index++;
- mfc_debug(4, "[NALQ] batch buf done_index: %d\n", src_mb->done_index);
+ mfc_debug(4, "[NALQ][BUFCON] batch buf done_index: %d\n", src_mb->done_index);
/* last image in a buffer container */
if (src_mb->done_index == src_mb->num_valid_bufs) {
if (src_mb->num_valid_bufs > 0) {
/* last image in a buffer container */
- if (src_mb->next_index == (src_mb->num_valid_bufs - 1))
+ if (src_mb->next_index == (src_mb->num_valid_bufs - 1)) {
+ mfc_debug(4, "[BUFCON] last image in a container\n");
last_frame = mfc_check_last_frame(ctx, src_mb);
+ }
} else {
last_frame = mfc_check_last_frame(ctx, src_mb);
}
if (IS_BUFFER_BATCH_MODE(ctx)) {
if (debug_ts == 1)
- mfc_info_ctx("[TS] Keep framerate if buffer batch mode is used, %ldfps\n",
+ mfc_info_ctx("[BUFCON][TS] Keep framerate if buffer batch mode is used, %ldfps\n",
ctx->framerate);
return ctx->framerate;
}
csd = mfc_buf->vb.reserved2 & FLAG_CSD ? 1 : 0;
- mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0][0]);
+ mfc_debug(2, "addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]);
spin_unlock_irqrestore(plock, flags);
return csd;
if ((used == MFC_BUF_RESET_USED) || (used == MFC_BUF_SET_USED))
mfc_buf->used = used;
- mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0][0]);
+ mfc_debug(2, "addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]);
spin_unlock_irqrestore(plock, flags);
return mfc_buf;
if ((used == MFC_BUF_RESET_USED) || (used == MFC_BUF_SET_USED))
mfc_buf->used = used;
- mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0][0]);
+ mfc_debug(2, "addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]);
list_del(&mfc_buf->list);
queue->count--;
mfc_buf = list_entry(queue->head.next, struct s5p_mfc_buf, list);
- mfc_debug(4, "First plane address: 0x%08llx\n", mfc_buf->addr[0][0]);
+ mfc_debug(2, "addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]);
if (dec->remained_size)
remained = dec->remained_size - consumed;
if ((used == MFC_BUF_RESET_USED) || (used == MFC_BUF_SET_USED))
mfc_buf->used = used;
- mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0][0]);
+ mfc_debug(2, "addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]);
list_del(&mfc_buf->list);
from_queue->count--;
mfc_buf = list_entry(from_queue->head.next, struct s5p_mfc_buf, list);
if (mfc_buf->used) {
- mfc_debug(2, "mfc_buf: 0x%p\n", mfc_buf);
- mfc_debug(2, "First plane address: 0x%08llx\n", mfc_buf->addr[0][0]);
+ mfc_debug(2, "addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]);
list_del(&mfc_buf->list);
from_queue->count--;
mfc_buf = list_entry(from_queue->head.next, struct s5p_mfc_buf, list);
if (mfc_buf->addr[0][0] == addr) {
- mfc_debug(2, "[DPB] First plane address: 0x%08llx\n", mfc_buf->addr[0][0]);
+ mfc_debug(2, "[DPB] addr[0]: 0x%08llx\n", mfc_buf->addr[0][0]);
list_del(&mfc_buf->list);
from_queue->count--;
return mfc_buf;
}
- mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
+ mfc_debug(4, "Looking for this address: 0x%08llx\n", addr);
mfc_buf = list_entry(queue->head.next, struct s5p_mfc_buf, list);
if (mfc_buf->num_valid_bufs > 0) {
for (i = 0; i < mfc_buf->num_valid_bufs; i++) {
mb_addr = mfc_buf->addr[i][0];
- mfc_debug(2, "batch buf[%d] plane[0] addr: 0x%08llx\n", i, mb_addr);
+ mfc_debug(4, "[BUFCON] batch[%d] addr[0]: 0x%08llx\n", i, mb_addr);
if (addr == mb_addr) {
spin_unlock_irqrestore(plock, flags);
return mfc_buf;
}
} else {
mb_addr = mfc_buf->addr[0][0];
- mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr);
+ mfc_debug(4, "addr[0]: 0x%08llx\n", mb_addr);
if (addr == mb_addr) {
spin_unlock_irqrestore(plock, flags);
spin_lock_irqsave(plock, flags);
- mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
+ mfc_debug(4, "Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &queue->head, list) {
if (mfc_buf->num_valid_bufs > 0) {
for (i = 0; i < mfc_buf->num_valid_bufs; i++) {
mb_addr = mfc_buf->addr[i][0];
- mfc_debug(2, "batch buf[%d] plane[0] addr: 0x%08llx\n", i, mb_addr);
+ mfc_debug(4, "[BUFCON] batch[%d] addr[0]: 0x%08llx\n", i, mb_addr);
if (addr == mb_addr) {
spin_unlock_irqrestore(plock, flags);
return mfc_buf;
}
} else {
mb_addr = mfc_buf->addr[0][0];
- mfc_debug(2, "plane[0] addr: 0x%08llx\n", mb_addr);
+ mfc_debug(4, "addr[0]: 0x%08llx\n", mb_addr);
if (addr == mb_addr) {
spin_unlock_irqrestore(plock, flags);
break;
} else {
mb_addr = mfc_buf->addr[0][0];
- mfc_debug(4, "plane[0] addr: 0x%08llx\n", mb_addr);
+ mfc_debug(4, "addr[0]: 0x%08llx\n", mb_addr);
if (addr == mb_addr) {
found = 1;
mfc_debug(4, "[DPB] Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &from_queue->head, list) {
mb_addr = mfc_buf->addr[0][0];
- mfc_debug(4, "[DPB] plane[0] addr: 0x%08llx\n", mb_addr);
+ mfc_debug(4, "[DPB] addr[0]: 0x%08llx\n", mb_addr);
if (addr == mb_addr) {
found = 1;
mfc_debug(4, "[DPB] Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &from_queue->head, list) {
mb_addr = mfc_buf->addr[0][0];
- mfc_debug(4, "[DPB] plane[0] addr: 0x%08llx, used: %d\n",
+ mfc_debug(4, "[DPB] addr[0]: 0x%08llx, used: %d\n",
mb_addr, mfc_buf->used);
if ((addr == mb_addr) && (mfc_buf->used == 1)) {
/* If it is not buffer batch mode, index is always zero */
if (src_mb->next_index > src_mb->done_index) {
- mfc_debug(2, "[NALQ] batch buf next index[%d] recover to %d\n",
+ mfc_debug(2, "[NALQ][BUFCON] batch buf next index[%d] recover to [%d]\n",
src_mb->next_index, src_mb->done_index);
src_mb->next_index = src_mb->done_index;
}
src_mb = list_entry(ctx->src_buf_queue.head.next, struct s5p_mfc_buf, list);
- mfc_debug(2, "mfc_buf: 0x%p\n", src_mb);
- mfc_debug(2, "First plane address: 0x%08llx\n", src_mb->addr[0][0]);
+ mfc_debug(4, "addr[0]: 0x%08llx\n", src_mb->addr[0][0]);
if (src_mb->vb.reserved2 & FLAG_LAST_FRAME) {
mfc_debug(2, "last frame!\n");
return 1;
}
- mfc_debug(2, "not last frame!\n");
+ mfc_debug(4, "not last frame!\n");
spin_unlock_irqrestore(&ctx->buf_queue_lock, flags);
mfc_debug_leave();
if (mfc_buf->num_valid_bufs > 0) {
for (i = 0; i < num_planes; i++) {
addr[i] = mfc_buf->addr[mfc_buf->next_index][i];
- mfc_debug(2, "[BUFINFO] ctx[%d] set src index:%d, batch[%d], addr[%d]: 0x%08llx\n",
+ mfc_debug(2, "[BUFCON][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++;