요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Load-time option
cafe_ccic.rst:30-62DMA allocation, buffer 수, image flip option을 설명합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
The cafe_ccic driver
====================
Author: Jonathan Corbet <[email protected]>
Introduction
------------
"cafe_ccic" is a driver for the Marvell 88ALP01 "cafe" CMOS camera
controller. This is the controller found in first-generation OLPC systems,
and this driver was written with support from the OLPC project.
Current status: the core driver works. It can generate data in YUV422,
RGB565, and RGB444 formats. (Anybody looking at the code will see RGB32 as
well, but that is a debugging aid which will be removed shortly). VGA and
QVGA modes work; CIF is there but the colors remain funky. Only the OV7670
sensor is known to work with this controller at this time.
To try it out: either of these commands will work:
.. code-block:: none
$ mplayer tv:// -tv driver=v4l2:width=640:height=480 -nosound
$ mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=bgr16 -nosound
The "xawtv" utility also works; gqcam does not, for unknown reasons.
Load time options
-----------------
There are a few load-time options, most of which can be changed after
loading via sysfs as well:
- alloc_bufs_at_load: Normally, the driver will not allocate any DMA
buffers until the time comes to transfer data. If this option is set,
then worst-case-sized buffers will be allocated at module load time.
This option nails down the memory for the life of the module, but
perhaps decreases the chances of an allocation failure later on.
- dma_buf_size: The size of DMA buffers to allocate. Note that this
option is only consulted for load-time allocation; when buffers are
allocated at run time, they will be sized appropriately for the current
camera settings.
- n_dma_bufs: The controller can cycle through either two or three DMA
buffers. Normally, the driver tries to use three buffers; on faster
systems, however, it will work well with only two.
- min_buffers: The minimum number of streaming I/O buffers that the driver
will consent to work with. Default is one, but, on slower systems,
better behavior with mplayer can be achieved by setting to a higher
value (like six).
- max_buffers: The maximum number of streaming I/O buffers; default is
ten. That number was carefully picked out of a hat and should not be
assumed to actually mean much of anything.
- flip: If this boolean parameter is set, the sensor will be instructed to
invert the video image. Whether it makes sense is determined by how
your particular camera is mounted.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
cafe_ccic driver와 지원 상태
1-19작성자: Jonathan Corbet <[email protected]>
`cafe_ccic`는 Marvell 88ALP01 `cafe` CMOS camera controller용 driver입니다. 이 controller는 1세대 OLPC system에 들어가며 driver는 OLPC project의 지원을 받아 작성되었습니다.
Core driver는 동작하며 YUV422, RGB565, RGB444 format data를 생성할 수 있습니다. Code에 보이는 RGB32는 곧 제거할 debugging 보조 기능입니다. VGA와 QVGA mode는 동작하고 CIF도 있으나 color가 아직 비정상입니다. 현재 이 controller에서 동작이 확인된 sensor는 OV7670뿐입니다.
Capture 시험 명령
20-29다음 두 `mplayer` 명령 중 어느 것이든 driver를 시험하는 데 사용할 수 있습니다.
$ mplayer tv:// -tv driver=v4l2:width=640:height=480 -nosound
$ mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=bgr16 -nosound
`xawtv` utility도 동작하지만 `gqcam`은 알 수 없는 이유로 동작하지 않습니다.
Load-time option
30-62다음 load-time option 대부분은 module을 불러온 뒤 sysfs에서도 변경할 수 있습니다.
| Option | 동작 |
|---|---|
| `alloc_bufs_at_load` | 기본값에서는 transfer 시점까지 DMA buffer를 할당하지 않습니다. 설정하면 module load 때 최악 조건 크기의 buffer를 할당해 module 수명 동안 memory를 고정하지만 이후 allocation 실패 가능성을 줄일 수 있습니다. |
| `dma_buf_size` | 할당할 DMA buffer 크기입니다. Load-time allocation에만 사용하며 runtime에 할당할 때는 현재 camera 설정에 맞춰 크기를 정합니다. |
| `n_dma_bufs` | Controller가 순환할 DMA buffer 수로 2 또는 3을 선택합니다. 기본적으로 세 개를 시도하지만 빠른 system은 두 개로도 잘 동작합니다. |
| `min_buffers` | Driver가 streaming I/O에 허용할 최소 buffer 수입니다. 기본값은 1이며 느린 system에서는 6처럼 큰 값이 `mplayer` 동작을 개선할 수 있습니다. |
| `max_buffers` | Streaming I/O buffer의 최댓값입니다. 기본값은 10이지만 경험적으로 정한 수라 특별한 의미를 전제로 해서는 안 됩니다. |
| `flip` | Boolean parameter를 설정하면 sensor가 video image를 뒤집습니다. 유효한지는 실제 camera 장착 방향에 따라 결정됩니다. |
Driver 상태와 시험
cafe_ccic.rst:1-29지원 format·mode·sensor와 `mplayer` 시험 방법을 정리합니다.