aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-04-24 12:07:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-25 08:38:48 -0400
commitf0c24fd81f704730c529dc69aa57f21c1ade5c4e (patch)
tree676d00d4ce196a6ce3807b0b2682f166cc6d18eb
parentcbd53542ca35842127c6f581fefbb0a7dd2b4a21 (diff)
[media] exynos4-is: Copy timestamps from M2M OUTPUT to CAPTURE buffer queue
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: [<c0016ef0>] (unwind_backtrace+0x0/0x13c) from [<c0029b3c>] (warn_slowpath_common+0x54/0x64) [<c0029b3c>] (warn_slowpath_common+0x54/0x64) from [<c0029b68>] (warn_slowpath_null+0x1c/0x24) [<c0029b68>] (warn_slowpath_null+0x1c/0x24) from [<c03b7018>] (vb2_queue_init+0xe0/0x18c) [<c03b7018>] (vb2_queue_init+0xe0/0x18c) from [<c03b4e08>] (v4l2_m2m_ctx_init+0xa0/0xc4) [<c03b4e08>] (v4l2_m2m_ctx_init+0xa0/0xc4) from [<c03ca6c4>] (fimc_m2m_open+0x130/0x1f8) [<c03ca6c4>] (fimc_m2m_open+0x130/0x1f8) from [<c03a5dd4>] (v4l2_open+0xac/0xe8) [<c03a5dd4>] (v4l2_open+0xac/0xe8) from [<c0113920>] (chrdev_open+0x9c/0x158) [<c0113920>] (chrdev_open+0x9c/0x158) from [<c010e488>] (do_dentry_open+0x1f8/0x280) [<c010e488>] (do_dentry_open+0x1f8/0x280) from [<c010e600>] (finish_open+0x34/0x50) [<c010e600>] (finish_open+0x34/0x50) from [<c011cc58>] (do_last+0x5bc/0xc00) [<c011cc58>] (do_last+0x5bc/0xc00) from [<c011d34c>] (path_openat+0xb0/0x484) [<c011d34c>] (path_openat+0xb0/0x484) from [<c011d824>] (do_filp_open+0x30/0x84) [<c011d824>] (do_filp_open+0x30/0x84) from [<c010e0f8>] (do_sys_open+0xe8/0x170) [<c010e0f8>] (do_sys_open+0xe8/0x170) from [<c000f040>] (ret_fast_syscall+0x0/0x30) Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/platform/exynos4-is/fimc-m2m.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-m2m.c b/drivers/media/platform/exynos4-is/fimc-m2m.c
index 275a9f8d9fdb..bde1f47f7ed3 100644
--- a/drivers/media/platform/exynos4-is/fimc-m2m.c
+++ b/drivers/media/platform/exynos4-is/fimc-m2m.c
@@ -99,7 +99,7 @@ static int stop_streaming(struct vb2_queue *q)
99 99
100static void fimc_device_run(void *priv) 100static void fimc_device_run(void *priv)
101{ 101{
102 struct vb2_buffer *vb = NULL; 102 struct vb2_buffer *src_vb, *dst_vb;
103 struct fimc_ctx *ctx = priv; 103 struct fimc_ctx *ctx = priv;
104 struct fimc_frame *sf, *df; 104 struct fimc_frame *sf, *df;
105 struct fimc_dev *fimc; 105 struct fimc_dev *fimc;
@@ -122,16 +122,18 @@ static void fimc_device_run(void *priv)
122 fimc_prepare_dma_offset(ctx, df); 122 fimc_prepare_dma_offset(ctx, df);
123 } 123 }
124 124
125 vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx); 125 src_vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx);
126 ret = fimc_prepare_addr(ctx, vb, sf, &sf->paddr); 126 ret = fimc_prepare_addr(ctx, src_vb, sf, &sf->paddr);
127 if (ret) 127 if (ret)
128 goto dma_unlock; 128 goto dma_unlock;
129 129
130 vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx); 130 dst_vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx);
131 ret = fimc_prepare_addr(ctx, vb, df, &df->paddr); 131 ret = fimc_prepare_addr(ctx, dst_vb, df, &df->paddr);
132 if (ret) 132 if (ret)
133 goto dma_unlock; 133 goto dma_unlock;
134 134
135 dst_vb->v4l2_buf.timestamp = src_vb->v4l2_buf.timestamp;
136
135 /* Reconfigure hardware if the context has changed. */ 137 /* Reconfigure hardware if the context has changed. */
136 if (fimc->m2m.ctx != ctx) { 138 if (fimc->m2m.ctx != ctx) {
137 ctx->state |= FIMC_PARAMS; 139 ctx->state |= FIMC_PARAMS;
@@ -620,6 +622,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
620 src_vq->ops = &fimc_qops; 622 src_vq->ops = &fimc_qops;
621 src_vq->mem_ops = &vb2_dma_contig_memops; 623 src_vq->mem_ops = &vb2_dma_contig_memops;
622 src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); 624 src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer);
625 src_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY;
623 626
624 ret = vb2_queue_init(src_vq); 627 ret = vb2_queue_init(src_vq);
625 if (ret) 628 if (ret)
@@ -631,6 +634,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
631 dst_vq->ops = &fimc_qops; 634 dst_vq->ops = &fimc_qops;
632 dst_vq->mem_ops = &vb2_dma_contig_memops; 635 dst_vq->mem_ops = &vb2_dma_contig_memops;
633 dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); 636 dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer);
637 dst_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY;
634 638
635 return vb2_queue_init(dst_vq); 639 return vb2_queue_init(dst_vq);
636} 640}