From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9E0A2D3A60; Wed, 6 May 2026 08:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778056531; cv=none; b=P6y7kK+HfjH9awUsRe+Y3ZgJM3DXXXR8YFXqPucnHoslRG8/ivRU15rH2jcNgV8u0DNNWEh+XkOel6xXXJoCbAZM/jp8mhFCF5AAEEywikAw2Q5C8VazXNWB/SykoP3YWPmuJ2Dnd5gk/FVpMqp+tYcXb0YZGMF7+I5KIuAR74U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778056531; c=relaxed/simple; bh=szPcxoy/83OTNBNMK8t4PDn2kzBAPSJI4fRHixbIZng=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tura0UPFSLQZOj6eKulszT4tztvHynL7+4bOh/N5GnjJZLHg9UDFNgMUVnX0UX9UzVYKyo5WHe9MB5s9RWE2ggPuImTNkcYAoFREbrnTu2VHh5+hGWIm2gso/J8ltOpD7SCmRzFfusfLb2iOwBrU17lYLFNPfThJ7xwzrqJv5gM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=gxCOpBnl; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gxCOpBnl" Received: from ideasonboard.com (net-93-65-100-155.cust.vodafonedsl.it [93.65.100.155]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CF566BE; Wed, 6 May 2026 10:35:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1778056524; bh=szPcxoy/83OTNBNMK8t4PDn2kzBAPSJI4fRHixbIZng=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gxCOpBnlR8fRtZdIrNzJQRyfbBuj5v+cb28K1OU7Mpem2KxXyC9INM7xEBUFfMlNV +e7Rbe65Ay7r55SqAHcguWKd7Qb0taaih+19F+6ZdEtqoLU+/zQobhTsrtOBDjuxaJ cLH2gtyDhUWA/V0dOqfEHEcKlu5qHCbSBTtgUquM= Date: Wed, 6 May 2026 10:35:25 +0200 From: Jacopo Mondi To: Antoine Bouyer Cc: Jacopo Mondi , Mauro Carvalho Chehab , Daniel Scally , Keke Li , Jai Luthra , Niklas =?utf-8?Q?S=C3=B6derlund?= , Ricardo Ribalda , Laurent Pinchart , Sakari Ailus , Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] media: v4l2-isp: Rename v4l2_isp_params_buffer_size Message-ID: References: <20260505-extensible-stats-v1-0-e16f326b8dad@ideasonboard.com> <20260505-extensible-stats-v1-3-e16f326b8dad@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Hello Antoine On Wed, May 06, 2026 at 10:11:31AM +0200, Antoine Bouyer wrote: > On 5/5/26 4:12 PM, Jacopo Mondi wrote: > > > > > > Rename v4l2_isp_params_buffer_size() to v4l2_isp_buffer_size() to > > support statistics. > > > > Signed-off-by: Jacopo Mondi > > --- > > .../media/platform/arm/mali-c55/mali-c55-params.c | 12 ++++++------ > > Hi Jacopo > > Is it ok to meld driver and include changes and remove all occurrences of > v4l2_isp_params_buffer_size ? Of course it prevents build errors, but what > if pending changes are already using this macro ? This is an internal header, we don't keep compatibility for internal kAPI symbols. If you're referring to your in-review patches which use the now renamed 'v4l2_isp_params_buffer_size' symbol, I'm sorry but we'll have to synchronize here, there's no way around it. > > include/media/v4l2-isp.h | 22 > +++++++++++++--------- > > 2 files changed, 19 insertions(+), 15 deletions(-) > > > > diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-params.c b/drivers/media/platform/arm/mali-c55/mali-c55-params.c > > index de0e9d898db7..dc483f0322d6 100644 > > --- a/drivers/media/platform/arm/mali-c55/mali-c55-params.c > > +++ b/drivers/media/platform/arm/mali-c55/mali-c55-params.c > > @@ -487,7 +487,7 @@ static int mali_c55_params_g_fmt_meta_out(struct file *file, void *fh, > > { > > static const struct v4l2_meta_format mfmt = { > > .dataformat = V4L2_META_FMT_MALI_C55_PARAMS, > > - .buffersize = v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE), > > + .buffersize = v4l2_isp_buffer_size(MALI_C55_PARAMS_MAX_SIZE), > > }; > > > > f->fmt.meta = mfmt; > > @@ -540,13 +540,13 @@ mali_c55_params_queue_setup(struct vb2_queue *q, unsigned int *num_buffers, > > if (*num_planes && *num_planes > 1) > > return -EINVAL; > > > > - if (sizes[0] && sizes[0] < v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE)) > > + if (sizes[0] && sizes[0] < v4l2_isp_buffer_size(MALI_C55_PARAMS_MAX_SIZE)) > > return -EINVAL; > > > > *num_planes = 1; > > > > if (!sizes[0]) > > - sizes[0] = v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE); > > + sizes[0] = v4l2_isp_buffer_size(MALI_C55_PARAMS_MAX_SIZE); > > > > return 0; > > } > > @@ -556,7 +556,7 @@ static int mali_c55_params_buf_init(struct vb2_buffer *vb) > > struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); > > struct mali_c55_params_buf *buf = to_mali_c55_params_buf(vbuf); > > > > - buf->config = kvmalloc(v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE), > > + buf->config = kvmalloc(v4l2_isp_buffer_size(MALI_C55_PARAMS_MAX_SIZE), > > GFP_KERNEL); > > if (!buf->config) > > return -ENOMEM; > > @@ -583,7 +583,7 @@ static int mali_c55_params_buf_prepare(struct vb2_buffer *vb) > > int ret; > > > > ret = v4l2_isp_params_validate_buffer_size(mali_c55->dev, vb, > > - v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE)); > > + v4l2_isp_buffer_size(MALI_C55_PARAMS_MAX_SIZE)); > > if (ret) > > return ret; > > > > @@ -593,7 +593,7 @@ static int mali_c55_params_buf_prepare(struct vb2_buffer *vb) > > * changed to the buffer content whilst the driver processes it. > > */ > > > > - memcpy(buf->config, config, v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE)); > > + memcpy(buf->config, config, v4l2_isp_buffer_size(MALI_C55_PARAMS_MAX_SIZE)); > > > > return v4l2_isp_params_validate_buffer(mali_c55->dev, vb, buf->config, > > mali_c55_params_block_types_info, > > diff --git a/include/media/v4l2-isp.h b/include/media/v4l2-isp.h > > index f3a6d0edcb24..d70ed6b431e7 100644 > > --- a/include/media/v4l2-isp.h > > +++ b/include/media/v4l2-isp.h > > @@ -15,17 +15,21 @@ struct device; > > struct vb2_buffer; > > > > /** > > - * v4l2_isp_params_buffer_size - Calculate size of v4l2_isp_params_buffer > > - * @max_params_size: The total size of the ISP configuration blocks > > + * v4l2_isp_buffer_size - Calculate size of v4l2_isp_buffer > > + * @max_size: The total size of the ISP configuration or statistics blocks > > + * > > + * Users of v4l2-isp will have differing sized data arrays for parameters and > > + * statistics, depending on their specific blocks. Drivers need to be able to > > + * calculate the appropriate size of the buffer to accommodate all ISP blocks > > + * supported by the platform. This macro provides a convenient tool for the > > + * calculation. > > + * > > + * The intended users of this function are drivers initializing the size > > + * of their metadata (parameters and statistics) buffers. > > * > > - * Users of the v4l2 extensible parameters will have differing sized data arrays > > - * depending on their specific parameter buffers. Drivers and userspace will > > - * need to be able to calculate the appropriate size of the struct to > > - * accommodate all ISP configuration blocks provided by the platform. > > - * This macro provides a convenient tool for the calculation. > > */ > > -#define v4l2_isp_params_buffer_size(max_params_size) \ > > - (offsetof(struct v4l2_isp_params_buffer, data) + (max_params_size)) > > +#define v4l2_isp_buffer_size(max_size) \ > > + (offsetof(struct v4l2_isp_buffer, data) + (max_size)) > > Shouldn't we keep v4l2_isp_params_buffer_size for compatibility ? I don't think so, no. This is internal stuff, not exposed to userspace. We should port all existing users to the new symbol, don't we ? > > BR > Antoine Thanks! > > > > > /** > > * v4l2_isp_params_validate_buffer_size - Validate a V4L2 ISP buffer sizes > > > > -- > > 2.53.0 > > > >