From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 16BB9CCFA1E for ; Tue, 11 Nov 2025 16:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FX0Tr3wA+60t+I3KZ0qACuUXZ73lmcc+35fW/uWzDPE=; b=Tq4dSFrDJCPBufj2cfFwS2qsNL fublKN6u3+tp7UE18Tm4E4NtBHpcDg8jD0uhtv/wgEcSDXjbM1OjbiWyzYd4AFAGyRcMlvz/d+SLq iznUFKc1GuGE5KwUVbT4tKQzk9gZ9gzrUlwLbAYMgMghe0dclQCL7GnIH7uE0z6PrincpqqNNc+hZ tN0pTpdbiSSsRjbvr0IFrtPAGvbbaPmZuEhygtMnQRt3hzzTCZAuxkz1jRYT3cjOUnWyzCPbQVWaz XF40fMtdGpHijXn0CNrO3l4qETrCWsp3nPzmKC1BqCmqh/HS6Lbfp5FRAyz1h1Qvv2OXAMGX1wkqq gsgPYSjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vIr2m-00000007RjF-0XYG; Tue, 11 Nov 2025 16:16:32 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vIr2a-00000007RTK-0oYC for linux-arm-kernel@lists.infradead.org; Tue, 11 Nov 2025 16:16:21 +0000 Received: from [127.0.1.1] (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A47F621D1; Tue, 11 Nov 2025 17:14:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1762877660; bh=MlqoL71sXfpHIumYTfnOfJftJTYvAO7+PqJagHAsZy8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Oh81vS7riHm2qb956pJXOtC/hY2o3GSmzstz8NI9qFIIXCQ1IrxcfFU75JEPMEf6z pOkkT1fz+1WLXygBspUS6rsar3jnvm2ffJlLEYBkzRra0oj4Jtnca6gE+LXlyZeGqY ZCKhiK015UiuHnEKmoLbUA89P1IZnB03motadscU= From: Daniel Scally Date: Tue, 11 Nov 2025 16:15:59 +0000 Subject: [PATCH v13 15/15] Documentation: mali-c55: Document the mali-c55 parameter setting MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251111-c55-v13-15-3dc581355e3a@ideasonboard.com> References: <20251111-c55-v13-0-3dc581355e3a@ideasonboard.com> In-Reply-To: <20251111-c55-v13-0-3dc581355e3a@ideasonboard.com> To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Anthony.McGivern@arm.com, jacopo.mondi@ideasonboard.com, nayden.kanchev@arm.com, robh+dt@kernel.org, mchehab@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jerome.forissier@linaro.org, kieran.bingham@ideasonboard.com, laurent.pinchart@ideasonboard.com, dan.scally@ideasonboard.com, Sakari Ailus , Lad Prabhakar X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6232; i=dan.scally@ideasonboard.com; h=from:subject:message-id; bh=MlqoL71sXfpHIumYTfnOfJftJTYvAO7+PqJagHAsZy8=; b=owEBbQKS/ZANAwAKAchJV3psRXUyAcsmYgBpE2FFw0z4/t7C1ZhRz+jpxrvTKNcVFS3aPKDyg +Kdrb6AK3+JAjMEAAEKAB0WIQQqyuwyDnZdb+mxmm/ISVd6bEV1MgUCaRNhRQAKCRDISVd6bEV1 MixQD/49Te/JVEjVd6tq1GdjPB8hZ64ONAXOKcjqBi+rY63DLUrWZXjBOaNGmk/GtgU1NDMFFM9 1V8lwNddQEEV40Zh8seRtUcevaOKkeu9B2GzWXVJO1sPxnJEiVcacpUg+K97HeeTFX8+A22zLgf PJI1XoEq/wkOBTCZy80+a/rvpA72lnpsNXCPBKWUtuuvui46cH8oha2wdT5nrQQA6DAZ01ap9zi cNc00l72cer/9S0GbQnA9RbCS7dluQRNt8O0AwiUEN0REq5MpPUFXddjx/FKZgVg8Twe+NpbL1E 3QfZFSECcQ1sgeClIrjKZEo5v7Dhxq0ByA3Eb+l8u9SBtACNI0Qrxi0GU67Xi9uY318wOhsnRqX iwAmhNrvEVp4PIazQp3eRnPWyARLqX4t8c7jZoI8pQ/rxFYVHPhnCY0+P1aRD+U3TBvMwrdUHA7 CC8kR2S7fpPFX2qayghpx4cHoA615f4C2mrIz30o3XRijk+wVQuyhMZZtDwkV1NRgE7bZKj8dRz fV82vcMDBGkCquDgcdXrt/IxHjFI3Thcm9/zzpvUuzM+T6GJhWcM6n4+gsGfaljWKOK2aM+oLDt DdoOdqwg0mJI1r0yhKLC+T71a+X1+pfLM1hkj2YyWquY3HDceBCXKYQyKbolt4ShMVgoTNPTaIw uMCpooV6bFrGIIw== X-Developer-Key: i=dan.scally@ideasonboard.com; a=openpgp; fpr=EEC699ACA1B7CB5D31330C0BBD501C2A3546CCF6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251111_081620_385204_628DEF59 X-CRM114-Status: GOOD ( 16.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document the mali-c55 parameter setting by expanding the relevant pages in both admin-guide/ and userspace-api/. Tested-by: Lad Prabhakar Reviewed-by: Laurent Pinchart Acked-by: Nayden Kanchev Co-developed-by: Jacopo Mondi Signed-off-by: Jacopo Mondi Signed-off-by: Daniel Scally --- Changes in v12: - None Changes in v11: - Updated the documentation to account for the use of the V4L2 extensible params Changes in v10: - None Changes in v9: - None Changes in v8: - None Changes in v7: - None Changes in v7: - None Changes in v6: - Minor rewording Changes in v5: - New patch --- Documentation/admin-guide/media/mali-c55.rst | 19 ++++++- .../media/v4l/metafmt-arm-mali-c55.rst | 66 +++++++++++++++++++++- 2 files changed, 80 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/media/mali-c55.rst b/Documentation/admin-guide/media/mali-c55.rst index 03723e0e8e43f17a04ede0032b2ddbfdb859d1e3..315f982000c48e46a2be0e7210b657d5af611e14 100644 --- a/Documentation/admin-guide/media/mali-c55.rst +++ b/Documentation/admin-guide/media/mali-c55.rst @@ -387,9 +387,24 @@ the processing flow the statistics can be drawn from:: +-------------+ | +-------------+ +--> AWB-1 -At present all statistics are drawn from the 0th tap point for each algorithm; +By default all statistics are drawn from the 0th tap point for each algorithm; I.E. AEXP statistics from AEXP-0 (A), AWB statistics from AWB-0 and AF -statistics from AF-0. In the future this will be configurable. +statistics from AF-0. This is configurable for AEXP and AWB statsistics through +programming the ISP's parameters. + +.. _mali-c55-3a-params: + +Programming ISP Parameters +========================== + +The ISP can be programmed with various parameters from userspace to apply to the +hardware before and during video stream. This allows userspace to dynamically +change values such as black level, white balance and lens shading gains and so +on. + +The buffer format and how to populate it are described by the +:ref:`V4L2_META_FMT_MALI_C55_PARAMS ` format, +which should be set as the data format for the `mali-c55 3a params` video node. References ========== diff --git a/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst b/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst index 0bda9740a6be20df541ac7cf78e45e510f79ad19..49d6b8080ecec1013a93f5283a00a3fa0d7ebb17 100644 --- a/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst +++ b/Documentation/userspace-api/media/v4l/metafmt-arm-mali-c55.rst @@ -1,10 +1,11 @@ .. SPDX-License-Identifier: GPL-2.0 +.. _v4l2-meta-fmt-mali-c55-params: .. _v4l2-meta-fmt-mali-c55-stats: -************************************* -V4L2_META_FMT_MALI_C55_STATS ('C55S') -************************************* +***************************************************************************** +V4L2_META_FMT_MALI_C55_STATS ('C55S'), V4L2_META_FMT_MALI_C55_PARAMS ('C55P') +***************************************************************************** 3A Statistics ============= @@ -23,6 +24,65 @@ of the C structure :c:type:`mali_c55_stats_buffer` defined in For details of the statistics see :c:type:`mali_c55_stats_buffer`. +Configuration Parameters +======================== + +The configuration parameters are passed to the +:ref:`mali-c55 3a params ` 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 Mali-C55 +use the V4L2 extensible 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_params_buffer`. Userspace is responsible for populating +the data member with the blocks that need to be configured by the 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 consecutive +in the buffer. To assist both userspace and the driver in identifying the +blocks each block-specific struct embeds :c:type:`v4l2_params_block_header` as +its first member and userspace must populate the type member with a value from +:c:type:`mali_c55_param_block_type`. Once the blocks have been populated +into the data buffer, the combined size of all populated blocks shall be set in +the data_size member of :c:type:`v4l2_params_buffer`. For example: + +.. code-block:: c + + struct v4l2_params_buffer *params = + (struct v4l2_params_buffer *)buffer; + + params->version = MALI_C55_PARAM_BUFFER_V1; + params->data_size = 0; + + void *data = (void *)params->data; + + struct mali_c55_params_awb_gains *gains = + (struct mali_c55_params_awb_gains *)data; + + gains->header.type = MALI_C55_PARAM_BLOCK_AWB_GAINS; + gains->header.flags |= V4L2_PARAMS_FL_BLOCK_ENABLE; + gains->header.size = sizeof(struct mali_c55_params_awb_gains); + + gains->gain00 = 256; + gains->gain00 = 256; + gains->gain00 = 256; + gains->gain00 = 256; + + data += sizeof(struct mali_c55_params_awb_gains); + params->data_size += sizeof(struct mali_c55_params_awb_gains); + + struct mali_c55_params_sensor_off_preshading *blc = + (struct mali_c55_params_sensor_off_preshading *)data; + + blc->header.type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS; + blc->header.flags |= V4L2_PARAMS_FL_BLOCK_ENABLE; + blc->header.size = sizeof(struct mali_c55_params_sensor_off_preshading); + + blc->chan00 = 51200; + blc->chan01 = 51200; + blc->chan10 = 51200; + blc->chan11 = 51200; + + params->total_size += sizeof(struct mali_c55_params_sensor_off_preshading); + Arm Mali-C55 uAPI data types ============================ -- 2.43.0