← Documents Documentation/admin-guide/media/cafe_ccic.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Media

The cafe_ccic driver

Marvell 88ALP01 camera controller의 지원 상태, capture 시험 명령, DMA·streaming option을 설명합니다.

Source pathDocumentation/admin-guide/media/cafe_ccic.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Driver 상태와 시험

cafe_ccic.rst:1-29

지원 format·mode·sensor와 `mplayer` 시험 방법을 정리합니다.

Load-time option

cafe_ccic.rst:30-62

DMA allocation, buffer 수, image flip option을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 The cafe_ccic driver
4 ====================
5
6 Author: Jonathan Corbet <corbet@lwn.net>
7
8 Introduction
9 ------------
10
11 "cafe_ccic" is a driver for the Marvell 88ALP01 "cafe" CMOS camera
12 controller. This is the controller found in first-generation OLPC systems,
13 and this driver was written with support from the OLPC project.
14
15 Current status: the core driver works. It can generate data in YUV422,
16 RGB565, and RGB444 formats. (Anybody looking at the code will see RGB32 as
17 well, but that is a debugging aid which will be removed shortly). VGA and
18 QVGA modes work; CIF is there but the colors remain funky. Only the OV7670
19 sensor is known to work with this controller at this time.
20
21 To try it out: either of these commands will work:
22
23 .. code-block:: none
24
25 $ mplayer tv:// -tv driver=v4l2:width=640:height=480 -nosound
26 $ mplayer tv:// -tv driver=v4l2:width=640:height=480:outfmt=bgr16 -nosound
27
28 The "xawtv" utility also works; gqcam does not, for unknown reasons.
29
30 Load time options
31 -----------------
32
33 There are a few load-time options, most of which can be changed after
34 loading via sysfs as well:
35
36 - alloc_bufs_at_load: Normally, the driver will not allocate any DMA
37 buffers until the time comes to transfer data. If this option is set,
38 then worst-case-sized buffers will be allocated at module load time.
39 This option nails down the memory for the life of the module, but
40 perhaps decreases the chances of an allocation failure later on.
41
42 - dma_buf_size: The size of DMA buffers to allocate. Note that this
43 option is only consulted for load-time allocation; when buffers are
44 allocated at run time, they will be sized appropriately for the current
45 camera settings.
46
47 - n_dma_bufs: The controller can cycle through either two or three DMA
48 buffers. Normally, the driver tries to use three buffers; on faster
49 systems, however, it will work well with only two.
50
51 - min_buffers: The minimum number of streaming I/O buffers that the driver
52 will consent to work with. Default is one, but, on slower systems,
53 better behavior with mplayer can be achieved by setting to a higher
54 value (like six).
55
56 - max_buffers: The maximum number of streaming I/O buffers; default is
57 ten. That number was carefully picked out of a hat and should not be
58 assumed to actually mean much of anything.
59
60 - flip: If this boolean parameter is set, the sensor will be instructed to
61 invert the video image. Whether it makes sense is determined by how
62 your particular camera is mounted.
63

3. 한국어 전문 번역

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

cafe_ccic driver와 지원 상태

1-19

작성자: Jonathan Corbet <corbet@lwn.net>

`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 장착 방향에 따라 결정됩니다.