From patchwork Fri Mar 11 07:06:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12777506 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30362C433EF for ; Fri, 11 Mar 2022 07:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hy3gdX69IjehV1vUs9JKqTVqiZgzB34h1Wa6b5WvXf8=; b=AYlviPB2KzIBcp LpjRHBzVU6jKYKgCQb7JbT8M4kruo3eMfLAl8KVtCGs3yRX3SpkEvi78ZTGbCaxsRm2Vjrkja90Fm FCkHfJA2+xijVDYNHIXFP7i7+RpjowGvvnZ3LcqQL28D6aOHU41cb1f1OOyFyV7rkMLdVP618PHbS DErhAT6dAG4vuuxRoVR9HHrZq36ti5HTeClQkYaehNTzCYwT58pAtRVQ38FzYEAIPwzEJymkpFLIA X2yM7xLNqQdHz85Qf0XqCVzoYY7Jy0Ut20Gta8Vh8l0mDB06wuLDD/jUUT+0MCuWAr6mi4nTX/5xc py+kXFTHRelDCsmOBjSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSZNN-00FJa7-Rk; Fri, 11 Mar 2022 07:07:50 +0000 Received: from mail-ve1eur03on0610.outbound.protection.outlook.com ([2a01:111:f400:fe09::610] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSZNK-00FJYw-8V for linux-arm-kernel@lists.infradead.org; Fri, 11 Mar 2022 07:07:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TuALtsidQL6Zd7Q6r/rza3MoqFe8o3AvKmmOtcSo87gBGs8DjU/WwUN1NXoCAxR7fAk04RQK+eL+7jX79VWl7Xb0ztcbIeQVtnhmrTREPjkqsYsqhUMiiQCEIKF+qt/dWIrrI6XTN5eCZ/8T1OaGSDYVXoHcdRD9zje1eFiwAJI0u5Rc1WJIayPqZl9LpWoBYm8MSZXPwtpHVzSCKYPI5zJ9Zcczei2z6MkImKPsCBeOLNTNPZTj+EOvdAwax5dv0fRnC3i8waiVfGIGtpag0I7THi7WCOfZOFDINGnPwQX9it430wVmxrEctSHenF/MfyCJFEStsmyut8awBbnbRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Rrme8dXP4rIUOKfz4VPsohcClE78DN0xpfspCkrVgys=; b=ipGc51GcLH9gQY5s8GdtYDO2kCsYk7UjOUS5bBK0xpTQn2FG30u3wtTdYCBOxnKpVsA9V4pyM3+AmyeMmqfH4z3h8EQGbJVJkJ16VjkCRxW3v2LulfSaLSRKTFLswRvq3Vzcreo2hunI7cbPObr5lEPsi2auht0qKC4UJTfHMCFD2fHQh3+WY5K4nh38xbMbdK2MNf2faLIZfV88LOJNng4MfHaQWOIoFH6xdLz7sDnDa7KYNS2eSNBkTgY05q+xdvnn5g4aQftt3Z7QxuuzEqKEUKKsCvqHhJwRwhc9h8VepKd+i9I/pZsiJ/QGNKgC3tC4+VyyZcO0GzTkdBdxNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rrme8dXP4rIUOKfz4VPsohcClE78DN0xpfspCkrVgys=; b=Z9+VKt97SHbmTM3cyhw3t9q8G7yZB2TPLp2dfNyv8oK5d9dNhOm30DlCdVx6oz7ord00yW9Cyrke0ac7jnKDL7eQrRXg19Pdu2JxKcUwjMjfHln9vphxIEkZT3yvBh9n3iDTjDnO9kiPZRWuticrUhnaeKIdjIsY+GCi/4PlMcI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by DB8PR04MB6714.eurprd04.prod.outlook.com (2603:10a6:10:10e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Fri, 11 Mar 2022 07:07:40 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::c39:69cf:c4ea:967]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::c39:69cf:c4ea:967%5]) with mapi id 15.20.5061.022; Fri, 11 Mar 2022 07:07:40 +0000 From: Ming Qian To: mchehab@kernel.org, shawnguo@kernel.org Cc: hverkuil-cisco@xs4all.nl, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, aisheng.dong@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/2] media: amphion: copy timestamp from output to capture Date: Fri, 11 Mar 2022 15:06:49 +0800 Message-Id: X-Mailer: git-send-email 2.33.0 X-ClientProxiedBy: SI2PR02CA0023.apcprd02.prod.outlook.com (2603:1096:4:195::11) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f16090a5-1480-45a7-a19c-08da032dd44a X-MS-TrafficTypeDiagnostic: DB8PR04MB6714:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SkBlMhgm2Z0kFz/K0dCY6V4wdh3Ke1jLi/LJ4qmMYUWZy7rR01R/1qDoJ8HAkpNPeKOUfU4cs7z727dOyNrJHcBGkVoCGz9eiiIDzDE8AlwWhqvmJbh9uGAGPT4sPvQP6NPcawGtSzx+izqIUQ8h9fgvU+Kb+E59U5vea0k0kN/E37146zYC1wvMciT1xBz2a/A1Xn4fXh5sBdWUbiW4mIYDR6OihVd0nbZeNBtO1vuy869atv/TMwmOk97Il0mt0nsCQcKxvvapqEoaUQKhXnXHsVkT3AR13ltYMnofDVIMwIt4kbGsmOY35WDBV/1I8qksA+2VOyAi4wghZVwHv8NWBVKMHkuTg6oGvqPXK56yKBcyZ/JBrV1IKulXDrKG2+F0cATyDlV979CuEwgAqU9aSjnBeHPmJIp3lQH5JfTTL92XgLoC2/yPWDCPzJb4xkzpq7iOigaxMSzCi7QIadLTdRQpPL0R1x69FqBQJXQS4yCLfWG6vSdF6IeBxGwsJ0oNN8pyxkqCqXxY+yDyYY1Fs3Ej13JVUncZ05wu1KTT51pVTUXKwgZv0aD26WIgmDaZMCVKNk4/wVtGrcCBOW3CozVAQGOZ+jU+nF++Zca5g9qOAcm9Ugcdwz2WQ8Ch7QBf5JHqEIx0kzg96+pYiEVmkMarrOCaHwn0F8uvo7D/nDAVrfwUiWUIIb57RM2vtqdXEHd9X2mRkm2BhW/jaw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB6341.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8676002)(83380400001)(4326008)(66556008)(66946007)(5660300002)(66476007)(44832011)(8936002)(2906002)(316002)(36756003)(7416002)(52116002)(6506007)(6512007)(6486002)(2616005)(26005)(508600001)(186003)(86362001)(38350700002)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GhdC/MqJeQfMaDjTZvgRJFL06NNLF/uYu7WCbdy+chj4eCOa+2Bp9xa6oBIg7MyWIZ2AmV+aRWRjbd7hgDVbzANWGK/zpgzR7FD6dATxyCRHbWi4ctahmKdlGTBxzUQlkYZo1RXWXgVxHnEK5/H9kpkMo/xbQndEWT2rF5kGxJ8EiWEspLl14WvdLytccnAZVQwQo5vKe3+KcBjSyuhfcTmC8l6BUHsegumi40kzxP1QxAaMyl1UriX736+lCVrTpCUYX7AJlN1Htfw2DfLrXve+SZODIY3oV4vy8k7KLB0AT69s9Oo7882kNFURk+t8FiPCOOYsgArtHtOeuxy5t/xsj8DE0vj5/qpi7N2Ru5zIwWA3d1rsijVIsVid28sBUtMAOTVnUAr0P6e4r+nhkt2fb4AdwjuDST74QgQ5nx98q6h1RwGv7ROzO7d5MhWABISVwRMhHE39HWchj6f5ElNuI15ioJjHUv41KECRzi/dJ0bdP1QMIAK3applRDFNSQnNVvnRzQdRAWz6MpK1QjlOHt6kUyk0S088flnRqN7qXBVhYWOfat5Tlr36izZg6pFIYoE0k+llpc3I+ggYfqQjmWijJ1GDvbrXTjr07YMz1CZo/Fz2lGBEF88pc3wZjHGe4NDrpAxS8h0m4GoM8Uflyv3xMperpe5x2yQ3KXsaDRlMJckfcv8JaUKcIEvKFckgKPhB0+gxxsVZChL0b74/xLJDqzqM1GaV9QAkx7EHhbj568E7ilQFxYUu7w24KhLQS5jiZj+R18eJSip5WSK2zgj6UwyFOi7Rx0GcpTrD0kUHyPz3PDNplyo9VVOf+EQO+jEhORg63PcIYNEMb6m5mGOupJuXoqM8PMjAqqYR5YEHbLGt+cQZZ/3qoxwSDxB2AUqfjAHm1vjx68kGktzhmM3+cAdkzdtiSp1D9iJ+IhnU5PVh1HSkRHwyTjKjnetSY3i9MCAvBWTonV0g3MuQmHluyL2IeHxPY51W6qdSiI6gQVBHYQyKJi32xR+QNnkKwOko26WOEYp8zUh4ItZTVyhmPvIe4uS6aillMCzb1DR8GGKddY9+sralw7Cn09NygcNSAhr8wCzgf8GVtU+UCdc6GtM0j8JHKxatA6srlomVwovnuYYV4g1Dr8FpuJHtSaPcSJg/0qBNfOz3t/6G4QspxKSoCJCJbA1CGGjApfhKyz029wXkOMYkzzE3vjjf35oQ6yhStpxBTDwQygya7DW5KfsKQU8G1Qfo12h8+wm+jbOrUjNI+o4MzECUvIoqCGdce5LZa59OfdjnTXHKstjfekDV9mNxKRp3Dv+Dd5KaD8LBF/ecohh4BWQ6F/RSNrohehFjIYBu1XhIW0WZsSNyhsL3A91wEzYE/ULNbWxuaFK0ka3tJ2F++2V29ohTNFluoj2iIPyLlIqqm3t+kmTc1/54KYASYP2PXMwvcjf1gpblm75QCM2AIdzu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f16090a5-1480-45a7-a19c-08da032dd44a X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Mar 2022 07:07:39.9700 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: drWXrCs1IV+NTpeM1Aficx+bEzgeA4/22FBNcJ0zm6gs+mFrydfvcQMwcACz2IJDuy5e3eEEvMFXYWpcCbSY+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB6714 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220310_230746_380373_B1C0804A X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is a timestamp manager in firmware, so in previous, driver will pass the timestamp to firmware, and when a frame is decoded or encoded, firmware will pass the timestamp to driver, then driver set the timestamp to the capture vb2_buffer. But there is problem that the timestamp manager will ensure that the timestamps are monotonically increasing. So if there are reorder frames, the capture buffer's timestamp is inconsistent with the timestamp of the corresponding output buffer. It goes against the description of V4L2_BUF_FLAG_TIMESTAMP_COPY in the specification In order to comply with the specification, driver should copy timestamp from output buffer to capture buffer, and there is an helper function v4l2_m2m_buf_copy_metadata to handle it. Ming Qian (2): media: amphion: decoder copy timestamp from output to capture media: amphion: encoder copy timestamp from output to capture drivers/media/platform/amphion/vdec.c | 89 ++++++++++------------- drivers/media/platform/amphion/venc.c | 47 ++++-------- drivers/media/platform/amphion/vpu_v4l2.c | 13 ++++ drivers/media/platform/amphion/vpu_v4l2.h | 1 + 4 files changed, 70 insertions(+), 80 deletions(-)