From e09d8c1934669e96d961d1faee15e812d3990370 Mon Sep 17 00:00:00 2001 From: Ayoung Sim Date: Fri, 22 Jun 2018 13:44:58 +0900 Subject: [PATCH] [COMMON] media: mfc: done_index is increased after timestamp is copied Change-Id: I5c6c8b7564864bfc6bcbeaf1cceb5d4d62de388d Signed-off-by: Ayoung Sim --- drivers/media/platform/exynos/mfc/s5p_mfc_irq.c | 4 ++-- drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c index dba7417f2c5e..860ba8e35373 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_irq.c @@ -785,6 +785,8 @@ static void mfc_handle_stream_input(struct s5p_mfc_ctx *ctx) &ctx->src_buf_queue, enc_addr[0]); if (src_mb) { found_in_src_queue = 1; + + 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); @@ -794,8 +796,6 @@ static void mfc_handle_stream_input(struct s5p_mfc_ctx *ctx) &ctx->src_ctrls[index]) < 0) mfc_err_ctx("failed in recover_buf_ctrls_val\n"); - mfc_handle_stream_copy_timestamp(ctx, src_mb); - /* 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) { src_mb = s5p_mfc_find_del_buf(&ctx->buf_queue_lock, 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 a4fd952aecfc..621434b6add2 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_nal_q.c @@ -934,19 +934,19 @@ static void mfc_nal_q_handle_stream_input(struct s5p_mfc_ctx *ctx, EncoderOutput &ctx->src_buf_queue, enc_addr[0]); if (src_mb) { found_in_src_queue = 1; - src_mb->done_index++; - mfc_debug(4, "[NALQ] batch buf done_index: %d\n", src_mb->done_index); 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); } else { src_mb = s5p_mfc_find_first_buf(&ctx->buf_queue_lock, &ctx->src_buf_nal_queue, enc_addr[0]); if (src_mb) { found_in_src_queue = 1; - src_mb->done_index++; - mfc_debug(4, "[NALQ] batch buf done_index: %d\n", src_mb->done_index); 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); /* last image in a buffer container */ if (src_mb->done_index == src_mb->num_bufs_in_vb) { -- 2.20.1