From: Ayoung Sim Date: Fri, 22 Jun 2018 05:43:01 +0000 (+0900) Subject: [COMMON] media: mfc: change the variable name X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0f9e29f310d7416e228c1a914acf85377b62b19e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] media: mfc: change the variable name 'num_bufs_in_vb' is mean the number of valid buffers. Change-Id: I5985cfdbc4d3a30a4fb60e0cec2bc66220d28dd5 Signed-off-by: Ayoung Sim --- diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h index bb736df3bd59..deee549e1a8b 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_data_struct.h @@ -213,7 +213,7 @@ struct s5p_mfc_buf { int done_index; int used; int num_bufs_in_batch; - int num_bufs_in_vb; + int num_valid_bufs; unsigned char *vir_addr; }; 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 63fd7f1ec97b..e4b72bda8a3c 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 @@ -234,7 +234,7 @@ static int s5p_mfc_enc_buf_prepare(struct vb2_buffer *vb) 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]); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index 860ba8e35373..4c7e141e01e7 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -797,7 +797,7 @@ static void mfc_handle_stream_input(struct s5p_mfc_ctx *ctx) 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++) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_mem.c b/drivers/media/platform/exynos/mfc/s5p_mfc_mem.c index 96de70099e3c..bbbe88a424bf 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_mem.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_mem.c @@ -195,7 +195,7 @@ void s5p_mfc_bufcon_put_daddr(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *mfc_b { 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]); @@ -263,8 +263,8 @@ int s5p_mfc_bufcon_get_daddr(struct s5p_mfc_ctx *ctx, struct s5p_mfc_buf *mfc_bu 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; 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 621434b6add2..530238e4f391 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -641,7 +641,7 @@ static int mfc_nal_q_run_in_buf_enc(struct s5p_mfc_ctx *ctx, EncoderInputStr *pI /* 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); @@ -949,7 +949,7 @@ static void mfc_nal_q_handle_stream_input(struct s5p_mfc_ctx *ctx, EncoderOutput 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++) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c b/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c index 31ed9ada52f9..81022ea350b2 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_opr.c @@ -259,9 +259,9 @@ int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) 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); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c b/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c index a4e4fda08e4a..cc8429a8ba73 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_queue.c @@ -280,8 +280,8 @@ struct s5p_mfc_buf *s5p_mfc_find_first_buf(spinlock_t *plock, struct s5p_mfc_buf 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) { @@ -315,8 +315,8 @@ struct s5p_mfc_buf *s5p_mfc_find_buf(spinlock_t *plock, struct s5p_mfc_buf_queue 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) { @@ -351,8 +351,8 @@ struct s5p_mfc_buf *s5p_mfc_find_del_buf(spinlock_t *plock, struct s5p_mfc_buf_q 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); diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c index 1cec5ff4f036..91452bfb14d3 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_reg.c @@ -339,7 +339,7 @@ void s5p_mfc_set_enc_frame_buffer(struct s5p_mfc_ctx *ctx, } 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",