← Documents Documentation/userspace-api/media/v4l/metafmt-c3-isp.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

C3 ISP 통계 및 매개변수 메타데이터

Amlogic C3 ISP의 3A 통계와 연속 parameter block 출력 버퍼 계약을 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/metafmt-c3-isp.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

metafmt-c3-isp.rst:1-86

C3ST는 AWB·AE·AF 통계를 캡처하고 C3PM은 공통 헤더가 있는 가변 블록을 연속 배치해 ISP 변경 매개변수를 전달합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: (GPL-2.0-only OR MIT)
2
3 .. _v4l2-meta-fmt-c3isp-stats:
4 .. _v4l2-meta-fmt-c3isp-params:
5
6 ***********************************************************************
7 V4L2_META_FMT_C3ISP_STATS ('C3ST'), V4L2_META_FMT_C3ISP_PARAMS ('C3PM')
8 ***********************************************************************
9
10 .. c3_isp_stats_info
11
12 3A Statistics
13 =============
14
15 The C3 ISP can collect different statistics over an input Bayer frame.
16 Those statistics are obtained from the "c3-isp-stats" metadata capture video nodes,
17 using the :c:type:`v4l2_meta_format` interface.
18 They are formatted as described by the :c:type:`c3_isp_stats_info` structure.
19
20 The statistics collected are Auto-white balance,
21 Auto-exposure and Auto-focus information.
22
23 .. c3_isp_params_cfg
24
25 Configuration Parameters
26 ========================
27
28 The configuration parameters are passed to the c3-isp-params metadata output video node,
29 using the :c:type:`v4l2_meta_format` interface. Rather than a single struct containing
30 sub-structs for each configurable area of the ISP, parameters for the C3-ISP
31 are defined as distinct structs or "blocks" which may be added to the data
32 member of :c:type:`c3_isp_params_cfg`. Userspace is responsible for
33 populating the data member with the blocks that need to be configured by the driver, but
34 need not populate it with **all** the blocks, or indeed with any at all if there
35 are no configuration changes to make. Populated blocks **must** be consecutive
36 in the buffer. To assist both userspace and the driver in identifying the
37 blocks each block-specific struct embeds
38 :c:type:`c3_isp_params_block_header` as its first member and userspace
39 must populate the type member with a value from
40 :c:type:`c3_isp_params_block_type`. Once the blocks have been populated
41 into the data buffer, the combined size of all populated blocks shall be set in
42 the data_size member of :c:type:`c3_isp_params_cfg`. For example:
43
44 .. code-block:: c
45
46 struct c3_isp_params_cfg *params =
47 (struct c3_isp_params_cfg *)buffer;
48
49 params->version = C3_ISP_PARAM_BUFFER_V0;
50 params->data_size = 0;
51
52 void *data = (void *)params->data;
53
54 struct c3_isp_params_awb_gains *gains =
55 (struct c3_isp_params_awb_gains *)data;
56
57 gains->header.type = C3_ISP_PARAMS_BLOCK_AWB_GAINS;
58 gains->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
59 gains->header.size = sizeof(struct c3_isp_params_awb_gains);
60
61 gains->gr_gain = 256;
62 gains->r_gain = 256;
63 gains->b_gain = 256;
64 gains->gb_gain = 256;
65
66 data += sizeof(struct c3_isp__params_awb_gains);
67 params->data_size += sizeof(struct c3_isp_params_awb_gains);
68
69 struct c3_isp_params_awb_config *awb_cfg =
70 (struct c3_isp_params_awb_config *)data;
71
72 awb_cfg->header.type = C3_ISP_PARAMS_BLOCK_AWB_CONFIG;
73 awb_cfg->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
74 awb_cfg->header.size = sizeof(struct c3_isp_params_awb_config);
75
76 awb_cfg->tap_point = C3_ISP_AWB_STATS_TAP_BEFORE_WB;
77 awb_cfg->satur = 1;
78 awb_cfg->horiz_zones_num = 32;
79 awb_cfg->vert_zones_num = 24;
80
81 params->data_size += sizeof(struct c3_isp_params_awb_config);
82
83 Amlogic C3 ISP uAPI data types
84 ===============================
85
86 .. kernel-doc:: include/uapi/linux/media/amlogic/c3-isp-config.h
87

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

3A 통계 캡처

1-24

Amlogic C3 ISP는 입력 Bayer 프레임에서 여러 통계를 수집합니다. `c3-isp-stats` 메타데이터 캡처 비디오 노드와 `v4l2_meta_format` 인터페이스를 통해 읽으며, 버퍼는 `c3_isp_stats_info` 구조 형식을 따릅니다.

수집되는 3A 통계
항목설명
AWBAuto-white balance, 자동 화이트 밸런스 정보
AEAuto-exposure, 자동 노출 정보
AFAuto-focus, 자동 초점 정보

ISP 자동 제어 알고리즘의 세 입력 범주입니다.

.. 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
=============

The C3 ISP can collect different statistics over an input Bayer frame.
Those statistics are obtained from the "c3-isp-stats" metadata capture video nodes,
using the :c:type:`v4l2_meta_format` interface.
They are formatted as described by the :c:type:`c3_isp_stats_info` structure.

The statistics collected are  Auto-white balance,
Auto-exposure and Auto-focus information.

.. c3_isp_params_cfg

연속 블록으로 전달하는 구성 매개변수

25-82

구성 매개변수는 `c3-isp-params` 메타데이터 출력 노드에 `v4l2_meta_format`으로 전달합니다. ISP의 모든 영역을 하위 구조로 묶은 단일 고정 구조 대신, 서로 다른 구조인 parameter block을 `c3_isp_params_cfg.data`에 필요한 만큼 이어 붙입니다.

사용자 공간은 이번 요청에서 바꿀 블록만 채우면 됩니다. 모든 블록을 보낼 필요가 없고 변경 사항이 없다면 하나도 넣지 않아도 됩니다. 다만 넣은 블록은 버퍼 안에서 빈틈없이 연속해야 합니다.

블록 구성 규칙
항목설명
공통 헤더각 블록별 구조의 첫 멤버는 `c3_isp_params_block_header`입니다.
형식 식별사용자 공간은 헤더의 `type`을 `c3_isp_params_block_type` 값으로 설정합니다.
크기와 flag각 헤더의 `size`에 실제 구조 크기를, `flags`에 활성화 등 동작을 기록합니다.
연속 배치한 블록 바로 뒤에 다음 블록을 놓아야 하며 padding으로 빈 구간을 만들지 않습니다.
전체 크기채운 모든 블록 크기의 합을 `c3_isp_params_cfg.data_size`에 기록합니다.

드라이버가 가변 블록 스트림을 안전하게 해석하기 위한 계약입니다.

원문 C 예제는 버전 `C3_ISP_PARAM_BUFFER_V0`으로 시작해 AWB gain 블록을 활성화하고 네 색 채널 gain을 256으로 설정한 뒤, AWB config 블록을 연속 배치해 tap point, saturation과 32x24 zone 수를 설정합니다. 구조명, 포인터 이동, `sizeof` 표현은 영어 원문 코드 블록에 그대로 보존됩니다.

C3 ISP 매개변수 버퍼
`version` 설정과 `data_size=0` 초기화첫 블록의 header type/flags/size 설정블록별 payload 값 채우기다음 위치로 포인터 이동 후 다음 블록 연속 배치각 블록 크기를 `data_size`에 누적

가변 블록을 만드는 순서입니다.

Configuration Parameters
========================

The configuration parameters are passed to the c3-isp-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 C3-ISP
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 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:`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 set in
the data_size member of :c:type:`c3_isp_params_cfg`. For example:

.. code-block:: c

	struct c3_isp_params_cfg *params =
		(struct c3_isp_params_cfg *)buffer;

	params->version = C3_ISP_PARAM_BUFFER_V0;
	params->data_size = 0;

	void *data = (void *)params->data;

	struct c3_isp_params_awb_gains *gains =
		(struct c3_isp_params_awb_gains *)data;

	gains->header.type = C3_ISP_PARAMS_BLOCK_AWB_GAINS;
	gains->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
	gains->header.size = sizeof(struct c3_isp_params_awb_gains);

	gains->gr_gain = 256;
	gains->r_gain = 256;
	gains->b_gain = 256;
	gains->gb_gain = 256;

	data += sizeof(struct c3_isp__params_awb_gains);
	params->data_size += sizeof(struct c3_isp_params_awb_gains);

	struct c3_isp_params_awb_config *awb_cfg =
		(struct c3_isp_params_awb_config *)data;

	awb_cfg->header.type = C3_ISP_PARAMS_BLOCK_AWB_CONFIG;
	awb_cfg->header.flags = C3_ISP_PARAMS_BLOCK_FL_ENABLE;
	awb_cfg->header.size = sizeof(struct c3_isp_params_awb_config);

	awb_cfg->tap_point = C3_ISP_AWB_STATS_TAP_BEFORE_WB;
	awb_cfg->satur = 1;
	awb_cfg->horiz_zones_num = 32;
	awb_cfg->vert_zones_num = 24;

	params->data_size += sizeof(struct c3_isp_params_awb_config);

Amlogic C3 ISP uAPI 형식

83-86

구조와 enum의 정확한 필드 정의는 `include/uapi/linux/media/amlogic/c3-isp-config.h`에서 kernel-doc으로 가져옵니다. 구현에서는 이 uAPI 헤더를 최종 형식 기준으로 사용해야 합니다.

Amlogic C3 ISP uAPI data types
===============================

.. kernel-doc:: include/uapi/linux/media/amlogic/c3-isp-config.h