From e8d82bef8d0b473fedfce7fd14cd76b3b9d53f41 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Mon, 7 Apr 2014 10:55:20 +0200 Subject: [PATCH] [media] exynos4-is: Copy timestamps from M2M OUTPUT to CAPTURE buffer queue Backport of linux f0c24fd81f704730c529dc69aa57f21c1ade5c4e. The timestamp_type field was introduce in later kernels, so not set in this backport. original ommit message: Add copying of buffer timestamps and set the timestamp_type to V4L2_BUF_FLAG_TIMESTAMP_COPY to avoid warnings about UNDEFINED timestamp type like: WARNING: at drivers/media/v4l2-core/videobuf2-core.c:2042 vb2_queue_init+0xe0/0x18c() Modules linked in: [] (unwind_backtrace+0x0/0x13c) from [] (warn_slowpath_common+0x54/0x64) [] (warn_slowpath_common+0x54/0x64) from [] (warn_slowpath_null+0x1c/0x24) [] (warn_slowpath_null+0x1c/0x24) from [] (vb2_queue_init+0xe0/0x18c) [] (vb2_queue_init+0xe0/0x18c) from [] (v4l2_m2m_ctx_init+0xa0/0xc4) [] (v4l2_m2m_ctx_init+0xa0/0xc4) from [] (fimc_m2m_open+0x130/0x1f8) [] (fimc_m2m_open+0x130/0x1f8) from [] (v4l2_open+0xac/0xe8) [] (v4l2_open+0xac/0xe8) from [] (chrdev_open+0x9c/0x158) [] (chrdev_open+0x9c/0x158) from [] (do_dentry_open+0x1f8/0x280) [] (do_dentry_open+0x1f8/0x280) from [] (finish_open+0x34/0x50) [] (finish_open+0x34/0x50) from [] (do_last+0x5bc/0xc00) [] (do_last+0x5bc/0xc00) from [] (path_openat+0xb0/0x484) [] (path_openat+0xb0/0x484) from [] (do_filp_open+0x30/0x84) [] (do_filp_open+0x30/0x84) from [] (do_sys_open+0xe8/0x170) [] (do_sys_open+0xe8/0x170) from [] (ret_fast_syscall+0x0/0x30) Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/s5p-fimc/fimc-m2m.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/fimc-m2m.c b/drivers/media/platform/s5p-fimc/fimc-m2m.c index a39eda38420063..22d723a1432370 100644 --- a/drivers/media/platform/s5p-fimc/fimc-m2m.c +++ b/drivers/media/platform/s5p-fimc/fimc-m2m.c @@ -100,7 +100,7 @@ static int stop_streaming(struct vb2_queue *q) static void fimc_device_run(void *priv) { - struct vb2_buffer *vb = NULL; + struct vb2_buffer *src_vb, *dst_vb; struct fimc_ctx *ctx = priv; struct fimc_frame *sf, *df; struct fimc_dev *fimc; @@ -123,16 +123,18 @@ static void fimc_device_run(void *priv) fimc_prepare_dma_offset(ctx, df); } - vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx); - ret = fimc_prepare_addr(ctx, vb, sf, &sf->paddr); + src_vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx); + ret = fimc_prepare_addr(ctx, src_vb, sf, &sf->paddr); if (ret) goto dma_unlock; - vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx); - ret = fimc_prepare_addr(ctx, vb, df, &df->paddr); + dst_vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx); + ret = fimc_prepare_addr(ctx, dst_vb, df, &df->paddr); if (ret) goto dma_unlock; + dst_vb->v4l2_buf.timestamp = src_vb->v4l2_buf.timestamp; + /* Reconfigure hardware if the context has changed. */ if (fimc->m2m.ctx != ctx) { ctx->state |= FIMC_PARAMS;