From mboxrd@z Thu Jan 1 00:00:00 1970 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 8FC8ED72349 for ; Fri, 23 Jan 2026 08:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=RCqTEfTykEiz2CNjpeF8sSdmKnv+ngiRI6OD1IcW20g=; b=ypxxbnfM5gNA1Tqq9b/Rj5Ku3e 16vZN45T/pN0YHqZSysXRAI+2dL7MZQ6vgBK3aWDpW4mT5Hv2qFPZU3TsLBgYgBdAwApTc4fg5Zc5 6Rq54D3ZhlX5sqY28a+FVtMNnY/zEmdrdL8JFD556v/J81RJRdjqsY1xdDPUR7x1DMvpBo0Ktzi5c iNerTLjOZiDu3ja4R6yHk3WvsMFCg0F8b+Cd8lhYMOUA5YMWDHSCrHTouhxn3ekLnzBiv5gTeJ8cS jchRRe2fZSyzfs56YHx/aCI+puyiJ28YyIRSEjxJgkf3sn6hY4Ua4KJOL7mKwXLUMAlse1TXixD6Y 1gi7Z4ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vjCBZ-00000008QAr-3nio; Fri, 23 Jan 2026 08:06:29 +0000 Received: from mail-francesouthazon11011040.outbound.protection.outlook.com ([40.107.130.40] helo=MRWPR03CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vjCBU-00000008Q8D-1rUM for linux-arm-kernel@lists.infradead.org; Fri, 23 Jan 2026 08:06:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=v/l9PjJH63Z6zNI5cjQPz8b9z3po4u/L6KnZtkQq/Bgayvbjis5oDpzwKNdsPL1MfD1MwXp3qIcpVc9mnoNW+ADmaEUFyKkJXOuCVnh39FPkuPt3b4QrHlOmPgw0ZYZdQlpcR6HaMs1EpWvjh/FJ/o2xomgQUiubmOyI3glM/1V3c91BLbWi+EIvEQBESWUR/m6dUit/chXlG7Ry9VHUckoxw7fzaEoIaoEJ5gw4jOz13qpoFTmDuSH+CXy+VrLDOm+tLqwaNUf5pr4RabtE7c4L6utKvQl83BqosDQ+SzKJymcqXbN0liYrvqnPYptuxAQTMM/xij9BjLev6OFuyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=RCqTEfTykEiz2CNjpeF8sSdmKnv+ngiRI6OD1IcW20g=; b=mZRhfOPfGj49T+dYdbSAeT50S15VIbE5TfXAZA66zQxDdbAgYOI2TMc6FXj/JpP8iVKFAgGnXTOM6mywbgJMvNxhRpBG3jUK02hnYHysp1VbzMkQmBKaOJxnEdW0Bh0qSRU+SnJ2S8R3OMyBrRZ7k5Kk4n0ppZapTq9YChgPsxt0RHp5omwW3ALgMPpk7uoY+sXQdbamwquXzD7d0k+bQsFTOu01E+KWRfKl2QsYHZFpTkPf8tPhyg/3fZ/7YKAsdLTEOLB4BOxxzOzhtq4/URBvn5m3hQNjGdhrZH+09ZuMKBPFMQGtoiGSDrYURB2prrch90DRY1GYMTleJEdoGA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RCqTEfTykEiz2CNjpeF8sSdmKnv+ngiRI6OD1IcW20g=; b=nkfxO8OGEEFM19mJdSMPONB393xWImkzeSapBPtD5xmpRwBIqqMZ+LTCYNBWr+PPZ8tDU8JmXbwCoUgmJn8GRguks4QQUcaiTfS+aPLDyUcIDwqx0VOXEGPAFud7j0RtfINh+3T8HFdLPeUEsuDZ1ZP4SuuRLd5xnB9wMTtDg0j2WhrL3IdusHCy/8PNoEYhNYFqw/PYPGcpIhLhPJx8Fcga8tKVdoU4GAdHOG53MkqUjs3zlT4DzNs+p+bQG0b+sidEQPqglycc1fs3bWnqTWC09fARWvit7Zjha+lFHky0/WbZVHt8FBCoW8FwY6AwFgkoliyBSUOa4NAUjd37LA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PA6PR04MB11910.eurprd04.prod.outlook.com (2603:10a6:102:516::16) by PAXPR04MB8624.eurprd04.prod.outlook.com (2603:10a6:102:21b::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.10; Fri, 23 Jan 2026 08:06:17 +0000 Received: from PA6PR04MB11910.eurprd04.prod.outlook.com ([fe80::d3f0:3c24:f717:4989]) by PA6PR04MB11910.eurprd04.prod.outlook.com ([fe80::d3f0:3c24:f717:4989%4]) with mapi id 15.20.9542.008; Fri, 23 Jan 2026 08:06:17 +0000 From: Antoine Bouyer To: julien.vuillaumier@nxp.com, alexi.birlinger@nxp.com, daniel.baluta@nxp.com, peng.fan@nxp.com, frank.li@nxp.com, jacopo.mondi@ideasonboard.com, laurent.pinchart@ideasonboard.com, mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Antoine Bouyer Subject: [RFC v1 01/11] media: uapi: v4l2-isp: Add v4l2 ISP extensible statistics definitions Date: Fri, 23 Jan 2026 09:09:28 +0100 Message-ID: <20260123080938.3367348-2-antoine.bouyer@nxp.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260123080938.3367348-1-antoine.bouyer@nxp.com> References: <20260123080938.3367348-1-antoine.bouyer@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: FR4P281CA0026.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:c9::11) To PA6PR04MB11910.eurprd04.prod.outlook.com (2603:10a6:102:516::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PA6PR04MB11910:EE_|PAXPR04MB8624:EE_ X-MS-Office365-Filtering-Correlation-Id: e213c87b-2f02-4d61-e2b5-08de5a56491b X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|52116014|1800799024|19092799006|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/woFGUCNnZ8OIPd+hX+ZaD1kGhdaKzNI61mNrRO4Cd+v8CjXAvVgVNn1fXXC?= =?us-ascii?Q?s5lIUqOds8+t3YsliI6G46tq0TLXv5dhmkG94jz4FtBxntJ8QHkW5TCvCXhO?= =?us-ascii?Q?72XOT1YECkjaNhmdzwEDuWOfbUcB8ub1LvPe+sA/qHnZ2m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TPB5wvfCoWYqnLNR2v+INlfkPG8fD+Kj9esK9WokaUK?= =?us-ascii?Q?ESAJcTgf/qys9GuNjabO6ty2ChL9y8PJNO2FBUW5NRxIqRVkrx2O04glFhyl?= =?us-ascii?Q?HeuHzkfHO0HFPxFzqVhSzH5chYL8tX8jEFCgT1fSNIAzWVE52g9nF9DiwrLn?= =?us-ascii?Q?kxGjWCw++ijRetzrRA9w/SQZIBQs0D742s+tAtAOKYXhPR5Zu7hxH3/Hclvo?= =?us-ascii?Q?d+p43a6dqV8Y256IH88Wx4XykjEkLdlCSdfoyeVNrEIYN0sRorMyM1zX6NMh?= =?us-ascii?Q?j2IFOQ/BeZrYFpmCu6/lvD/2xGtN2BmgBWrSNzqfUe5PxzH9S4l15U6ERADl?= =?us-ascii?Q?NUajWu1rso5ZreKKDs1auwFkScy8XP2aNNizxhzGALctFyNUUcrujJJGi8aF?= =?us-ascii?Q?5nrRIaGxOedgNtsqOS/WlkZ+CNff8DRKKaAp3gdD+48gK2MRe1q6SExdBnMS?= =?us-ascii?Q?Tg1EGTgB3yvpx0Byfx5snAgBmguQ3ejn9AO+pYMo7/voymYE7etlYrMqSxXy?= =?us-ascii?Q?mqwXMIa2AfkoPhi2LefxhAp0CK3QIOz2QKqXI75sySRGTcsvW55ZRkb3Dg07?= =?us-ascii?Q?P+JcEcUalJIm1ICCRPXn2G2ykx9/8O1OdfTEebWYFm+8?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PA6PR04MB11910.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(52116014)(1800799024)(19092799006)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6VyQiOsOvsYNhhjWLU9kGNCN1qydim7x2sRPzYi1UAYILbIANm9CSlvBrsXP?= =?us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DqyzMisMP3vF40D7sNlhQIReIlj2O68b4FxmwGz/ecuvRprB?= =?us-ascii?Q?hNVJUnisZCD3+4x4DT7r7CmV0GPzBmUyJu+veSzshWhxQElM7QSTgw1n6HM7?= =?us-ascii?Q?VUcZ1FFKe7Tbhw+tKT7BLnBFR0EiQGh1c59piNO6stv7eR9J8LbMOAauKH9x?= =?us-ascii?Q?dSHtaLvfARGdd6HB+euDgTl1nyo/Fwgx/uJ2BenYTZakbVqnw4XRpQKLn7nW?= =?us-ascii?Q?PGSXQTSN07MdMt0zm/77ijqCRYIBotLMTcgAqv6VKwCrV8mYMq6bIh+0LI38?= =?us-ascii?Q?88tfYWFaQV63wCmeVrWhkDp1gPRfGGktXPZ6jzZiTUINGKbruXG3OcVbxddK?= =?us-ascii?Q?4Vbb0mvrc0+jhHzs3ui5SJnFAcS7LJtXcnIrcBuiya0eKAdy7Z857PleON/d?= =?us-ascii?Q?06NlZp/7KNzf3tzWXzYDld3yD/n2GxUQWo6oGmTj4e8byy1XP1fWYN4GxQgE?= =?us-ascii?Q?vzKfRB2qYn7Gl/+UHK1tAgyrm2+7cXPmd80eH6AQEo2xa9USaaRG9WpEEr8N?= =?us-ascii?Q?+3MxRq3g2YOsXK0ToTip5g+BRwIA9ssUeUW9RmtcpNGaHXUw/jGoxUNOhxJa?= =?us-ascii?Q?DYaWPqzCSDm5Ik/T/4kX58xod6TnsMZkuPEFZItHyV3YZ2FLFZE5y5EoV7pP?= =?us-ascii?Q?QkYEOBoLiVr2MvgdKqeo/0BJnTgz+e1ozu5gHrPm8wQ+X9TZeoNNRaNwljY+?= =?us-ascii?Q?byPFiPzbrJRBI6tgzvrh5f4IXlqIRkWxDJAb39NFPr+k/2T5IIN92o/DrcmF?= =?us-ascii?Q?YX43ru74BGt2LuBT5eno0mxAqJApoTfafUf5TjWVX4t//Z6aPRS9odCHyhfa?= =?us-ascii?Q?bSqzw2k4Hw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e213c87b-2f02-4d61-e2b5-08de5a56491b X-MS-Exchange-CrossTenant-AuthSource: PA6PR04MB11910.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2026 08:06:17.6402 (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: Fb6tukg8ZCTyC90pZOZLcyXdGv99NZKU2B3iU+RrYB0CTVTPw3dKw5PQS1E5BRj/kNkHVZ7UnVZXWULr1F2Yxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8624 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260123_000624_485351_864D6989 X-CRM114-Status: GOOD ( 18.71 ) 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 Extend the v4l2-isp extensible format introduced for isp parameters buffer to the statistics buffer as well. Like for ISP configuration purpose, that will help supporting various ISP hardware versions reporting different statistics data with less impact on userspace. The `v4l2_isp_stats_buffer` reuses the `v4l2_isp_params_buffer` container definitions, with similar header, versions and flags. V0 and V1 versions are provided to match with params versions. On the other side, ENABLE and DISABLE flags are not really meaningfull for statistics purpose. So VALID and INVALID flags are introduced. Purpose is to force ISP driver to validate a statistics buffer, before it is consumed by userspace. Signed-off-by: Antoine Bouyer --- include/uapi/linux/media/v4l2-isp.h | 85 +++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/include/uapi/linux/media/v4l2-isp.h b/include/uapi/linux/media/v4l2-isp.h index 779168f9058e..ed1279b86694 100644 --- a/include/uapi/linux/media/v4l2-isp.h +++ b/include/uapi/linux/media/v4l2-isp.h @@ -99,4 +99,89 @@ struct v4l2_isp_params_buffer { __u8 data[] __counted_by(data_size); }; +/** + * enum v4l2_isp_stats_version - V4L2 ISP statistics versioning + * + * @V4L2_ISP_STATS_VERSION_V0: First version of the V4L2 ISP statistics format + * (for compatibility) + * @V4L2_ISP_STATS_VERSION_V1: First version of the V4L2 ISP statistics format + * + * V0 and V1 are identical, and comply with V4l2 ISP parameters versions. So + * both V0 and V1 refers to the first version of the V4L2 ISP statistics + * format. + * + * Future revisions of the V4L2 ISP statistics format should start from the + * value of 2. + */ +enum v4l2_isp_stats_version { + V4L2_ISP_STATS_VERSION_V0 = 0, + V4L2_ISP_STATS_VERSION_V1, +}; + +#define V4L2_ISP_PARAMS_FL_BLOCK_VALID (1U << 0) +#define V4L2_ISP_PARAMS_FL_BLOCK_INVALID (1U << 1) + +/* + * Reserve the first 8 bits for V4L2_ISP_STATS_FL_* flag. + * + * Driver-specific flags should be defined as: + * #define DRIVER_SPECIFIC_FLAG0 ((1U << V4L2_ISP_STATS_FL_DRIVER_FLAGS(0)) + * #define DRIVER_SPECIFIC_FLAG1 ((1U << V4L2_ISP_STATS_FL_DRIVER_FLAGS(1)) + */ +#define V4L2_ISP_STATS_FL_DRIVER_FLAGS(n) ((n) + 8) + +/** + * struct v4l2_isp_stats_block_header - V4L2 extensible statistics block header + * @type: The statistics block type (driver-specific) + * @flags: A bitmask of block flags (driver-specific) + * @size: Size (in bytes) of the statistics block, including this header + * + * This structure represents the common part of all the ISP statistics blocks. + * Each statistics block shall embed an instance of this structure type as its + * first member, followed by the block-specific statistics data. + * + * The @type field is an ISP driver-specific value that identifies the block + * type. The @size field specifies the size of the parameters block. + * + * The @flags field is a bitmask of per-block flags V4L2_STATS_ISP_FL_* and + * driver-specific flags specified by the driver header. + */ +struct v4l2_isp_stats_block_header { + __u16 type; + __u16 flags; + __u32 size; +} __attribute__((aligned(8))); + +/** + * struct v4l2_isp_stats_buffer - V4L2 extensible statistics data + * @version: The statistics buffer version (driver-specific) + * @data_size: The statistics data effective size, excluding this header + * @data: The statistics data + * + * This structure contains the statistics information of the ISP hardware, + * serialized for userspace into a data buffer. Each statistics block is + * represented by a block-specific structure which contains a + * :c:type:`v4l2_isp_stats_block_header` entry as first member. Driver + * populates the @data buffer with statistics information of the ISP blocks it + * intends to share to userspace. As a consequence, the data buffer effective + * size changes according to the number of ISP blocks that driver intends to + * provide and is set by the driver in the @data_size field. + * + * The statistics buffer is versioned by the @version field to allow modifying + * and extending its definition. Driver shall populate the @version field to + * inform the userpsace about the version it intends to use. The userspace will + * parse and handle the @data buffer according to the data layout specific to + * the indicated version. + * + * For each ISP block that driver wants to report, a block-specific structure + * is appended to the @data buffer, one after the other without gaps in + * between. Driver shall populate the @data_size field with the effective + * size, in bytes, of the @data buffer. + */ +struct v4l2_isp_stats_buffer { + __u32 version; + __u32 data_size; + __u8 data[] __counted_by(data_size); +}; + #endif /* _UAPI_V4L2_ISP_H_ */ -- 2.52.0