From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
"Hans Verkuil" <hverkuil+cisco@kernel.org>
Cc: Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
Jai Luthra <jai.luthra+renesas@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Subject: Re: [PATCH v9 03/13] media: rppx1: Add framework to support Dreamchip RPPX1 ISP
Date: Wed, 3 Jun 2026 12:56:32 +0200 [thread overview]
Message-ID: <aiAHZnFg6UvFf0Xd@zed> (raw)
In-Reply-To: <20260516211320.3041412-4-niklas.soderlund+renesas@ragnatech.se>
Hi Niklas,
let me point Hans to a single part of this patch then I'll review
the rest
On Sat, May 16, 2026 at 11:13:10PM +0200, Niklas Söderlund wrote:
[snip]
> diff --git a/Documentation/userspace-api/media/v4l/metafmt-rppx1.rst b/Documentation/userspace-api/media/v4l/metafmt-rppx1.rst
> new file mode 100644
> index 000000000000..ad256ae1c1b2
> --- /dev/null
> +++ b/Documentation/userspace-api/media/v4l/metafmt-rppx1.rst
> @@ -0,0 +1,99 @@
> +.. SPDX-License-Identifier: GPL-2.0
> +
> +.. _v4l2-meta-fmt-rppx1-params:
> +.. _v4l2-meta-fmt-rppx1-stats:
> +
> +*************************************************************************
> +V4L2_META_FMT_RPP_X1_PARAMS ('DR1P'), V4L2_META_FMT_RPP_X1_STATS ('DR1S')
> +*************************************************************************
> +
> +Configuration Parameters
> +========================
> +
> +The configuration parameters are passed to the metadata output video node, using
> +the :c:type:`v4l2_meta_format` interface. Rather than a single struct containing
> +sub-structs for each configurable area of the ISP, parameters for the Dreamchip
> +RPPX1 use the v4l2-isp parameters system, through which groups of parameters are
> +defined as distinct structs or "blocks" which may be added to the data member of
> +:c:type:`v4l2_isp_buffer`. Userspace is responsible for populating the data
> +member with the blocks that need to be configured by the driver. Each
> +block-specific struct embeds :c:type:`v4l2_isp_block_header` as its first member
> +and userspace must populate the type member with a value from
> +:c:type:`rppx1_params_block_type`.
> +
> +.. code-block:: c
> +
> + struct v4l2_isp_params_buffer *params =
> + (struct v4l2_isp_params_buffer *)buffer;
> +
> + params->version = V4L2_ISP_PARAMS_VERSION_V1;
> + params->data_size = 0;
> +
> + void *data = (void *)params->data;
> +
> + struct rppx1_ccor_params *ccor =
> + (struct rppx1_ccor_params *)data;
> +
> + ccor->header.type = RPPX1_PARAMS_BLOCK_TYPE_CCOR_POST;
> + ccor->header.flags |= V4L2_ISP_PARAMS_FL_BLOCK_ENABLE;
> + ccor->header.size = sizeof(struct rppx1_ccor_params);
> +
> + ccor->coeff[0][0] = 0x1000;
> + ccor->coeff[0][1] = 0x0000;
> + ccor->coeff[0][2] = 0x0000;
> + ccor->coeff[1][0] = 0x0000;
> + ccor->coeff[1][1] = 0x1000;
> + ccor->coeff[1][2] = 0x0000;
> + ccor->coeff[2][0] = 0x0000;
> + ccor->coeff[2][1] = 0x0000;
> + ccor->coeff[2][2] = 0x1000;
> +
> + ccor->offset[0] = 0x200000;
> + ccor->offset[1] = 0x200000;
> + ccor->offset[2] = 0x200000;
> +
> + data += sizeof(struct rppx1_ccor_params);
> + params->data_size += sizeof(struct rppx1_ccor_params);
> +
> +3A Statistics
> +=============
> +
> +The ISP device collects different statistics over an input bayer frame. Those
> +statistics can be obtained by userspace from the metadata capture video node,
> +using the :c:type:`v4l2_meta_format` interface. Rather than a single struct
> +containing sub-structs for each statistics area of the ISP, statistics for the
> +Dreamchip RPPX1 use the v4l2-isp statistics system, through which groups of
> +statistics are defined as distinct structs or "blocks" which may be added to the
> +data member of :c:type:`v4l2_isp_buffer`. Userspace is responsible for parsing
> +the buffer and extracting the blocks of statistics. Each block-specific struct
> +embeds :c:type:`v4l2_isp_block_header` as its first member and userspace must
> +interpret the type member with a value from :c:type:`rppx1_stats_block_type`.
> +
> +.. code-block:: C
> +
> + const struct v4l2_isp_buffer *stats =
> + (struct v4l2_isp_buffer *)buf;
> + size_t block_offset = 0;
> +
> + while (block_offset < stats->data_size) {
> + const struct v4l2_isp_stats_block_header *block =
> + (void*)(stats->data + block_offset);
> +
> + block_offset += block->size;
> +
> + switch (block->type) {
> + case RPPX1_STATS_BLOCK_TYPE_HIST_POST:
> + for (unsigned int i = 0; i < RPPX1_HIST_NUM_BINS; i++)
> + printf("hist.hist_bins[%u] = 0x%08x\n",
> + i, hist.hist_bins[%i]);
> + break;
> + default:
> + printf("Unknown block type 0x%04x", block->type);
> + break;
> + }
> + }
> +
> +Dreamchip RPPX1 uAPI data types
> +===============================
> +
> +.. kernel-doc:: include/uapi/linux/media/dreamchip/rppx1-config.h
Hans, compare this with the existing (for example) Mali documentation
in Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst
The Mali one is short on the stats part, but here there's is really
nothing that is platform specific apart from the reference to the uAPI
file here above.
One reason why we want generic formats is exactly because we're
repeating this documentation bits on every formats, without them
adding much if anything at all.
Thanks
j
next prev parent reply other threads:[~2026-06-03 10:56 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 21:13 [PATCH v9 00/13] media: Add support for R-Car ISP using Dreamchip RPPX1 ISP Niklas Söderlund
2026-05-16 21:13 ` [PATCH v9 01/13] media: Add RPP_X1_PARAMS and RPP_X1_STATS meta formats Niklas Söderlund
2026-06-03 10:49 ` Jacopo Mondi
2026-06-03 12:48 ` Niklas Söderlund
2026-05-16 21:13 ` [PATCH v9 02/13] media: uapi: Add extensible param and stats blocks for RPPX1 Niklas Söderlund
2026-06-03 10:50 ` Jacopo Mondi
2026-06-03 12:55 ` Niklas Söderlund
2026-05-16 21:13 ` [PATCH v9 03/13] media: rppx1: Add framework to support Dreamchip RPPX1 ISP Niklas Söderlund
2026-06-03 10:56 ` Jacopo Mondi [this message]
2026-06-03 12:24 ` Jacopo Mondi
2026-06-03 13:47 ` Niklas Söderlund
2026-06-03 14:26 ` Jacopo Mondi
2026-06-03 15:17 ` Niklas Söderlund
2026-06-03 15:33 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 04/13] media: rcar-isp: Add support for ISPCORE Niklas Söderlund
2026-06-03 13:15 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 05/13] media: rppx1: wbmeas: Add support for white balance measurement Niklas Söderlund
2026-06-03 13:35 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 06/13] media: rppx1: awbg: Add support for white balance gain settings Niklas Söderlund
2026-06-03 13:38 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 07/13] media: rppx1: exm: Add support for exposure measurement Niklas Söderlund
2026-06-03 13:57 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 08/13] media: rppx1: hist: Add support histogram measurement Niklas Söderlund
2026-06-03 14:11 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 09/13] media: rppx1: bls: Add support for black level compensation Niklas Söderlund
2026-05-16 21:13 ` [PATCH v9 10/13] media: rppx1: ccor: Add support for color correction matrix Niklas Söderlund
2026-05-16 21:13 ` [PATCH v9 11/13] media: rppx1: lsc: Add support for lens shade correction Niklas Söderlund
2026-06-03 14:32 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 12/13] media: rppx1: ga: Add support for gamma out correction Niklas Söderlund
2026-06-03 14:33 ` Jacopo Mondi
2026-05-16 21:13 ` [PATCH v9 13/13] media: rppx1: lin: Add support for gamma sensor linearization Niklas Söderlund
2026-06-03 14:36 ` Jacopo Mondi
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=aiAHZnFg6UvFf0Xd@zed \
--to=jacopo.mondi@ideasonboard.com \
--cc=hverkuil+cisco@kernel.org \
--cc=jacopo.mondi+renesas@ideasonboard.com \
--cc=jai.luthra+renesas@ideasonboard.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
/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