From 562aa181d5c0d1f4de7ca8583102c921b75de7ed Mon Sep 17 00:00:00 2001 From: Sunyoung Kang Date: Tue, 3 Jul 2018 08:14:14 +0900 Subject: [PATCH] [COMMON] media: mfc: DRV4.0: clean up duplicate functions This removes mfc_move_first_buf_used() and replaces mfc_get_move_buf_used(). Change-Id: Ia704c8917cd6a1552dff6851e0904329c9b23aa8 Signed-off-by: Sunyoung Kang --- drivers/media/platform/exynos/mfc/mfc_isr.c | 4 +-- drivers/media/platform/exynos/mfc/mfc_queue.c | 30 ------------------- drivers/media/platform/exynos/mfc/mfc_queue.h | 2 -- 3 files changed, 2 insertions(+), 34 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/mfc_isr.c b/drivers/media/platform/exynos/mfc/mfc_isr.c index 22ba05c4aa9d..25d7dc69d9b0 100644 --- a/drivers/media/platform/exynos/mfc/mfc_isr.c +++ b/drivers/media/platform/exynos/mfc/mfc_isr.c @@ -849,8 +849,8 @@ static void __mfc_handle_stream_input(struct mfc_ctx *ctx) move_buf: /* move enqueued src buffer: src queue -> ref queue */ if (!found_in_src_queue && ctx->state != MFCINST_FINISHING) { - mfc_move_first_buf_used(&ctx->buf_queue_lock, - &ctx->ref_buf_queue, &ctx->src_buf_queue, MFC_QUEUE_ADD_BOTTOM); + mfc_get_move_buf_used(&ctx->buf_queue_lock, + &ctx->ref_buf_queue, &ctx->src_buf_queue); mfc_debug(2, "enc src_buf_queue(%d) -> ref_buf_queue(%d)\n", mfc_get_queue_count(&ctx->buf_queue_lock, &ctx->src_buf_queue), diff --git a/drivers/media/platform/exynos/mfc/mfc_queue.c b/drivers/media/platform/exynos/mfc/mfc_queue.c index e4ee0dad230d..2b07ba7f9d63 100644 --- a/drivers/media/platform/exynos/mfc/mfc_queue.c +++ b/drivers/media/platform/exynos/mfc/mfc_queue.c @@ -435,36 +435,6 @@ struct mfc_buf *mfc_find_move_buf_used(spinlock_t *plock, } } -void mfc_move_first_buf_used(spinlock_t *plock, struct mfc_buf_queue *to_queue, - struct mfc_buf_queue *from_queue, enum mfc_queue_top_type top) -{ - unsigned long flags; - struct mfc_buf *mfc_buf = NULL; - - spin_lock_irqsave(plock, flags); - - if (list_empty(&from_queue->head)) { - mfc_err_dev("from_queue is empty\n"); - spin_unlock_irqrestore(plock, flags); - return; - } - mfc_buf = list_entry(from_queue->head.next, struct mfc_buf, list); - - if (mfc_buf->used) { - list_del(&mfc_buf->list); - from_queue->count--; - - if (top == MFC_QUEUE_ADD_TOP) - list_add(&mfc_buf->list, &to_queue->head); - else - list_add_tail(&mfc_buf->list, &to_queue->head); - - to_queue->count++; - } - - spin_unlock_irqrestore(plock, flags); -} - void mfc_move_all_bufs(spinlock_t *plock, struct mfc_buf_queue *to_queue, struct mfc_buf_queue *from_queue, enum mfc_queue_top_type top) { diff --git a/drivers/media/platform/exynos/mfc/mfc_queue.h b/drivers/media/platform/exynos/mfc/mfc_queue.h index 392d0b38185e..42330f3d57ea 100644 --- a/drivers/media/platform/exynos/mfc/mfc_queue.h +++ b/drivers/media/platform/exynos/mfc/mfc_queue.h @@ -133,8 +133,6 @@ struct mfc_buf *mfc_find_move_buf_used(spinlock_t *plock, struct mfc_buf_queue *to_queue, struct mfc_buf_queue *from_queue, dma_addr_t addr); -void mfc_move_first_buf_used(spinlock_t *plock, struct mfc_buf_queue *to_queue, - struct mfc_buf_queue *from_queue, enum mfc_queue_top_type top); void mfc_move_all_bufs(spinlock_t *plock, struct mfc_buf_queue *to_queue, struct mfc_buf_queue *from_queue, enum mfc_queue_top_type top); -- 2.20.1