From patchwork Thu Mar 7 13:47:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2232211 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5548DDF223 for ; Thu, 7 Mar 2013 13:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753481Ab3CGNrq (ORCPT ); Thu, 7 Mar 2013 08:47:46 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:61818 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753397Ab3CGNrp (ORCPT ); Thu, 7 Mar 2013 08:47:45 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJA00HZQMBG2D90@mailout1.samsung.com> for linux-media@vger.kernel.org; Thu, 07 Mar 2013 22:47:44 +0900 (KST) X-AuditID: cbfee61a-b7f7d6d000000f4e-d8-51389a7fe330 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 07.FD.03918.F7A98315; Thu, 07 Mar 2013 22:47:43 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJA00M98MB8HU30@mmp2.samsung.com>; Thu, 07 Mar 2013 22:47:43 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: Sylwester Nawrocki , Kyungmin Park Subject: [PATCH] s5p-fimc: Copy timestamps from M2M OUTPUT to CAPTURE buffer queue Date: Thu, 07 Mar 2013 14:47:26 +0100 Message-id: <1362664046-15246-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOJMWRmVeSWpSXmKPExsVy+t9jQd36WRaBBncfWVucbXrDbtGzYSur xeE37awOzB59W1YxenzeJBfAFMVlk5Kak1mWWqRvl8CVcXXbG/aCbTIVvUc6mBoYX0p0MXJy SAiYSCxctoURwhaTuHBvPVsXIxeHkMB0Rol1TZuhnA4miSuHrjGBVLEJGEr0Hu0D6xARkJd4 0nuDDcRmFoiR+PbzElhcWCBE4syRqUD1HBwsAqoS0w6xg4R5BdwkGrpa2EHCEgIKEnMm2Uxg 5F7AyLCKUTS1ILmgOCk911CvODG3uDQvXS85P3cTI9i7z6R2MK5ssDjEKMDBqMTDy5FvHijE mlhWXJl7iFGCg1lJhDe9zSJQiDclsbIqtSg/vqg0J7X4EKM0B4uSOC/jqScBQgLpiSWp2amp BalFMFkmDk6pBsaCDd82sEp/UZl0wykhI9MpLd2mWbFzob7Rvp4HwT1rDFPXv7IqvMer/HfH tIm8GjN+bWLW2nTNh1f2VIcNy0RRe7cVS59XGrrceljQ7GaQGr/f4bD/y3/FbRqPFrqw+fUc YLMWqtl1VIznzYfyTrl4tn8/zn/yLji2ObRHncvlrfOdPoUVYUosxRmJhlrMRcWJAJCelavq AQAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- drivers/media/platform/s5p-fimc/fimc-m2m.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/fimc-m2m.c b/drivers/media/platform/s5p-fimc/fimc-m2m.c index f3d535c..2de56d3 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; @@ -623,6 +625,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, src_vq->ops = &fimc_qops; src_vq->mem_ops = &vb2_dma_contig_memops; src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); + src_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY; ret = vb2_queue_init(src_vq); if (ret) @@ -634,6 +637,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->ops = &fimc_qops; dst_vq->mem_ops = &vb2_dma_contig_memops; dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); + dst_vq->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY; return vb2_queue_init(dst_vq); }