[{"id":36174,"web_url":"https://patchwork.libcamera.org/comment/36174/","msgid":"<175991436133.2893472.2376674561739009677@ping.linuxembedded.co.uk>","date":"2025-10-08T09:06:01","subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2025-10-07 19:17:44)\n> Import the v4l2-isp.h header from the Linux kernel sources.\n> \n> The file has not been merged in mainline Linux yet but is available\n> at v6:\n> https://lore.kernel.org/all/20251007-extensible-parameters-validation-v6-1-5f719d9f39e5@ideasonboard.com\n> \n> Create the include/linux/media/ directory so that header files\n> exported from the kernel which include this file do not need\n> to be adjusted when imported in libcamera.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> Tested-by: Antoine Bouyer <antoine.bouyer@nxp.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/linux/media/v4l2-isp.h | 82 ++++++++++++++++++++++++++++++++++++++++++\n>  utils/update-kernel-headers.sh |  1 +\n>  2 files changed, 83 insertions(+)\n> \n> diff --git a/include/linux/media/v4l2-isp.h b/include/linux/media/v4l2-isp.h\n> new file mode 100644\n> index 0000000000000000000000000000000000000000..49b451e30d88cce7d15ab40e6a3d533c7bb7a12c\n> --- /dev/null\n> +++ b/include/linux/media/v4l2-isp.h\n> @@ -0,0 +1,82 @@\n> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> +/*\n> + * Video4Linux2 generic ISP parameters and statistics support\n> + *\n> + * Copyright (C) 2025 Ideas On Board Oy\n> + * Author: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> + */\n> +\n> +#ifndef _V4L2_ISP_H_\n> +#define _V4L2_ISP_H_\n> +\n> +#include <linux/stddef.h>\n> +#include <linux/types.h>\n> +\n> +#define V4L2_ISP_PARAMS_FL_BLOCK_DISABLE       (1U << 0)\n> +#define V4L2_ISP_PARAMS_FL_BLOCK_ENABLE        (1U << 1)\n> +\n> +/*\n> + * Reserve the first 8 bits for V4L2_ISP_PARAMS_FL_* flag.\n> + *\n> + * Driver-specific flags should be defined as:\n> + * #define DRIVER_SPECIFIC_FLAG0     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(0))\n> + * #define DRIVER_SPECIFIC_FLAG1     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(1))\n> + */\n> +#define V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(n)       ((n) + 8)\n> +\n> +/**\n> + * struct v4l2_isp_params_block_header - V4L2 extensible parameters block header\n> + * @type: The parameters block type (driver-specific)\n> + * @flags: A bitmask of block flags (driver-specific)\n> + * @size: Size (in bytes) of the parameters block, including this header\n> + *\n> + * This structure represents the common part of all the ISP configuration\n> + * blocks. Each parameters block shall embed an instance of this structure type\n> + * as its first member, followed by the block-specific configuration data.\n> + *\n> + * The @type field is an ISP driver-specific value that identifies the block\n> + * type. The @size field specifies the size of the parameters block.\n> + *\n> + * The @flags field is a bitmask of per-block flags V4L2_PARAMS_ISP_FL_* and\n> + * driver-specific flags specified by the driver header.\n> + */\n> +struct v4l2_isp_params_block_header {\n> +       __u16 type;\n> +       __u16 flags;\n> +       __u32 size;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct v4l2_isp_params_buffer - V4L2 extensible parameters configuration\n> + * @version: The parameters buffer version (driver-specific)\n> + * @data_size: The configuration data effective size, excluding this header\n> + * @data: The configuration data\n> + *\n> + * This structure contains the configuration parameters of the ISP algorithms,\n> + * serialized by userspace into a data buffer. Each configuration parameter\n> + * block is represented by a block-specific structure which contains a\n> + * :c:type:`v4l2_isp_params_block_header` entry as first member. Userspace\n> + * populates the @data buffer with configuration parameters for the blocks that\n> + * it intends to configure. As a consequence, the data buffer effective size\n> + * changes according to the number of ISP blocks that userspace intends to\n> + * configure and is set by userspace in the @data_size field.\n> + *\n> + * The parameters buffer is versioned by the @version field to allow modifying\n> + * and extending its definition. Userspace shall populate the @version field to\n> + * inform the driver about the version it intends to use. The driver will parse\n> + * and handle the @data buffer according to the data layout specific to the\n> + * indicated version and return an error if the desired version is not\n> + * supported.\n> + *\n> + * For each ISP block that userspace wants to configure, a block-specific\n> + * structure is appended to the @data buffer, one after the other without gaps\n> + * in between. Userspace shall populate the @data_size field with the effective\n> + * size, in bytes, of the @data buffer.\n> + */\n> +struct v4l2_isp_params_buffer {\n> +       __u32 version;\n> +       __u32 data_size;\n> +       __u8 data[] __counted_by(data_size);\n> +};\n> +\n> +#endif /* _V4L2_ISP_H_ */\n> diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh\n> index 666624f9972ea61067e5b5695237ab7a17c61664..857601df8766c6493e51b62f0f9ca551d7efbd4a 100755\n> --- a/utils/update-kernel-headers.sh\n> +++ b/utils/update-kernel-headers.sh\n> @@ -56,6 +56,7 @@ headers=\"\n>         linux/udmabuf.h\n>         linux/v4l2-common.h\n>         linux/v4l2-controls.h\n> +       linux/v4l2-isp.h\n\nHow come this isn't linux/media/v4l2-isp.h ?\n\n>         linux/v4l2-mediabus.h\n>         linux/v4l2-subdev.h\n>         linux/videodev2.h\n> \n> -- \n> 2.51.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D3934BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Oct 2025 09:06:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A26BB6B5AA;\n\tWed,  8 Oct 2025 11:06:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6A2DA6B5A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Oct 2025 11:06:04 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 52F3F191B;\n\tWed,  8 Oct 2025 11:04:30 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"dwm/U+qf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759914270;\n\tbh=bj1d1r/vlg6XCX6xDEbhp9AkRlyTCW/1xgupcHbSTCs=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=dwm/U+qfPKRhRciQBRRpCKMmrpPFtApUE5XA1K1AWVGAQgmvphh8KVNec1+zA2TIs\n\tsJomEnQqbr3ofWPM0jjzcdbnZy7hFdS26axUXMVAfnIrM4ThaSvoWSd4E54Wej2wTY\n\t3wHuM4cLz7VkW6FPf26br3vCpOGDoPlyjC3YGAXo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251007-v4l2-params-v5-2-8db451a81398@ideasonboard.com>","References":"<20251007-v4l2-params-v5-0-8db451a81398@ideasonboard.com>\n\t<20251007-v4l2-params-v5-2-8db451a81398@ideasonboard.com>","Subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tAntoine Bouyer <antoine.bouyer@nxp.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 08 Oct 2025 10:06:01 +0100","Message-ID":"<175991436133.2893472.2376674561739009677@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":36175,"web_url":"https://patchwork.libcamera.org/comment/36175/","msgid":"<rqchec5en2owtgdpd4lbvabookgihwb43jkphawlmxuxb7sxh7@ensarcm7mzg5>","date":"2025-10-08T10:02:16","subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Kieran\n\nOn Wed, Oct 08, 2025 at 10:06:01AM +0100, Kieran Bingham wrote:\n> Quoting Jacopo Mondi (2025-10-07 19:17:44)\n> > Import the v4l2-isp.h header from the Linux kernel sources.\n> >\n> > The file has not been merged in mainline Linux yet but is available\n> > at v6:\n> > https://lore.kernel.org/all/20251007-extensible-parameters-validation-v6-1-5f719d9f39e5@ideasonboard.com\n> >\n> > Create the include/linux/media/ directory so that header files\n> > exported from the kernel which include this file do not need\n> > to be adjusted when imported in libcamera.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > Tested-by: Antoine Bouyer <antoine.bouyer@nxp.com>\n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  include/linux/media/v4l2-isp.h | 82 ++++++++++++++++++++++++++++++++++++++++++\n> >  utils/update-kernel-headers.sh |  1 +\n> >  2 files changed, 83 insertions(+)\n> >\n> > diff --git a/include/linux/media/v4l2-isp.h b/include/linux/media/v4l2-isp.h\n> > new file mode 100644\n> > index 0000000000000000000000000000000000000000..49b451e30d88cce7d15ab40e6a3d533c7bb7a12c\n> > --- /dev/null\n> > +++ b/include/linux/media/v4l2-isp.h\n> > @@ -0,0 +1,82 @@\n> > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> > +/*\n> > + * Video4Linux2 generic ISP parameters and statistics support\n> > + *\n> > + * Copyright (C) 2025 Ideas On Board Oy\n> > + * Author: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > + */\n> > +\n> > +#ifndef _V4L2_ISP_H_\n> > +#define _V4L2_ISP_H_\n> > +\n> > +#include <linux/stddef.h>\n> > +#include <linux/types.h>\n> > +\n> > +#define V4L2_ISP_PARAMS_FL_BLOCK_DISABLE       (1U << 0)\n> > +#define V4L2_ISP_PARAMS_FL_BLOCK_ENABLE        (1U << 1)\n> > +\n> > +/*\n> > + * Reserve the first 8 bits for V4L2_ISP_PARAMS_FL_* flag.\n> > + *\n> > + * Driver-specific flags should be defined as:\n> > + * #define DRIVER_SPECIFIC_FLAG0     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(0))\n> > + * #define DRIVER_SPECIFIC_FLAG1     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(1))\n> > + */\n> > +#define V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(n)       ((n) + 8)\n> > +\n> > +/**\n> > + * struct v4l2_isp_params_block_header - V4L2 extensible parameters block header\n> > + * @type: The parameters block type (driver-specific)\n> > + * @flags: A bitmask of block flags (driver-specific)\n> > + * @size: Size (in bytes) of the parameters block, including this header\n> > + *\n> > + * This structure represents the common part of all the ISP configuration\n> > + * blocks. Each parameters block shall embed an instance of this structure type\n> > + * as its first member, followed by the block-specific configuration data.\n> > + *\n> > + * The @type field is an ISP driver-specific value that identifies the block\n> > + * type. The @size field specifies the size of the parameters block.\n> > + *\n> > + * The @flags field is a bitmask of per-block flags V4L2_PARAMS_ISP_FL_* and\n> > + * driver-specific flags specified by the driver header.\n> > + */\n> > +struct v4l2_isp_params_block_header {\n> > +       __u16 type;\n> > +       __u16 flags;\n> > +       __u32 size;\n> > +} __attribute__((aligned(8)));\n> > +\n> > +/**\n> > + * struct v4l2_isp_params_buffer - V4L2 extensible parameters configuration\n> > + * @version: The parameters buffer version (driver-specific)\n> > + * @data_size: The configuration data effective size, excluding this header\n> > + * @data: The configuration data\n> > + *\n> > + * This structure contains the configuration parameters of the ISP algorithms,\n> > + * serialized by userspace into a data buffer. Each configuration parameter\n> > + * block is represented by a block-specific structure which contains a\n> > + * :c:type:`v4l2_isp_params_block_header` entry as first member. Userspace\n> > + * populates the @data buffer with configuration parameters for the blocks that\n> > + * it intends to configure. As a consequence, the data buffer effective size\n> > + * changes according to the number of ISP blocks that userspace intends to\n> > + * configure and is set by userspace in the @data_size field.\n> > + *\n> > + * The parameters buffer is versioned by the @version field to allow modifying\n> > + * and extending its definition. Userspace shall populate the @version field to\n> > + * inform the driver about the version it intends to use. The driver will parse\n> > + * and handle the @data buffer according to the data layout specific to the\n> > + * indicated version and return an error if the desired version is not\n> > + * supported.\n> > + *\n> > + * For each ISP block that userspace wants to configure, a block-specific\n> > + * structure is appended to the @data buffer, one after the other without gaps\n> > + * in between. Userspace shall populate the @data_size field with the effective\n> > + * size, in bytes, of the @data buffer.\n> > + */\n> > +struct v4l2_isp_params_buffer {\n> > +       __u32 version;\n> > +       __u32 data_size;\n> > +       __u8 data[] __counted_by(data_size);\n> > +};\n> > +\n> > +#endif /* _V4L2_ISP_H_ */\n> > diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh\n> > index 666624f9972ea61067e5b5695237ab7a17c61664..857601df8766c6493e51b62f0f9ca551d7efbd4a 100755\n> > --- a/utils/update-kernel-headers.sh\n> > +++ b/utils/update-kernel-headers.sh\n> > @@ -56,6 +56,7 @@ headers=\"\n> >         linux/udmabuf.h\n> >         linux/v4l2-common.h\n> >         linux/v4l2-controls.h\n> > +       linux/v4l2-isp.h\n>\n> How come this isn't linux/media/v4l2-isp.h ?\n>\n\nBecause I moved the file back and forth from include/linux/ and\ninclude/linux/media/ and forgot to update this.\n\nGood catch, I'll fix!\n\n> >         linux/v4l2-mediabus.h\n> >         linux/v4l2-subdev.h\n> >         linux/videodev2.h\n> >\n> > --\n> > 2.51.0\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 49D7DC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Oct 2025 10:02:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 188DE6B5F3;\n\tWed,  8 Oct 2025 12:02:21 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 83FA862C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Oct 2025 12:02:19 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 701191E45;\n\tWed,  8 Oct 2025 12:00:45 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DJgugC/o\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759917645;\n\tbh=6XhgIRKnO/07R8zNkCE7h0PhojFtoKTU7Qlriw8oFd8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DJgugC/oH+Y8JmFEGhPLIWZp//NnXi5/Ggl3q7qA2Qc7SPIIMR4BqKqp25oXFys+x\n\twR5XdyYme2Xf23YgQamyyhHSlayj1gdPrx5zN/Dnd/Gxva1mD8cYfJ4VdXxuVvlbkK\n\tuAH2YRfH5xeUjVBlO9DwJ8fPS0VUf/QQG1ldn1Dc=","Date":"Wed, 8 Oct 2025 12:02:16 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org,\n\tAntoine Bouyer <antoine.bouyer@nxp.com>, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","Message-ID":"<rqchec5en2owtgdpd4lbvabookgihwb43jkphawlmxuxb7sxh7@ensarcm7mzg5>","References":"<20251007-v4l2-params-v5-0-8db451a81398@ideasonboard.com>\n\t<20251007-v4l2-params-v5-2-8db451a81398@ideasonboard.com>\n\t<175991436133.2893472.2376674561739009677@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<175991436133.2893472.2376674561739009677@ping.linuxembedded.co.uk>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":36176,"web_url":"https://patchwork.libcamera.org/comment/36176/","msgid":"<175991841847.2893472.6169006942409594492@ping.linuxembedded.co.uk>","date":"2025-10-08T10:13:38","subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2025-10-08 11:02:16)\n> Hi Kieran\n> \n> On Wed, Oct 08, 2025 at 10:06:01AM +0100, Kieran Bingham wrote:\n> > Quoting Jacopo Mondi (2025-10-07 19:17:44)\n> > > Import the v4l2-isp.h header from the Linux kernel sources.\n> > >\n> > > The file has not been merged in mainline Linux yet but is available\n> > > at v6:\n> > > https://lore.kernel.org/all/20251007-extensible-parameters-validation-v6-1-5f719d9f39e5@ideasonboard.com\n> > >\n> > > Create the include/linux/media/ directory so that header files\n> > > exported from the kernel which include this file do not need\n> > > to be adjusted when imported in libcamera.\n> > >\n> > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > > Tested-by: Antoine Bouyer <antoine.bouyer@nxp.com>\n> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > > ---\n> > >  include/linux/media/v4l2-isp.h | 82 ++++++++++++++++++++++++++++++++++++++++++\n> > >  utils/update-kernel-headers.sh |  1 +\n> > >  2 files changed, 83 insertions(+)\n> > >\n> > > diff --git a/include/linux/media/v4l2-isp.h b/include/linux/media/v4l2-isp.h\n> > > new file mode 100644\n> > > index 0000000000000000000000000000000000000000..49b451e30d88cce7d15ab40e6a3d533c7bb7a12c\n> > > --- /dev/null\n> > > +++ b/include/linux/media/v4l2-isp.h\n> > > @@ -0,0 +1,82 @@\n> > > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> > > +/*\n> > > + * Video4Linux2 generic ISP parameters and statistics support\n> > > + *\n> > > + * Copyright (C) 2025 Ideas On Board Oy\n> > > + * Author: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > > + */\n> > > +\n> > > +#ifndef _V4L2_ISP_H_\n> > > +#define _V4L2_ISP_H_\n> > > +\n> > > +#include <linux/stddef.h>\n> > > +#include <linux/types.h>\n> > > +\n> > > +#define V4L2_ISP_PARAMS_FL_BLOCK_DISABLE       (1U << 0)\n> > > +#define V4L2_ISP_PARAMS_FL_BLOCK_ENABLE        (1U << 1)\n> > > +\n> > > +/*\n> > > + * Reserve the first 8 bits for V4L2_ISP_PARAMS_FL_* flag.\n> > > + *\n> > > + * Driver-specific flags should be defined as:\n> > > + * #define DRIVER_SPECIFIC_FLAG0     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(0))\n> > > + * #define DRIVER_SPECIFIC_FLAG1     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(1))\n> > > + */\n> > > +#define V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(n)       ((n) + 8)\n> > > +\n> > > +/**\n> > > + * struct v4l2_isp_params_block_header - V4L2 extensible parameters block header\n> > > + * @type: The parameters block type (driver-specific)\n> > > + * @flags: A bitmask of block flags (driver-specific)\n> > > + * @size: Size (in bytes) of the parameters block, including this header\n> > > + *\n> > > + * This structure represents the common part of all the ISP configuration\n> > > + * blocks. Each parameters block shall embed an instance of this structure type\n> > > + * as its first member, followed by the block-specific configuration data.\n> > > + *\n> > > + * The @type field is an ISP driver-specific value that identifies the block\n> > > + * type. The @size field specifies the size of the parameters block.\n> > > + *\n> > > + * The @flags field is a bitmask of per-block flags V4L2_PARAMS_ISP_FL_* and\n> > > + * driver-specific flags specified by the driver header.\n> > > + */\n> > > +struct v4l2_isp_params_block_header {\n> > > +       __u16 type;\n> > > +       __u16 flags;\n> > > +       __u32 size;\n> > > +} __attribute__((aligned(8)));\n> > > +\n> > > +/**\n> > > + * struct v4l2_isp_params_buffer - V4L2 extensible parameters configuration\n> > > + * @version: The parameters buffer version (driver-specific)\n> > > + * @data_size: The configuration data effective size, excluding this header\n> > > + * @data: The configuration data\n> > > + *\n> > > + * This structure contains the configuration parameters of the ISP algorithms,\n> > > + * serialized by userspace into a data buffer. Each configuration parameter\n> > > + * block is represented by a block-specific structure which contains a\n> > > + * :c:type:`v4l2_isp_params_block_header` entry as first member. Userspace\n> > > + * populates the @data buffer with configuration parameters for the blocks that\n> > > + * it intends to configure. As a consequence, the data buffer effective size\n> > > + * changes according to the number of ISP blocks that userspace intends to\n> > > + * configure and is set by userspace in the @data_size field.\n> > > + *\n> > > + * The parameters buffer is versioned by the @version field to allow modifying\n> > > + * and extending its definition. Userspace shall populate the @version field to\n> > > + * inform the driver about the version it intends to use. The driver will parse\n> > > + * and handle the @data buffer according to the data layout specific to the\n> > > + * indicated version and return an error if the desired version is not\n> > > + * supported.\n> > > + *\n> > > + * For each ISP block that userspace wants to configure, a block-specific\n> > > + * structure is appended to the @data buffer, one after the other without gaps\n> > > + * in between. Userspace shall populate the @data_size field with the effective\n> > > + * size, in bytes, of the @data buffer.\n> > > + */\n> > > +struct v4l2_isp_params_buffer {\n> > > +       __u32 version;\n> > > +       __u32 data_size;\n> > > +       __u8 data[] __counted_by(data_size);\n> > > +};\n> > > +\n> > > +#endif /* _V4L2_ISP_H_ */\n> > > diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh\n> > > index 666624f9972ea61067e5b5695237ab7a17c61664..857601df8766c6493e51b62f0f9ca551d7efbd4a 100755\n> > > --- a/utils/update-kernel-headers.sh\n> > > +++ b/utils/update-kernel-headers.sh\n> > > @@ -56,6 +56,7 @@ headers=\"\n> > >         linux/udmabuf.h\n> > >         linux/v4l2-common.h\n> > >         linux/v4l2-controls.h\n> > > +       linux/v4l2-isp.h\n> >\n> > How come this isn't linux/media/v4l2-isp.h ?\n> >\n> \n> Because I moved the file back and forth from include/linux/ and\n> include/linux/media/ and forgot to update this.\n> \n> Good catch, I'll fix!\n\nAhaha ok well once that's done add:\n\n\nAcked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> > >         linux/v4l2-mediabus.h\n> > >         linux/v4l2-subdev.h\n> > >         linux/videodev2.h\n> > >\n> > > --\n> > > 2.51.0\n> > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 07404BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Oct 2025 10:13:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AB3446B5AA;\n\tWed,  8 Oct 2025 12:13:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 67A4F62C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Oct 2025 12:13:41 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 39859EFE;\n\tWed,  8 Oct 2025 12:12:07 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pOrPnMNF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759918327;\n\tbh=kwQaMJsxWHNG0DcejzXYWYlZmbPtSPs98sDi7AmfLHo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=pOrPnMNFEhNvCIRzxJ8zc+r3emQAIv+NXdSuGDdF8zx9EJfeMdX7/lw8kWE3K9gye\n\tpb+AVEkJc8k2kUA80shiZjuAkGTa57Ta1fzLbh4kcZz9r7yXRMapn6ooJ6VTLwjkj0\n\thENf3TakyL96wt42K7PlalaJEHhBr5H010dk2zmA=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<rqchec5en2owtgdpd4lbvabookgihwb43jkphawlmxuxb7sxh7@ensarcm7mzg5>","References":"<20251007-v4l2-params-v5-0-8db451a81398@ideasonboard.com>\n\t<20251007-v4l2-params-v5-2-8db451a81398@ideasonboard.com>\n\t<175991436133.2893472.2376674561739009677@ping.linuxembedded.co.uk>\n\t<rqchec5en2owtgdpd4lbvabookgihwb43jkphawlmxuxb7sxh7@ensarcm7mzg5>","Subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tAntoine Bouyer <antoine.bouyer@nxp.com>, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Date":"Wed, 08 Oct 2025 11:13:38 +0100","Message-ID":"<175991841847.2893472.6169006942409594492@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":36185,"web_url":"https://patchwork.libcamera.org/comment/36185/","msgid":"<a1e3da8e-c9d4-4e2f-9687-9a650279d29d@ideasonboard.com>","date":"2025-10-10T12:06:20","subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Hi Jacopo\n\nOn 08/10/2025 11:13, Kieran Bingham wrote:\n> Quoting Jacopo Mondi (2025-10-08 11:02:16)\n>> Hi Kieran\n>>\n>> On Wed, Oct 08, 2025 at 10:06:01AM +0100, Kieran Bingham wrote:\n>>> Quoting Jacopo Mondi (2025-10-07 19:17:44)\n>>>> Import the v4l2-isp.h header from the Linux kernel sources.\n>>>>\n>>>> The file has not been merged in mainline Linux yet but is available\n>>>> at v6:\n>>>> https://lore.kernel.org/all/20251007-extensible-parameters-validation-v6-1-5f719d9f39e5@ideasonboard.com\n>>>>\n>>>> Create the include/linux/media/ directory so that header files\n>>>> exported from the kernel which include this file do not need\n>>>> to be adjusted when imported in libcamera.\n>>>>\n>>>> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>>>> Tested-by: Antoine Bouyer <antoine.bouyer@nxp.com>\n>>>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>>>> ---\n>>>>   include/linux/media/v4l2-isp.h | 82 ++++++++++++++++++++++++++++++++++++++++++\n>>>>   utils/update-kernel-headers.sh |  1 +\n>>>>   2 files changed, 83 insertions(+)\n>>>>\n>>>> diff --git a/include/linux/media/v4l2-isp.h b/include/linux/media/v4l2-isp.h\n>>>> new file mode 100644\n>>>> index 0000000000000000000000000000000000000000..49b451e30d88cce7d15ab40e6a3d533c7bb7a12c\n>>>> --- /dev/null\n>>>> +++ b/include/linux/media/v4l2-isp.h\n>>>> @@ -0,0 +1,82 @@\n>>>> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n>>>> +/*\n>>>> + * Video4Linux2 generic ISP parameters and statistics support\n>>>> + *\n>>>> + * Copyright (C) 2025 Ideas On Board Oy\n>>>> + * Author: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>>>> + */\n>>>> +\n>>>> +#ifndef _V4L2_ISP_H_\n>>>> +#define _V4L2_ISP_H_\n>>>> +\n>>>> +#include <linux/stddef.h>\n>>>> +#include <linux/types.h>\n>>>> +\n>>>> +#define V4L2_ISP_PARAMS_FL_BLOCK_DISABLE       (1U << 0)\n>>>> +#define V4L2_ISP_PARAMS_FL_BLOCK_ENABLE        (1U << 1)\n>>>> +\n>>>> +/*\n>>>> + * Reserve the first 8 bits for V4L2_ISP_PARAMS_FL_* flag.\n>>>> + *\n>>>> + * Driver-specific flags should be defined as:\n>>>> + * #define DRIVER_SPECIFIC_FLAG0     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(0))\n>>>> + * #define DRIVER_SPECIFIC_FLAG1     ((1U << V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(1))\n>>>> + */\n>>>> +#define V4L2_ISP_PARAMS_FL_DRIVER_FLAGS(n)       ((n) + 8)\n>>>> +\n>>>> +/**\n>>>> + * struct v4l2_isp_params_block_header - V4L2 extensible parameters block header\n>>>> + * @type: The parameters block type (driver-specific)\n>>>> + * @flags: A bitmask of block flags (driver-specific)\n>>>> + * @size: Size (in bytes) of the parameters block, including this header\n>>>> + *\n>>>> + * This structure represents the common part of all the ISP configuration\n>>>> + * blocks. Each parameters block shall embed an instance of this structure type\n>>>> + * as its first member, followed by the block-specific configuration data.\n>>>> + *\n>>>> + * The @type field is an ISP driver-specific value that identifies the block\n>>>> + * type. The @size field specifies the size of the parameters block.\n>>>> + *\n>>>> + * The @flags field is a bitmask of per-block flags V4L2_PARAMS_ISP_FL_* and\n>>>> + * driver-specific flags specified by the driver header.\n>>>> + */\n>>>> +struct v4l2_isp_params_block_header {\n>>>> +       __u16 type;\n>>>> +       __u16 flags;\n>>>> +       __u32 size;\n>>>> +} __attribute__((aligned(8)));\n>>>> +\n>>>> +/**\n>>>> + * struct v4l2_isp_params_buffer - V4L2 extensible parameters configuration\n>>>> + * @version: The parameters buffer version (driver-specific)\n>>>> + * @data_size: The configuration data effective size, excluding this header\n>>>> + * @data: The configuration data\n>>>> + *\n>>>> + * This structure contains the configuration parameters of the ISP algorithms,\n>>>> + * serialized by userspace into a data buffer. Each configuration parameter\n>>>> + * block is represented by a block-specific structure which contains a\n>>>> + * :c:type:`v4l2_isp_params_block_header` entry as first member. Userspace\n>>>> + * populates the @data buffer with configuration parameters for the blocks that\n>>>> + * it intends to configure. As a consequence, the data buffer effective size\n>>>> + * changes according to the number of ISP blocks that userspace intends to\n>>>> + * configure and is set by userspace in the @data_size field.\n>>>> + *\n>>>> + * The parameters buffer is versioned by the @version field to allow modifying\n>>>> + * and extending its definition. Userspace shall populate the @version field to\n>>>> + * inform the driver about the version it intends to use. The driver will parse\n>>>> + * and handle the @data buffer according to the data layout specific to the\n>>>> + * indicated version and return an error if the desired version is not\n>>>> + * supported.\n>>>> + *\n>>>> + * For each ISP block that userspace wants to configure, a block-specific\n>>>> + * structure is appended to the @data buffer, one after the other without gaps\n>>>> + * in between. Userspace shall populate the @data_size field with the effective\n>>>> + * size, in bytes, of the @data buffer.\n>>>> + */\n>>>> +struct v4l2_isp_params_buffer {\n>>>> +       __u32 version;\n>>>> +       __u32 data_size;\n>>>> +       __u8 data[] __counted_by(data_size);\n>>>> +};\n>>>> +\n>>>> +#endif /* _V4L2_ISP_H_ */\n>>>> diff --git a/utils/update-kernel-headers.sh b/utils/update-kernel-headers.sh\n>>>> index 666624f9972ea61067e5b5695237ab7a17c61664..857601df8766c6493e51b62f0f9ca551d7efbd4a 100755\n>>>> --- a/utils/update-kernel-headers.sh\n>>>> +++ b/utils/update-kernel-headers.sh\n>>>> @@ -56,6 +56,7 @@ headers=\"\n>>>>          linux/udmabuf.h\n>>>>          linux/v4l2-common.h\n>>>>          linux/v4l2-controls.h\n>>>> +       linux/v4l2-isp.h\n>>>\n>>> How come this isn't linux/media/v4l2-isp.h ?\n>>>\n>>\n>> Because I moved the file back and forth from include/linux/ and\n>> include/linux/media/ and forgot to update this.\n>>\n>> Good catch, I'll fix!\n> \n> Ahaha ok well once that's done add:\n> \n> \n> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nAnd also:\n\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>>\n>>\n>>>>          linux/v4l2-mediabus.h\n>>>>          linux/v4l2-subdev.h\n>>>>          linux/videodev2.h\n>>>>\n>>>> --\n>>>> 2.51.0\n>>>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 43822BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Oct 2025 12:06:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8A6886B5C4;\n\tFri, 10 Oct 2025 14:06:25 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 370516B599\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Oct 2025 14:06:23 +0200 (CEST)","from [192.168.0.43]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B442C5B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Oct 2025 14:04:47 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DUV3pgsF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1760097887;\n\tbh=CyrZ5zb+sWZB4GF/GpbGxQmFKVlCfbejhHY+j0yIg1I=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=DUV3pgsFhpTBp/h4k+C5/k3GchVL3RPgbE/Qr9+dBz4QF5IoyJie0J1O29wtC7Cpt\n\tHQdIKwjjLqcYj2pnObzihJotACpezyAzXKgNJEae5sUGojIaD/Z0zt1/myf2jfBeqy\n\tpOIvS8iwDu05Bpa7ih1prjkOh5Dz2BMn85RXG8mU=","Message-ID":"<a1e3da8e-c9d4-4e2f-9687-9a650279d29d@ideasonboard.com>","Date":"Fri, 10 Oct 2025 13:06:20 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v5 2/5] include: linux: Add v4l2-isp.h","To":"libcamera-devel@lists.libcamera.org","References":"<20251007-v4l2-params-v5-0-8db451a81398@ideasonboard.com>\n\t<20251007-v4l2-params-v5-2-8db451a81398@ideasonboard.com>\n\t<175991436133.2893472.2376674561739009677@ping.linuxembedded.co.uk>\n\t<rqchec5en2owtgdpd4lbvabookgihwb43jkphawlmxuxb7sxh7@ensarcm7mzg5>\n\t<175991841847.2893472.6169006942409594492@ping.linuxembedded.co.uk>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","In-Reply-To":"<175991841847.2893472.6169006942409594492@ping.linuxembedded.co.uk>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]