From patchwork Thu Jan 11 08:41:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changhuang Liang X-Patchwork-Id: 762367 Received: from CHN02-BJS-obe.outbound.protection.partner.outlook.cn (mail-bjschn02on2053.outbound.protection.partner.outlook.cn [139.219.17.53]) (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 8DDF711CAB; Thu, 11 Jan 2024 08:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jh4q8V2nlkwzpbOHB4j4PXedlu0XuaK7aEymfVJJe52r6Zyw7bcfmba3Aq5NTUbSBVfGffQxEQENLEmb4CuAxsdKChTmaReiwZ8jdcOCf/oOtPUhZhmI4sr0sih4v6jvsq/RhBoeHc04Vg3IVhnlY8Uf3cATWnpGSQNuYyuKr/iu3H3y1gKfktku93pRn4kAKr5Zkcj7HHZu0x3Pf7W5GWD0BZmUrDA+A0s4ptTje3bGrGiOor3zTTPTXCqm6zoVaQ+PO/qkFTTGZg5gVlW+ezfw9pCZKr3u/gdTPBjFwf//xPveUySgKjf1voQCgGQs7YQSIfYR1qUci9NU0r4w9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JMzsKjsZw2SixbzRykWPerHVvDK3lk5KvnsyKCCkru8=; b=YYo+i4gCH5lPQEwpajAn9t5MTNVb2ltl/rLw+Otjn5VLD22s6thhBP/nfAUowcInch9QySJWYsMKE68eVWJqozj16SJqbhhTNcYo4SBvCE45VT+66FkDA0vW7YNflEzwLfNcLw45un5hwI0r9xs1Qb8cUNPlZ57l++4mQR6P2E0QCiXacyRnEy6Jn0vfsmPn7W3Po1G1Xf2cSZJEaXKpLV1T1iriBLeVNm6tvmTNN18vgipY3AxADQzjlFfCI+3qVeDsnj327V9bMovpAyWtCPOM1TN9GQVjKYOZ4tgSofC3VCW+DTESJjBYMyBA+Qmbn6jCD8d1FgZML6KSPrcxQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SH0PR01MB0667.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:20::21) by SH0PR01MB0747.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:21::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.33; Thu, 11 Jan 2024 08:41:29 +0000 Received: from SH0PR01MB0667.CHNPR01.prod.partner.outlook.cn ([fe80::e255:98f3:ba27:8c7d]) by SH0PR01MB0667.CHNPR01.prod.partner.outlook.cn ([fe80::e255:98f3:ba27:8c7d%3]) with mapi id 15.20.7135.033; Thu, 11 Jan 2024 08:41:29 +0000 From: Changhuang Liang To: Mauro Carvalho Chehab , Greg Kroah-Hartman , Matthias Brugger , Hans Verkuil , Ming Qian , Laurent Pinchart , Nicolas Dufresne , Benjamin Gaignard , Tomi Valkeinen , Mingjia Zhang Cc: Jack Zhu , Changhuang Liang , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 02/13] media: Documentation: Add description for StarFive ISP metadata formats Date: Thu, 11 Jan 2024 00:41:09 -0800 Message-Id: <20240111084120.16685-3-changhuang.liang@starfivetech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240111084120.16685-1-changhuang.liang@starfivetech.com> References: <20240111084120.16685-1-changhuang.liang@starfivetech.com> X-ClientProxiedBy: NT0PR01CA0009.CHNPR01.prod.partner.outlook.cn (2406:e500:c510::19) To SH0PR01MB0667.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:20::21) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SH0PR01MB0667:EE_|SH0PR01MB0747:EE_ X-MS-Office365-Filtering-Correlation-Id: 759e6b94-8a80-40df-e313-08dc12811b07 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W47M8Qv860NSnpQQFDhx5P3MgumNBeKcMWwh3dscxsSmXU7ToRIey8SjwqrNOVU7cdfbv4Bx7zpOZ/rhyKJdReaKc6aXh/KWo10mz24wrEkWi0f4mtk0HLau52blz7A5byvW8ap2yB+S5egMj3R5Abb5EYl91kzXIzu3nb3/w1Z4oFkweRwx7lbcxzpW4JP5PwWTn6dw04wqQALzrMxGkfCWCxYlAs6M33PdVmnKmX61UYA5cpZ2o+hh5GNZjFEf922JjG8Zy8Le98cLe9ESN1/curoO/Yt7Q6gJD+jeJl8YzNt22KNpX4pF4mwTxTAEAY1n75OHaW/wELvml9tkobARRglKpIvT0O+SvwSIqqENgQdNJhwp7mLQ/LRynvGZ+1ua4/oW9g95U/ivUs1C3vYxepT0C8s62bk0AXxJsddAkleIBTi6FzTcGxymjADu5X2OW0wB79ufAl/gbMqgDLWm1rkcIe/GXa6cMwhuOqMx5dMnMiaEuexw1aeRzGNEpFKMZK6J0qLCx+X0KUlLCMZRRVugthNF8RgQxEpMGkl/6foX+Fteiu3sFrVRJpxSWm15dS2z+sM44ssesWUQPQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SH0PR01MB0667.CHNPR01.prod.partner.outlook.cn; PTR:; CAT:NONE; SFS:(13230031)(396003)(366004)(346002)(136003)(39830400003)(230922051799003)(186009)(1800799012)(451199024)(64100799003)(6666004)(52116002)(41300700001)(2616005)(508600001)(38100700002)(40160700002)(1076003)(26005)(86362001)(36756003)(921011)(38350700005)(83380400001)(110136005)(54906003)(66556008)(66946007)(66476007)(8676002)(8936002)(41320700001)(4326008)(44832011)(2906002)(40180700001)(5660300002)(7416002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jr2uEuAQ0AsGyP78SwtBqf+lmykfgNZ/+uiYltDp0xvU/3pbCD+w+iDownbeMVSpLyd04qXrBa6zsELHq1pB3/kMGLEM+W/zlSM/k1ETb4xXtP6WqN3k8i5CeMWblTrUOIau37gNyxDSOnIEWjKneA6RzTmZCJL044b24Fq+QGvWoa/FJTq9KPXKANiFRGsQEcWYbJgJ/EsW5KeawHvEpL9CAof7TCKhCkbhpJNHkssywNf7cv31zrmoSg8vk53p4JnrxpdrZS6rsNehRch9QzxuJwLhPvaaspASNPc0rpclrxtmuTR7dOHvZXBN4LnSaQrzPw9ZJx63YVYc4/FfUKRYo3DlhMN97e8cQf21NjTHFcl+YbIgoneUv8BCipbvKki8toMT9DqI9kMsxmvq5sxWbUjzjNm5dNsHMgUIeI1TSIxZWt7te/1E29uhZxvqSE8owWdIOnDYvyy4rA1CIhEx30RgqnDH0IfXEIoDsLG1g9O9fguLkGYQ7tok30SXVS1Vjrg0iQ5D/N8bYtfdFDbbpGyb4PMJmP0DbAaWb+AUZ+2onigL1RpJzeYH6mf9HgAF8oJAqfpEiUnX5xyoKBPnb3vaW5o/qhqIinIHLC5TJgGW+hVlqP+lRfpJ3fDbLKk0bbn+aWJQKwPasFd3PJX8VVvCjXOyvTwpRn4TOoIAfcN3V7tpnFGLcIERpuMdhUw54K2SUJ55WWc8lACthN2AW0RqNNBPkO8oAinMLxhnoP+2TGs5HVPpmYmq2PfCXAcQSqXA9VooZsnpIzdUT4HWnDk2pmYtayvA6TTGwqW6VoVlsZqlaLNFUsRpAKlaMR5Aa9MBHINQvYBJaSzTJa0Hg438W3zgYhNfvXIUiehMROY21bkBq4KdXeYopJg7FoDMOTsSZj39KO8qOeTNQLNUhZ8OVtt6RQWzmSXCcy/jDd625+GpclPrvLC+k3AJfSlZ9o6mUDjkdPoXvsQf6j+jjr5sLgt1dYFpamBWp1h5B3g8stbSPHopgNb2ZIu0KrmlcIdu2mRI6b3euWxrZ7Y8UTNx4XoUkQZ19fCXq/zXBBXN10HHoAPUqTJG2VM+JLflfsHxt6R/DKqNnHr2qOZSgzyzmOt6e71wIl4JeiiC9tvAqatLIBSrTiDeStKn/GeJ/dvUwQilS53nOJ5m22vrM1gCABQsvxAwJ2kCn93DBfm70mBoLl/9LuQkts0Z943elT0cd6r1XmPNTd+OOeiy+Xt6epxVVJrYEHt+tPyKH4kYJ3u1LEEO0oW3EYmLuWtqmlodOekU1dePAFg9xvM3wMOgY4FbH9puGxTZFYMKAHz0HpOYunVMqmSmRB63wieDDY2vLZVadHtidmjCcKm/7cstgnm1qFSL3Wcm3EH2Zni5n3hymmHcvAicpLip/VOFoRBIZRTmAsMSkA/fbxIXZfaAs465r62gScBDQKzS9z0Sdo65AC0ws6X8BdTyj1gBcJU3Dgx8pq8SQy+kWAHWkPyKyeiNZjFr6388oLLLkJFuRUh83TBAhNRhPzI/N6tlvtkYAmkZGf/8xW8WAgrUYXdlMalrbWl6mGdKl54aUykB85n8EDBDk275QRJyWZ0tqdUmR4EEZBmXgfJyyVVpihBz+y2gBiMTkxTekkA= X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 759e6b94-8a80-40df-e313-08dc12811b07 X-MS-Exchange-CrossTenant-AuthSource: SH0PR01MB0667.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2024 08:41:29.4241 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gju2jPok65FiFZm6lOZgigYrAOFzKAF0RyUFLhRFcb3+SXVtjFNvRPfC72TcOBwRtStPJGQwu0mhmWcLjcBlF35IX0FOBA2NnjMfX+NftqJWR0U/dd0rus4LoRUe+ith X-MS-Exchange-Transport-CrossTenantHeadersStamped: SH0PR01MB0747 Add description for V4L2_META_FMT_STF_ISP_PARAMS and V4L2_META_FMT_STF_ISP_STAT_3A meta data formats. Signed-off-by: Changhuang Liang --- .../media/v4l/metafmt-starfive-isp.rst | 75 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 76 insertions(+) create mode 100644 Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst diff --git a/Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst b/Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst new file mode 100644 index 000000000000..46c5193f5722 --- /dev/null +++ b/Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst @@ -0,0 +1,75 @@ +.. SPDX-License-Identifier: GPL-2.0 + +.. _v4l2-meta-fmt-stf-isp-params: + +.. _v4l2-meta-fmt-stf-isp-stat-3a: + +***************************************************************************** +V4L2_META_FMT_STF_ISP_PARAMS ('stfp'), V4L2_META_FMT_STF_ISP_STAT_3A ('stfs') +***************************************************************************** + +.. jh7110_isp_params_buffer + +Configuration parameters +======================== + +The configuration parameters are passed to the "output_params" metadata output +video node, using the :c:type:`v4l2_meta_format` interface. They are formatted +as described by the :c:type:`jh7110_isp_params_buffer` structure. + +.. code-block:: c + + struct jh7110_isp_params_buffer { + __u32 enable_setting; + struct jh7110_isp_wb_setting wb_setting; + struct jh7110_isp_car_setting car_setting; + struct jh7110_isp_ccm_setting ccm_setting; + struct jh7110_isp_cfa_setting cfa_setting; + struct jh7110_isp_ctc_setting ctc_setting; + struct jh7110_isp_dbc_setting dbc_setting; + struct jh7110_isp_dnyuv_setting dnyuv_setting; + struct jh7110_isp_gmargb_setting gmargb_setting; + struct jh7110_isp_lccf_setting lccf_setting; + struct jh7110_isp_obc_setting obc_setting; + struct jh7110_isp_oecf_setting oecf_setting; + struct jh7110_isp_r2y_setting r2y_setting; + struct jh7110_isp_sat_setting sat_setting; + struct jh7110_isp_sharp_setting sharp_setting; + struct jh7110_isp_ycrv_setting ycrv_setting; + struct jh7110_isp_sc_setting sc_setting; + }; + +.. jh7110_isp_sc_buffer + +3A and histogram statistics +=========================== + +The ISP1 device collects different statistics over an input Bayer frame. +Those statistics are obtained from the "capture_scd" metadata capture video +node, using the :c:type:`v4l2_meta_format` interface. They are formatted as +described by the :c:type:`jh7110_isp_sc_buffer` structure. + +.. code-block:: c + + struct jh7110_isp_sc_buffer { + __u32 y_histogram[64]; + __u32 reserv0[33]; + __u32 bright_sc[4096]; + __u32 reserv1[96]; + __u32 ae_hist_y[128]; + __u32 reserv2[511]; + __u16 flag; + }; + +The statistics collected are Auto Exposure, AWB (Auto-white balance), Histogram +and AF (Auto-focus). See :c:type:`jh7110_isp_sc_buffer` for details of the +statistics. + +The 3A statistics and configuration parameters described here are usually +consumed and produced by dedicated user space libraries that comprise the +important tuning tools using software control loop. + +JH7110 ISP uAPI data types +====================== + +.. kernel-doc:: include/uapi/linux/jh7110-isp.h diff --git a/MAINTAINERS b/MAINTAINERS index 0b47e88a51dd..3b8565b69ac2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20688,6 +20688,7 @@ L: linux-media@vger.kernel.org S: Maintained F: Documentation/admin-guide/media/starfive_camss.rst F: Documentation/devicetree/bindings/media/starfive,jh7110-camss.yaml +F: Documentation/userspace-api/media/v4l/metafmt-starfive-isp.rst F: drivers/staging/media/starfive/camss F: include/uapi/linux/jh7110-isp.h