요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0-only
.. include:: <isonum.txt>
.. _media-ccs-uapi:
MIPI CCS camera sensor driver
=============================
The MIPI CCS camera sensor driver is a generic driver for `MIPI CCS
<https://www.mipi.org/specifications/camera-command-set>`_ compliant
camera sensors. It exposes three sub-devices representing the pixel array,
the binner and the scaler.
As the capabilities of individual devices vary, the driver exposes
interfaces based on the capabilities that exist in hardware.
Also see :ref:`the CCS driver kernel documentation <media-ccs-driver>`.
Pixel Array sub-device
----------------------
The pixel array sub-device represents the camera sensor's pixel matrix, as well
as analogue crop functionality present in many compliant devices. The analogue
crop is configured using the ``V4L2_SEL_TGT_CROP`` on the source pad (0) of the
entity. The size of the pixel matrix can be obtained by getting the
``V4L2_SEL_TGT_NATIVE_SIZE`` target.
Binner
------
The binner sub-device represents the binning functionality on the sensor. For
that purpose, selection target ``V4L2_SEL_TGT_COMPOSE`` is supported on the
sink pad (0).
Additionally, if a device has no scaler or digital crop functionality, the
source pad (1) exposes another digital crop selection rectangle that can only
crop at the end of the lines and frames.
Scaler
------
The scaler sub-device represents the digital crop and scaling functionality of
the sensor. The V4L2 selection target ``V4L2_SEL_TGT_CROP`` is used to
configure the digital crop on the sink pad (0) when digital crop is supported.
Scaling is configured using selection target ``V4L2_SEL_TGT_COMPOSE`` on the
sink pad (0) as well.
Additionally, if the scaler sub-device exists, its source pad (1) exposes
another digital crop selection rectangle that can only crop at the end of the
lines and frames.
Digital and analogue crop
-------------------------
Digital crop functionality is referred to as cropping that effectively works by
dropping some data on the floor. Analogue crop, on the other hand, means that
the cropped information is never retrieved. In case of camera sensors, the
analogue data is never read from the pixel matrix that are outside the
configured selection rectangle that designates crop. The difference has an
effect in device timing and likely also in power consumption.
Private controls
----------------
The MIPI CCS driver implements a number of private controls under
``V4L2_CID_USER_BASE_CCS`` to control the MIPI CCS compliant camera sensors.
Analogue gain model
~~~~~~~~~~~~~~~~~~~
The CCS defines an analogue gain model where the gain can be calculated using
the following formula:
gain = m0 * x + c0 / (m1 * x + c1)
Either m0 or c0 will be zero. The constants that are device specific, can be
obtained from the following controls:
V4L2_CID_CCS_ANALOGUE_GAIN_M0
V4L2_CID_CCS_ANALOGUE_GAIN_M1
V4L2_CID_CCS_ANALOGUE_GAIN_C0
V4L2_CID_CCS_ANALOGUE_GAIN_C1
The analogue gain (``x`` in the formula) is controlled through
``V4L2_CID_ANALOGUE_GAIN`` in this case.
Alternate analogue gain model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The CCS defines another analogue gain model called alternate analogue gain. In
this case, the formula to calculate actual gain consists of linear and
exponential parts:
gain = linear * 2 ^ exponent
The ``linear`` and ``exponent`` factors can be set using the
``V4L2_CID_CCS_ANALOGUE_LINEAR_GAIN`` and
``V4L2_CID_CCS_ANALOGUE_EXPONENTIAL_GAIN`` controls, respectively
Shading correction
~~~~~~~~~~~~~~~~~~
The CCS standard supports lens shading correction. The feature can be controlled
using ``V4L2_CID_CCS_SHADING_CORRECTION``. Additionally, the luminance
correction level may be changed using
``V4L2_CID_CCS_LUMINANCE_CORRECTION_LEVEL``, where value 0 indicates no
correction and 128 indicates correcting the luminance in corners to 10 % less
than in the centre.
Shading correction needs to be enabled for luminance correction level to have an
effect.
**Copyright** |copy| 2020 Intel Corporation
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Generic CCS driver와 sub-device
1-19MIPI CCS camera sensor driver는 MIPI Camera Command Set 규격을 따르는 camera sensor용 generic driver입니다.
driver는 pixel array, binner, scaler를 나타내는 세 sub-device를 노출합니다. 개별 device capability가 서로 다르므로 실제 hardware에 존재하는 기능만 interface로 제공합니다.
kernel 내부 구현은 `media-ccs-driver` CCS driver 문서도 참고합니다.
지원 capability에 따라 일부 stage가 생략될 수 있습니다.
.. SPDX-License-Identifier: GPL-2.0-only
.. include:: <isonum.txt>
.. _media-ccs-uapi:
MIPI CCS camera sensor driver
=============================
The MIPI CCS camera sensor driver is a generic driver for `MIPI CCS
<https://www.mipi.org/specifications/camera-command-set>`_ compliant
camera sensors. It exposes three sub-devices representing the pixel array,
the binner and the scaler.
As the capabilities of individual devices vary, the driver exposes
interfaces based on the capabilities that exist in hardware.
Also see :ref:`the CCS driver kernel documentation <media-ccs-driver>`.
Pixel Array sub-device
20-28pixel array sub-device는 sensor의 pixel matrix와 많은 CCS device에 있는 analogue crop 기능을 나타냅니다.
entity source pad 0의 `V4L2_SEL_TGT_CROP`으로 analogue crop을 구성하고, `V4L2_SEL_TGT_NATIVE_SIZE` target을 조회해 pixel matrix 전체 크기를 얻습니다.
source pad 0에서 native matrix와 analogue crop을 다룹니다.
Pixel Array sub-device
----------------------
The pixel array sub-device represents the camera sensor's pixel matrix, as well
as analogue crop functionality present in many compliant devices. The analogue
crop is configured using the ``V4L2_SEL_TGT_CROP`` on the source pad (0) of the
entity. The size of the pixel matrix can be obtained by getting the
``V4L2_SEL_TGT_NATIVE_SIZE`` target.
Binner sub-device
29-39binner sub-device는 sensor의 binning 기능을 나타내며 sink pad 0에서 `V4L2_SEL_TGT_COMPOSE` target을 지원합니다.
device에 scaler나 digital crop 기능이 없으면 source pad 1에 추가 digital crop selection rectangle을 노출합니다. 이 rectangle은 line과 frame 끝부분만 잘라낼 수 있습니다.
sink의 compose와 조건부 source crop을 구분합니다.
Binner
------
The binner sub-device represents the binning functionality on the sensor. For
that purpose, selection target ``V4L2_SEL_TGT_COMPOSE`` is supported on the
sink pad (0).
Additionally, if a device has no scaler or digital crop functionality, the
source pad (1) exposes another digital crop selection rectangle that can only
crop at the end of the lines and frames.
Scaler sub-device
40-52scaler sub-device는 sensor의 digital crop과 scaling 기능을 나타냅니다.
digital crop을 지원하면 sink pad 0의 `V4L2_SEL_TGT_CROP`으로 구성하고, scaling도 같은 sink pad의 `V4L2_SEL_TGT_COMPOSE`로 구성합니다.
scaler sub-device가 존재하면 source pad 1에 line과 frame 끝만 자를 수 있는 추가 digital crop selection rectangle도 노출합니다.
sink에서 crop·scale을 구성하고 source에서 최종 edge crop을 제공합니다.
Scaler
------
The scaler sub-device represents the digital crop and scaling functionality of
the sensor. The V4L2 selection target ``V4L2_SEL_TGT_CROP`` is used to
configure the digital crop on the sink pad (0) when digital crop is supported.
Scaling is configured using selection target ``V4L2_SEL_TGT_COMPOSE`` on the
sink pad (0) as well.
Additionally, if the scaler sub-device exists, its source pad (1) exposes
another digital crop selection rectangle that can only crop at the end of the
lines and frames.
Digital·analogue crop과 private control
53-68digital crop은 이미 얻은 data 일부를 버리는 방식입니다. 반면 analogue crop은 crop rectangle 바깥 pixel matrix의 analogue data를 애초에 읽지 않습니다.
이 차이는 device timing과 전력 소비에도 영향을 줄 가능성이 있습니다.
MIPI CCS driver는 `V4L2_CID_USER_BASE_CCS` 아래 여러 private control로 CCS-compliant sensor를 제어합니다.
data가 어느 단계에서 제외되는지가 timing과 power에 영향을 줍니다.
Digital and analogue crop
-------------------------
Digital crop functionality is referred to as cropping that effectively works by
dropping some data on the floor. Analogue crop, on the other hand, means that
the cropped information is never retrieved. In case of camera sensors, the
analogue data is never read from the pixel matrix that are outside the
configured selection rectangle that designates crop. The difference has an
effect in device timing and likely also in power consumption.
Private controls
----------------
The MIPI CCS driver implements a number of private controls under
``V4L2_CID_USER_BASE_CCS`` to control the MIPI CCS compliant camera sensors.
Analogue gain model
69-87CCS analogue gain model의 식은 `gain = m0 * x + c0 / (m1 * x + c1)`입니다. `m0` 또는 `c0` 중 하나는 0입니다.
device-specific 상수는 `V4L2_CID_CCS_ANALOGUE_GAIN_M0`, `V4L2_CID_CCS_ANALOGUE_GAIN_M1`, `V4L2_CID_CCS_ANALOGUE_GAIN_C0`, `V4L2_CID_CCS_ANALOGUE_GAIN_C1` control에서 얻습니다.
식의 `x`, 즉 analogue gain 입력은 `V4L2_CID_ANALOGUE_GAIN`으로 제어합니다.
device 상수 네 개와 userspace gain 입력을 구분합니다.
control 값과 device 상수를 공식에 대입합니다.
Analogue gain model
~~~~~~~~~~~~~~~~~~~
The CCS defines an analogue gain model where the gain can be calculated using
the following formula:
gain = m0 * x + c0 / (m1 * x + c1)
Either m0 or c0 will be zero. The constants that are device specific, can be
obtained from the following controls:
V4L2_CID_CCS_ANALOGUE_GAIN_M0
V4L2_CID_CCS_ANALOGUE_GAIN_M1
V4L2_CID_CCS_ANALOGUE_GAIN_C0
V4L2_CID_CCS_ANALOGUE_GAIN_C1
The analogue gain (``x`` in the formula) is controlled through
``V4L2_CID_ANALOGUE_GAIN`` in this case.
Alternate analogue gain model
88-100alternate analogue gain은 linear와 exponential 부분을 결합하며 식은 `gain = linear * 2 ^ exponent`입니다.
`linear`는 `V4L2_CID_CCS_ANALOGUE_LINEAR_GAIN`, `exponent`는 `V4L2_CID_CCS_ANALOGUE_EXPONENTIAL_GAIN`으로 각각 설정합니다.
선형 계수와 2의 지수를 독립 control로 제공합니다.
Alternate analogue gain model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The CCS defines another analogue gain model called alternate analogue gain. In
this case, the formula to calculate actual gain consists of linear and
exponential parts:
gain = linear * 2 ^ exponent
The ``linear`` and ``exponent`` factors can be set using the
``V4L2_CID_CCS_ANALOGUE_LINEAR_GAIN`` and
``V4L2_CID_CCS_ANALOGUE_EXPONENTIAL_GAIN`` controls, respectively
Shading correction
101-114CCS standard는 lens shading correction을 지원하며 `V4L2_CID_CCS_SHADING_CORRECTION`으로 기능을 제어합니다.
`V4L2_CID_CCS_LUMINANCE_CORRECTION_LEVEL`로 luminance correction level을 바꿀 수 있습니다. 0은 correction 없음, 128은 corner luminance를 center보다 10% 낮게 보정하는 수준입니다.
luminance correction level이 실제 효과를 가지려면 shading correction이 먼저 enable되어야 합니다.
enable control과 correction level을 함께 사용합니다.
level만 설정해서는 효과가 없으며 shading enable이 선행됩니다.
Copyright 2020 Intel Corporation.
Shading correction
~~~~~~~~~~~~~~~~~~
The CCS standard supports lens shading correction. The feature can be controlled
using ``V4L2_CID_CCS_SHADING_CORRECTION``. Additionally, the luminance
correction level may be changed using
``V4L2_CID_CCS_LUMINANCE_CORRECTION_LEVEL``, where value 0 indicates no
correction and 128 indicates correcting the luminance in corners to 10 % less
than in the centre.
Shading correction needs to be enabled for luminance correction level to have an
effect.
**Copyright** |copy| 2020 Intel Corporation
요약·해설
ccs.rst:1-114CCS driver는 hardware capability에 맞춰 pixel array, binner와 scaler sub-device를 노출합니다. analogue crop은 읽기 전, digital crop은 읽은 뒤 data를 제외하며 두 gain model과 shading correction용 private control을 제공합니다.