public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Antoine Bouyer <antoine.bouyer@nxp.com>
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, michael.riesch@collabora.com,
	anthony.mcgivern@arm.com
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, imx@lists.linux.dev,
	ai.luthra@ideasonboard.com, paul.elder@ideasonboard.com,
	Antoine Bouyer <antoine.bouyer@nxp.com>
Subject: [PATCH v1 03/11] media: v4l2-isp: Add helper function to compute extended stats size
Date: Mon, 13 Apr 2026 18:03:23 +0200	[thread overview]
Message-ID: <20260413160331.2611829-4-antoine.bouyer@nxp.com> (raw)
In-Reply-To: <20260413160331.2611829-1-antoine.bouyer@nxp.com>

v4l2-isp framework only supports extended buffer for generic ISP
configuration. This patch adds simple helper function to compute the
extended statistics buffer size, exactly the same as for extended
parameters, except that it uses the `v4l2_isp_stats_block_header`
structure definition to prevent conflict with the
`v4l2_isp_params_block_header` one.

Signed-off-by: Antoine Bouyer <antoine.bouyer@nxp.com>
---
 include/media/v4l2-isp.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/media/v4l2-isp.h b/include/media/v4l2-isp.h
index f3a6d0edcb24..9a93a534e7b0 100644
--- a/include/media/v4l2-isp.h
+++ b/include/media/v4l2-isp.h
@@ -27,6 +27,19 @@ struct vb2_buffer;
 #define v4l2_isp_params_buffer_size(max_params_size) \
 	(offsetof(struct v4l2_isp_params_buffer, data) + (max_params_size))
 
+/**
+ * v4l2_isp_stats_buffer_size - Calculate size of v4l2_isp_stats_buffer
+ * @max_stats_size: The total size of the ISP statistic blocks
+ *
+ * Users of the v4l2 extensible statistics buffers will have differing sized data
+ * arrays depending on their specific ISP blocks. Drivers and userspace will need
+ * to be able to calculate the appropriate size of the struct to accommodate all
+ * ISP statistics blocks provided by the platform.
+ * This macro provides a convenient tool for the calculation.
+ */
+#define v4l2_isp_stats_buffer_size(max_stats_size) \
+	(offsetof(struct v4l2_isp_stats_buffer, data) + (max_stats_size))
+
 /**
  * v4l2_isp_params_validate_buffer_size - Validate a V4L2 ISP buffer sizes
  * @dev: the driver's device pointer
-- 
2.51.0


  parent reply	other threads:[~2026-04-13 16:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-13 16:03 [PATCH v1 00/11] media: Add iMX95 neoisp driver Antoine Bouyer
2026-04-13 16:03 ` [PATCH v1 01/11] media: Documentation: uapi: Update V4L2 ISP for extensible stats Antoine Bouyer
2026-04-16 10:27   ` Jacopo Mondi
2026-04-13 16:03 ` [PATCH v1 02/11] media: uapi: v4l2-isp: Add v4l2 ISP extensible statistics definitions Antoine Bouyer
2026-04-16 10:03   ` Jacopo Mondi
2026-04-16 10:13     ` Jacopo Mondi
2026-04-13 16:03 ` Antoine Bouyer [this message]
2026-04-17  7:15   ` [PATCH v1 03/11] media: v4l2-isp: Add helper function to compute extended stats size Jacopo Mondi
2026-04-13 16:03 ` [PATCH v1 04/11] media: Documentation: Add NXP neoisp driver documentation Antoine Bouyer
2026-04-13 16:03 ` [PATCH v1 05/11] dt-bindings: media: Add nxp neoisp support Antoine Bouyer
2026-04-15 21:31   ` Rob Herring (Arm)
2026-04-13 16:03 ` [PATCH v1 06/11] media: v4l2-ctrls: Add user control base for NXP neoisp controls Antoine Bouyer
2026-04-13 16:03 ` [PATCH v1 07/11] media: Add meta formats supported by NXP neoisp driver Antoine Bouyer
2026-04-13 16:03 ` [PATCH v1 08/11] media: uapi: Add NXP NEOISP user interface header file Antoine Bouyer
2026-04-13 16:03 ` [PATCH v1 09/11] media: platform: Add NXP Neoisp Image Signal Processor Antoine Bouyer
2026-04-13 16:03 ` [PATCH v1 10/11] media: platform: neoisp: Add debugfs support Antoine Bouyer
2026-04-13 16:03 ` [PATCH v1 11/11] arm64: dts: freescale: imx95: Add NXP neoisp device tree node Antoine Bouyer
2026-04-16  9:20 ` [PATCH v1 00/11] media: Add iMX95 neoisp driver Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260413160331.2611829-4-antoine.bouyer@nxp.com \
    --to=antoine.bouyer@nxp.com \
    --cc=ai.luthra@ideasonboard.com \
    --cc=alexi.birlinger@nxp.com \
    --cc=anthony.mcgivern@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frank.li@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=julien.vuillaumier@nxp.com \
    --cc=krzk+dt@kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=michael.riesch@collabora.com \
    --cc=paul.elder@ideasonboard.com \
    --cc=peng.fan@nxp.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox