From patchwork Thu Nov 22 05:25:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaik Ameer Basha X-Patchwork-Id: 1785861 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DC2EC3FC23 for ; Thu, 22 Nov 2012 19:13:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752755Ab2KVTNJ (ORCPT ); Thu, 22 Nov 2012 14:13:09 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:27211 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755839Ab2KVTNH (ORCPT ); Thu, 22 Nov 2012 14:13:07 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDV003NIHZ6FJ40@mailout4.samsung.com> for linux-media@vger.kernel.org; Thu, 22 Nov 2012 14:02:28 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id AC.6C.12699.4E1BDA05; Thu, 22 Nov 2012 14:02:28 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-7f-50adb1e4143f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4C.6C.12699.4E1BDA05; Thu, 22 Nov 2012 14:02:28 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MDV00KHRHYSU450@mmp2.samsung.com> for linux-media@vger.kernel.org; Thu, 22 Nov 2012 14:02:28 +0900 (KST) From: Shaik Ameer Basha To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, kgene.kim@samsung.com Subject: [PATCH v2] [media] exynos-gsc: propagate timestamps from src to dst buffers Date: Thu, 22 Nov 2012 10:55:06 +0530 Message-id: <1353561906-7869-1-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.7.0.4 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsWyRsSkWvfJxrUBBvcaZCx6NmxldWD0+LxJ LoAxissmJTUnsyy1SN8ugStj6tQ9TAXz+Cp29U5kbGD8yt3FyMkhIWAisW7vKRYIW0ziwr31 bF2MXBxCAksZJc7svsYGU9Tz9joLRGI6o8SjafuYIJzlTBKTjm0Bq2ITMJTYfu8KK4gtIiAv 8aT3BlicGSi+58RBMFtYIExi0tn5jCA2i4CqxNkX15lAbF4BN4nXc16yQmxTkGhddogdokZA 4tvkQ0CbOYDishKbDjCD7JUQ2MEm8WvKD2aIekmJgytusExgFFzAyLCKUTS1ILmgOCk910iv ODG3uDQvXS85P3cTIzCoTv97Jr2DcVWDxSFGAQ5GJR7eDIO1AUKsiWXFlbmHGCU4mJVEeBcV AIV4UxIrq1KL8uOLSnNSiw8x+gBdMpFZSjQ5HxjweSXxhsYm5qbGppZGRmampjiElcR5mz1S AoQE0hNLUrNTUwtSi2DGMXFwSjUwirOLnRD9L8W02eZdw5HrJqtmX9lv+5fjQFqN8N321wV/ i5f5zLTQYmooKEr87hNQ++7Pyy538d2qy+tNDleer9aY8VTb0aD40f/P13ZM19zfnXLklGj/ u7OP5vy9sd8vepH6s9kbHzT+/CU9Q/DqmivCm44K5OybXxRZ5BD+dHGlU137+gu7lJRYijMS DbWYi4oTAbNBWr5XAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMLMWRmVeSWpSXmKPExsVy+t9jQd0nG9cGGDxtEbTo2bCV1YHR4/Mm uQDGqAZGm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zByg qUoKZYk5pUChgMTiYiV9O0wTQkPcdC1gGiN0fUOC4HqMDNBAwhrGjKlT9zAVzOOr2NU7kbGB 8St3FyMnh4SAiUTP2+ssELaYxIV769m6GLk4hASmM0o8mraPCcJZziQx6dgWNpAqNgFDie33 rrCC2CIC8hJPem+AxZmB4ntOHASzhQXCJCadnc8IYrMIqEqcfXGdCcTmFXCTeD3nJSvENgWJ 1mWH2Ccwci9gZFjFKJpakFxQnJSea6RXnJhbXJqXrpecn7uJERyyz6R3MK5qsDjEKMDBqMTD m2GwNkCINbGsuDL3EKMEB7OSCO+iAqAQb0piZVVqUX58UWlOavEhRh+g7ROZpUST84HxlFcS b2hsYm5qbGppYmFiZolDWEmct9kjJUBIID2xJDU7NbUgtQhmHBMHp1QDo+xDsWiJqaEcu52y cplX7b/ZqKojrFr+do5K5Mqbskqf7q0+vXpfqg9z9O48QbPF57TmHtzLrD5B1dJy1e9l4f9+ b+G69m7a5ee39s4JqueUYdjOq3fFNPHt2kstNQ8ztbSnfLLLm9l1TuaZ1cI5xWaTZZVD/Up4 du14KvH17AeVVw2Tyma9eqfEUpyRaKjFXFScCADDD67RhgIAAA== X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Make gsc-m2m propagate the timestamp field from source to destination buffers Signed-off-by: John Sheu Signed-off-by: Shaik Ameer Basha --- drivers/media/platform/exynos-gsc/gsc-m2m.c | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c index 047f0f0..39dff20 100644 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c @@ -99,22 +99,28 @@ static void gsc_m2m_job_abort(void *priv) gsc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR); } -static int gsc_fill_addr(struct gsc_ctx *ctx) +static int gsc_get_bufs(struct gsc_ctx *ctx) { struct gsc_frame *s_frame, *d_frame; - struct vb2_buffer *vb = NULL; + struct vb2_buffer *src_vb, *dst_vb; int ret; s_frame = &ctx->s_frame; d_frame = &ctx->d_frame; - vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx); - ret = gsc_prepare_addr(ctx, vb, s_frame, &s_frame->addr); + src_vb = v4l2_m2m_next_src_buf(ctx->m2m_ctx); + ret = gsc_prepare_addr(ctx, src_vb, s_frame, &s_frame->addr); + if (ret) + return ret; + + dst_vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx); + ret = gsc_prepare_addr(ctx, dst_vb, d_frame, &d_frame->addr); if (ret) return ret; - vb = v4l2_m2m_next_dst_buf(ctx->m2m_ctx); - return gsc_prepare_addr(ctx, vb, d_frame, &d_frame->addr); + dst_vb->v4l2_buf.timestamp = src_vb->v4l2_buf.timestamp; + + return 0; } static void gsc_m2m_device_run(void *priv) @@ -148,7 +154,7 @@ static void gsc_m2m_device_run(void *priv) goto put_device; } - ret = gsc_fill_addr(ctx); + ret = gsc_get_bufs(ctx); if (ret) { pr_err("Wrong address"); goto put_device;