'num_bufs_in_vb' is mean the number of valid buffers.
Change-Id: I5985cfdbc4d3a30a4fb60e0cec2bc66220d28dd5
Signed-off-by: Ayoung Sim <a.sim@samsung.com>
int done_index;
int used;
int num_bufs_in_batch;
- int num_bufs_in_vb;
+ int num_valid_bufs;
unsigned char *vir_addr;
};
goto err_mem_put;
}
- ctx->framerate = buf->num_bufs_in_vb * ENC_DEFAULT_CAM_CAPTURE_FPS;
+ ctx->framerate = buf->num_valid_bufs * ENC_DEFAULT_CAM_CAPTURE_FPS;
mfc_debug(3, "framerate: %ld\n", ctx->framerate);
dma_buf_put(bufcon_dmabuf[i]);
mfc_err_ctx("failed in recover_buf_ctrls_val\n");
/* single buffer || last image in a buffer container */
- if (!src_mb->num_bufs_in_vb || src_mb->done_index == src_mb->num_bufs_in_vb) {
+ if (!src_mb->num_valid_bufs || src_mb->done_index == src_mb->num_valid_bufs) {
src_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->src_buf_queue, enc_addr[0]);
for (i = 0; i < raw->num_planes; i++)
{
int i;
- for (i = 0; i < mfc_buf->num_bufs_in_vb; i++) {
+ 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",
i, plane, mfc_buf->addr[i][plane]);
j++;
}
- mfc_buf->num_bufs_in_vb = j;
- mfc_debug(3, "batch buffer has %d buffers\n", mfc_buf->num_bufs_in_vb);
+ mfc_buf->num_valid_bufs = j;
+ mfc_debug(3, "batch buffer has %d buffers\n", mfc_buf->num_valid_bufs);
return 0;
/* last image in a buffer container */
/* move src_queue -> src_queue_nal_q */
- if (src_mb->next_index == (src_mb->num_bufs_in_vb - 1)) {
+ if (src_mb->next_index == (src_mb->num_valid_bufs - 1)) {
src_mb = s5p_mfc_get_move_buf(&ctx->buf_queue_lock,
&ctx->src_buf_nal_queue, &ctx->src_buf_queue,
MFC_BUF_SET_USED, MFC_QUEUE_ADD_BOTTOM);
mfc_debug(4, "[NALQ] batch buf done_index: %d\n", src_mb->done_index);
/* last image in a buffer container */
- if (src_mb->done_index == src_mb->num_bufs_in_vb) {
+ if (src_mb->done_index == src_mb->num_valid_bufs) {
src_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock,
&ctx->src_buf_nal_queue, enc_addr[0]);
for (i = 0; i < raw->num_planes; i++)
return -EAGAIN;
}
- if (src_mb->num_bufs_in_vb > 0) {
+ if (src_mb->num_valid_bufs > 0) {
/* last image in a buffer container */
- if (src_mb->next_index == (src_mb->num_bufs_in_vb - 1))
+ if (src_mb->next_index == (src_mb->num_valid_bufs - 1))
last_frame = mfc_check_last_frame(ctx, src_mb);
} else {
last_frame = mfc_check_last_frame(ctx, src_mb);
mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
mfc_buf = list_entry(queue->head.next, struct s5p_mfc_buf, list);
- if (mfc_buf->num_bufs_in_vb > 0) {
- for (i = 0; i < mfc_buf->num_bufs_in_vb; i++) {
+ 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);
if (addr == mb_addr) {
mfc_debug(2, "Looking for this address: 0x%08llx\n", addr);
list_for_each_entry(mfc_buf, &queue->head, list) {
- if (mfc_buf->num_bufs_in_vb > 0) {
- for (i = 0; i < mfc_buf->num_bufs_in_vb; i++) {
+ 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);
if (addr == mb_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_bufs_in_vb > 0) {
- for (i = 0; i < mfc_buf->num_bufs_in_vb; i++) {
+ 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(4, "batch buf[%d] plane[0] addr: 0x%08llx\n", i, mb_addr);
}
index = mfc_buf->vb.vb2_buf.index;
- if (mfc_buf->num_bufs_in_vb > 0) {
+ 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",