From nobody Fri Dec 19 20:36:41 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2E09B24110F; Sun, 27 Apr 2025 06:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745735245; cv=none; b=IkwNa4AgONRd4byuxgjB0QoFBQDHoxZy9AgO6cSyEsgxSfJicOu6RY9K/Os7HV6hq1yxSfqW0EiTSc3mTNiWcKT3mvYi/vcMm94Lwez++kIDWywhCbBpRV3HY7qJN9I9BXQmzrWEzk86BOalCsfdkvS4eSSJjvAc5gGAQdKMwHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745735245; c=relaxed/simple; bh=UV4OpBMoMTlShXKyn8UmyYCKddaIG6XlUTTU3xfZsLg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eHLgYqzTKbE2amabbHWR/IxHDngdeEL+J5u0KPExB+/M/1jjAlMI1DVh2x1pfoOPFzJSfbBZVv3PhiksUMGhHnsJooO2wKojg/I1qUL8NxYebKqrhPjX8lw5wFuV68MHaq+VDPxjojLya4UsW1OTDyUzjAzyrhSXktdmc3aJ744= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jlW2u0zW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jlW2u0zW" Received: by smtp.kernel.org (Postfix) with ESMTPS id AF921C4CEF4; Sun, 27 Apr 2025 06:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1745735244; bh=UV4OpBMoMTlShXKyn8UmyYCKddaIG6XlUTTU3xfZsLg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jlW2u0zW5r4ZKF8ZXrYEcU8IszTjm6iDcPX6gpL5r0pamoB6HN7VJy+YdHKA9SoFF StS3KY+sACE+1NmqzMdjtPw5S+UbInI0fpf3BF5V6bzH9v65SC6zUcGX6oDJ+Ob9YG a3p8V7zb5ykzZHIBlX3rJgEEWNyvf+SzXOYU6ZUlPwfvYcjsRNoKadIbNZ1/HJluBd R2j2lC0uiQf8U7gCFJtH0m+kPn0YfxUSfIQqygPf/QTkUm6GQ9AtftFmSfhzx3Hsl9 i3oBIb1hhdjt2kTpki4X9TvLotiB8Ne9DHG/TPMWF+VeA1TdW4OIpNxUzFjx5Rqz4L Rw9n6xAmYyopA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7C03C369D9; Sun, 27 Apr 2025 06:27:24 +0000 (UTC) From: Keke Li via B4 Relay Date: Sun, 27 Apr 2025 14:27:17 +0800 Subject: [PATCH v9 09/10] Documentation: media: add documentation file metafmt-c3-isp.rst 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-Transfer-Encoding: quoted-printable Message-Id: <20250427-c3isp-v9-9-e0fe09433d94@amlogic.com> References: <20250427-c3isp-v9-0-e0fe09433d94@amlogic.com> In-Reply-To: <20250427-c3isp-v9-0-e0fe09433d94@amlogic.com> To: Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, dan.scally@ideasonboard.com, jacopo.mondi@ideasonboard.com, Keke Li X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1745735242; l=5017; i=keke.li@amlogic.com; s=20240902; h=from:subject:message-id; bh=EtKmaDXYyLgan/JfVMq79P6TWGfHTe2a+kG7bKr0G0A=; b=WvAmsc5/hdrGRwpaQazfklpsIYhCcDVRmKcPaojQcxbEusXl8X9Lhd7QQaTH2W/VPrzKouMqU gzdXQNAbgZBAWtBzlvRDCxK14F/20jA7ssRetEpGIvuuTTwviU+I+/o X-Developer-Key: i=keke.li@amlogic.com; a=ed25519; pk=XxNPTsQ0YqMJLLekV456eoKV5gbSlxnViB1k1DhfRmU= X-Endpoint-Received: by B4 Relay for keke.li@amlogic.com/20240902 with auth_id=204 X-Original-From: Keke Li Reply-To: keke.li@amlogic.com From: Keke Li Add the file 'metafmt-c3-isp.rst' that documents the meta format of c3-isp. Reviewed-by: Jacopo Mondi Signed-off-by: Keke Li --- .../userspace-api/media/v4l/meta-formats.rst | 1 + .../userspace-api/media/v4l/metafmt-c3-isp.rst | 86 ++++++++++++++++++= ++++ MAINTAINERS | 1 + 3 files changed, 88 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/meta-formats.rst b/Docum= entation/userspace-api/media/v4l/meta-formats.rst index 86ffb3bc8ade..bb6876cfc271 100644 --- a/Documentation/userspace-api/media/v4l/meta-formats.rst +++ b/Documentation/userspace-api/media/v4l/meta-formats.rst @@ -12,6 +12,7 @@ These formats are used for the :ref:`metadata` interface = only. .. toctree:: :maxdepth: 1 =20 + metafmt-c3-isp metafmt-d4xx metafmt-generic metafmt-intel-ipu3 diff --git a/Documentation/userspace-api/media/v4l/metafmt-c3-isp.rst b/Doc= umentation/userspace-api/media/v4l/metafmt-c3-isp.rst new file mode 100644 index 000000000000..449b45c2ec24 --- /dev/null +++ b/Documentation/userspace-api/media/v4l/metafmt-c3-isp.rst @@ -0,0 +1,86 @@ +.. SPDX-License-Identifier: (GPL-2.0-only OR MIT) + +.. _v4l2-meta-fmt-c3isp-stats: +.. _v4l2-meta-fmt-c3isp-params: + +*********************************************************************** +V4L2_META_FMT_C3ISP_STATS ('C3ST'), V4L2_META_FMT_C3ISP_PARAMS ('C3PM') +*********************************************************************** + +.. c3_isp_stats_info + +3A Statistics +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The C3 ISP can collect different statistics over an input Bayer frame. +Those statistics are obtained from the "c3-isp-stats" metadata capture vid= eo nodes, +using the :c:type:`v4l2_meta_format` interface. +They are formatted as described by the :c:type:`c3_isp_stats_info` structu= re. + +The statistics collected are Auto-white balance, +Auto-exposure and Auto-focus information. + +.. c3_isp_params_cfg + +Configuration Parameters +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The configuration parameters are passed to the c3-isp-params metadata outp= ut video node, +using the :c:type:`v4l2_meta_format` interface. Rather than a single struc= t containing +sub-structs for each configurable area of the ISP, parameters for the C3-I= SP +are defined as distinct structs or "blocks" which may be added to the data +member of :c:type:`c3_isp_params_cfg`. Userspace is responsible for +populating the data member with the blocks that need to be configured by t= he driver, but +need not populate it with **all** the blocks, or indeed with any at all if= there +are no configuration changes to make. Populated blocks **must** be consecu= tive +in the buffer. To assist both userspace and the driver in identifying the +blocks each block-specific struct embeds +:c:type:`c3_isp_params_block_header` as its first member and userspace +must populate the type member with a value from +:c:type:`c3_isp_params_block_type`. Once the blocks have been populated +into the data buffer, the combined size of all populated blocks shall be s= et in +the data_size member of :c:type:`c3_isp_params_cfg`. For example: + +.. code-block:: c + + struct c3_isp_params_cfg *params =3D + (struct c3_isp_params_cfg *)buffer; + + params->version =3D C3_ISP_PARAM_BUFFER_V0; + params->data_size =3D 0; + + void *data =3D (void *)params->data; + + struct c3_isp_params_awb_gains *gains =3D + (struct c3_isp_params_awb_gains *)data; + + gains->header.type =3D C3_ISP_PARAMS_BLOCK_AWB_GAINS; + gains->header.flags =3D C3_ISP_PARAMS_BLOCK_FL_ENABLE; + gains->header.size =3D sizeof(struct c3_isp_params_awb_gains); + + gains->gr_gain =3D 256; + gains->r_gain =3D 256; + gains->b_gain =3D 256; + gains->gb_gain =3D 256; + + data +=3D sizeof(struct c3_isp__params_awb_gains); + params->data_size +=3D sizeof(struct c3_isp_params_awb_gains); + + struct c3_isp_params_awb_config *awb_cfg =3D + (struct c3_isp_params_awb_config *)data; + + awb_cfg->header.type =3D C3_ISP_PARAMS_BLOCK_AWB_CONFIG; + awb_cfg->header.flags =3D C3_ISP_PARAMS_BLOCK_FL_ENABLE; + awb_cfg->header.size =3D sizeof(struct c3_isp_params_awb_config); + + awb_cfg->tap_point =3D C3_ISP_AWB_STATS_TAP_BEFORE_WB; + awb_cfg->satur =3D 1; + awb_cfg->horiz_zones_num =3D 32; + awb_cfg->vert_zones_num =3D 24; + + params->data_size +=3D sizeof(struct c3_isp_params_awb_config); + +Amlogic C3 ISP uAPI data types +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D + +.. kernel-doc:: include/uapi/linux/media/amlogic/c3-isp-config.h diff --git a/MAINTAINERS b/MAINTAINERS index 82de88b82550..5bbfda5662b3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1263,6 +1263,7 @@ M: Keke Li L: linux-media@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/media/amlogic,c3-isp.yaml +F: Documentation/userspace-api/media/v4l/metafmt-c3-isp.rst F: drivers/media/platform/amlogic/c3/isp/ F: include/uapi/linux/media/amlogic/ =20 --=20 2.49.0