From d9183cd279fe352aa9d4400c48403ddb8ec8a10e Mon Sep 17 00:00:00 2001 From: memeka Date: Mon, 20 Mar 2017 16:22:12 +1030 Subject: [PATCH] s5p-mfc: Copy timestamp and timecode in encoder --- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index 2eea21f06d7e..5747dc453f10 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -850,6 +850,7 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) { struct s5p_mfc_dev *dev = ctx->dev; struct s5p_mfc_buf *mb_entry; + struct s5p_mfc_buf *dst_buf; unsigned long enc_y_addr, enc_c_addr; unsigned long mb_y_addr, mb_c_addr; int slice_type; @@ -869,8 +870,14 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) &mb_entry->b->vb2_buf, 0); mb_c_addr = vb2_dma_contig_plane_dma_addr( &mb_entry->b->vb2_buf, 1); + dst_buf = list_entry(ctx->dst_queue.next, + struct s5p_mfc_buf, list); if ((enc_y_addr == mb_y_addr) && (enc_c_addr == mb_c_addr)) { + dst_buf->b->timecode = + mb_entry->b->timecode; + dst_buf->b->vb2_buf.timestamp = + mb_entry->b->vb2_buf.timestamp; list_del(&mb_entry->list); ctx->src_queue_cnt--; vb2_buffer_done(&mb_entry->b->vb2_buf, @@ -883,8 +890,14 @@ static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) &mb_entry->b->vb2_buf, 0); mb_c_addr = vb2_dma_contig_plane_dma_addr( &mb_entry->b->vb2_buf, 1); + dst_buf = list_entry(ctx->dst_queue.next, + struct s5p_mfc_buf, list); if ((enc_y_addr == mb_y_addr) && (enc_c_addr == mb_c_addr)) { + dst_buf->b->timecode = + mb_entry->b->timecode; + dst_buf->b->vb2_buf.timestamp = + mb_entry->b->vb2_buf.timestamp; list_del(&mb_entry->list); ctx->ref_queue_cnt--; vb2_buffer_done(&mb_entry->b->vb2_buf,