From patchwork Tue Sep 7 09:49:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12478113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95FDDC433EF for ; Tue, 7 Sep 2021 09:53:52 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 62407610F8 for ; Tue, 7 Sep 2021 09:53:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 62407610F8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=qQUCGcSw8N7rUhPvo72xB+2+LvgXMXvzA1hdDlTeuuw=; b=n+Ix2JVgoEnGow luV30X2tGgcun+cZ4eRAqAJYbSYt3Tk0bHG+n/sRSxJtfLWl5tWr0IyQRpU8NqHiZeYKDwCxSzurV 7NQ3RqnKiQpb5gjFNhjqhGdj8cKGy6zip8H9YnsJw9JpIgHcg16AmqISYzR/5gWWLptwWunxNTfPL BYrXWg6tUFn7xRXZQdmwtFJ3AJ/W/Zqmg3J0kPsa8Jq++YSUvBkdfHL2ikY6x1cmTB7+/XuMB1G5S qSU/f69FKL7sudESihbHa2jYV1vbKO03AlbsCSPI7xKik8f7+s51eCDvOG/5bMpzbTyA/DF9RiKi6 JQ7GXymxSxUIsufvMH5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNXka-003AsS-Ea; Tue, 07 Sep 2021 09:50:45 +0000 Received: from mail-eopbgr30086.outbound.protection.outlook.com ([40.107.3.86] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mNXk4-003Ai9-5x for linux-arm-kernel@lists.infradead.org; Tue, 07 Sep 2021 09:50:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FLLtZNq/j6hR1+CtabLZ5z2VOQnAuCZ9Pue5PYMJbHXIiMdPURyZyBibxWyeUUCoh9nHobbNfxpUCBGDY8xaUMHJLeKY33K3/mIOxNW3ACyHtadEhpsHdTC4d7ugn/23xfPp0Gvm1/XmJn3iMVzmENBpe08Yr7d1DWazW2Q6D3TLVgq+dLfHepPA8FjpxwiqUvUqvWhhP6D5O75t1gLCz1AOcH5ZjQgc6x7G0NqOWDKSzTLJVJrWA9RVJsctgvMLG2PspKZu0sf+yiuOuwC/v4WeU/KqNLZ1Zv6ETVui140HpFjZprpCB8La32hjIATbS71ydtKd83g3ggKg7Jed5Q== 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; bh=nuGAhvg+ZR0HNx8MmJlLyP+rZrtnojGtIfP4DZRJkyo=; b=npj35V3hqsgpJUNEoWk+6bu4QSezEvGK7WEJ4SGjolXG3K14N58wIKwXVepKvDqNQojTwe1iAHRtUCTIDWmQzE479d7RCvzNEPvEO5eJSDP3c8T7S9EbfzlsOoC1CraqLdVEE9cfNdLfLZ2r6/t3ubYRUJiSP2TOCAos/wwlLMndBNajAKWWrZNm3bxloAV/zUF9e11s6czvstyMuVS47RUzEYiouYEQdUWNjYmFOBs3FIvsviJajJgwosbQaXmxhHn0LkL2RSS4DOyWdAD2FKVnFkvVzEvnF9kKff9C8rrXIlAfvFOaZ56H6tc4AwPPcHspoB7Nz2R6cAXFgZoJFQ== 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=nuGAhvg+ZR0HNx8MmJlLyP+rZrtnojGtIfP4DZRJkyo=; b=EJl9wzT8zmny3h+G0ce7v0mBggB2qwtFG0/5xx+zNBa1cMTIEvT0sT8YMu/sW8tc9QmsIG7nWBy4cSyELtWd0X1jqaJ6FUhw/Z56PVAx88KveOhSyGAYJwZW1V33diQh3mVo0JckcFg0wfNRqIs1rWWP0muav5cPOB6IwlUZXyU= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AS8PR04MB7767.eurprd04.prod.outlook.com (2603:10a6:20b:288::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Tue, 7 Sep 2021 09:50:05 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::998c:7f25:6d75:d5f4]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::998c:7f25:6d75:d5f4%7]) with mapi id 15.20.4478.025; Tue, 7 Sep 2021 09:50:00 +0000 From: Ming Qian To: mchehab@kernel.org, shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de Cc: hverkuil-cisco@xs4all.nl, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, aisheng.dong@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v8 03/15] media:Add v4l2 buf flag codec data. Date: Tue, 7 Sep 2021 17:49:10 +0800 Message-Id: <7ef1840137417c33f5ef7ca611c90fc274926851.1631002447.git.ming.qian@nxp.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0097.apcprd02.prod.outlook.com (2603:1096:4:92::13) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv11149.swis.cn-sha01.nxp.com (119.31.174.70) by SG2PR02CA0097.apcprd02.prod.outlook.com (2603:1096:4:92::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19 via Frontend Transport; Tue, 7 Sep 2021 09:49:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 545d7e14-64ff-4ad2-944a-08d971e4db9b X-MS-TrafficTypeDiagnostic: AS8PR04MB7767: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VYvssJcrppMKv7YR6ci8IOn2X9qVmIIyUBRxnKPLOoW2VOVacvLdMycUD6ToLfPl1YkW1Q9i/rIk54/7tJ6o3/1iHCI8meLjIv7dZ/+OiduRrQr420zHxwsl5ozbr52TR8S0LG0npwJWDFgsdfo3yxxD+Rmw6l92ucP1A26M97f7WeUQWyZt6R2gZEuCqIiWro2nH61hMERZXxIJlyv6of2Te1+eauvKwPgh+iCIzjIszRqPhPj80W9TWvXzY4/d9dCHdx7Of0aSj6prjLt87zim3zYdSxWLeXB79tdQScmtuTz6YRjnsKF+WjOzLq8zL72tJ6ZaYMB9x1dlWzgrN3CfkKf9llSAk1hMQNO+JBC9MMvIYG+LBj7aGigVTk+BiRfrLuLD0OKw4YpGncSYNuNHLbC/lT1T/hAuzN/TNkHHhwoCQpwToSypctWhKQLGBnmV5BG6prx7QNYQBKuyYKLgFaOoQIiXt4OAc/F+Z4jRUgLURkG25fj0+di4t8Ha87JKKuJskesaDRX0lNFeBi7CxRGohgATF3KxvHzH6GdxEKL/cmwiITj4ISC+Xa2HIa/xntpxSoHlRjPEfToulZQAaedj6cwIaz4pU4Wcx8wi+Ynwmr6sh73+WdCRmkG2FntRMmUwU44Nz9Ycpg4UE8GM3TJFgXjBf9qGcPf19QFa6IJutEbjGBiDdmoWXcOjYhGNBKsZLoB6BY/wCW8r1A== 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:(4636009)(396003)(346002)(366004)(376002)(136003)(39860400002)(4326008)(186003)(86362001)(7416002)(316002)(8936002)(478600001)(8676002)(6666004)(36756003)(44832011)(83380400001)(2616005)(956004)(38100700002)(2906002)(38350700002)(26005)(52116002)(66476007)(66556008)(6486002)(5660300002)(7696005)(66946007); DIR:OUT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C0bQ1CzNZqiYNVwL/mrhktkfCV25i7s4Ws5pinpT+eVsqsBtIOUcDrw9qVmWpP7ELv7MV6Ke/asfxA6s3zb1lpSRKMvbIc/SpSr6CZBKAwI7ii2YGJFOV3t9wQbis7TeVYXKiJx4OBJnV6DTS+O8Q4LktuTrrnIpBOu25wLF2so7FW9D5uAfpyEdhBfwQOSZnff4RnkOwwp3sHH+8smfHDGeMis4OHED6IbMkgrmXAxDFNzPZ7JfG7MSQI0h5GRHGsantWMG81VdRQNQPx/FxYtm9BNQOufexm02cZy1Y467CGbkbYBWGPJDGrOWhab5oqrr X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 545d7e14-64ff-4ad2-944a-08d971e4db9b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2021 09:50:00.2613 (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: d8B6Q1jHr3aPUI6Ok3VDVPjv/PZrx0QKGxXgjLi/bPUBynIkpgkWad9Mn1m5XSr6vb1J5iPR5y07+3FB2S35IA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7767 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210907_025012_264931_C3EA0720 X-CRM114-Status: GOOD ( 11.88 ) 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 In some decoing scenarios, application may queue a buffer that only contains codec config data, and the driver needs to know whether is it a frame or not. So we add a buf flag to tell this case. Signed-off-by: Ming Qian Signed-off-by: Shijie Qin Signed-off-by: Zhou Peng --- Documentation/userspace-api/media/v4l/buffer.rst | 7 +++++++ include/uapi/linux/videodev2.h | 1 + 2 files changed, 8 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/buffer.rst b/Documentation/userspace-api/media/v4l/buffer.rst index e991ba73d873..11013bcf8a41 100644 --- a/Documentation/userspace-api/media/v4l/buffer.rst +++ b/Documentation/userspace-api/media/v4l/buffer.rst @@ -607,6 +607,13 @@ Buffer Flags the format. Any subsequent call to the :ref:`VIDIOC_DQBUF ` ioctl will not block anymore, but return an ``EPIPE`` error code. + * .. _`V4L2-BUF-FLAG-CODECCONFIG`: + + - ``V4L2_BUF_FLAG_CODECCONFIG`` + - 0x00200000 + - The buffer only contains codec config data, eg. sps and pps. + Applications can set this bit when ``type`` refers to an output + stream, this flag is usually used by v4l2 decoder. * .. _`V4L2-BUF-FLAG-REQUEST-FD`: - ``V4L2_BUF_FLAG_REQUEST_FD`` diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 167c0e40ec06..5bb0682b4a23 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -1119,6 +1119,7 @@ static inline __u64 v4l2_timeval_to_ns(const struct timeval *tv) #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 /* mem2mem encoder/decoder */ #define V4L2_BUF_FLAG_LAST 0x00100000 +#define V4L2_BUF_FLAG_CODECCONFIG 0x00200000 /* request_fd is valid */ #define V4L2_BUF_FLAG_REQUEST_FD 0x00800000