요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=========================
OMAP2/3 Display Subsystem
=========================
This is an almost total rewrite of the OMAP FB driver in drivers/video/omap
(let's call it DSS1). The main differences between DSS1 and DSS2 are DSI,
TV-out and multiple display support, but there are lots of small improvements
also.
The DSS2 driver (omapdss module) is in arch/arm/plat-omap/dss/, and the FB,
panel and controller drivers are in drivers/video/omap2/. DSS1 and DSS2 live
currently side by side, you can choose which one to use.
Features
--------
Working and tested features include:
- MIPI DPI (parallel) output
- MIPI DSI output in command mode
- MIPI DBI (RFBI) output
- SDI output
- TV output
- All pieces can be compiled as a module or inside kernel
- Use DISPC to update any of the outputs
- Use CPU to update RFBI or DSI output
- OMAP DISPC planes
- RGB16, RGB24 packed, RGB24 unpacked
- YUV2, UYVY
- Scaling
- Adjusting DSS FCK to find a good pixel clock
- Use DSI DPLL to create DSS FCK
Tested boards include:
- OMAP3 SDP board
- Beagle board
- N810
omapdss driver
--------------
The DSS driver does not itself have any support for Linux framebuffer, V4L or
such like the current ones, but it has an internal kernel API that upper level
drivers can use.
The DSS driver models OMAP's overlays, overlay managers and displays in a
flexible way to enable non-common multi-display configuration. In addition to
modelling the hardware overlays, omapdss supports virtual overlays and overlay
managers. These can be used when updating a display with CPU or system DMA.
omapdss driver support for audio
--------------------------------
There exist several display technologies and standards that support audio as
well. Hence, it is relevant to update the DSS device driver to provide an audio
interface that may be used by an audio driver or any other driver interested in
the functionality.
The audio_enable function is intended to prepare the relevant
IP for playback (e.g., enabling an audio FIFO, taking in/out of reset
some IP, enabling companion chips, etc). It is intended to be called before
audio_start. The audio_disable function performs the reverse operation and is
intended to be called after audio_stop.
While a given DSS device driver may support audio, it is possible that for
certain configurations audio is not supported (e.g., an HDMI display using a
VESA video timing). The audio_supported function is intended to query whether
the current configuration of the display supports audio.
The audio_config function is intended to configure all the relevant audio
parameters of the display. In order to make the function independent of any
specific DSS device driver, a struct omap_dss_audio is defined. Its purpose
is to contain all the required parameters for audio configuration. At the
moment, such structure contains pointers to IEC-60958 channel status word
and CEA-861 audio infoframe structures. This should be enough to support
HDMI and DisplayPort, as both are based on CEA-861 and IEC-60958.
The audio_enable/disable, audio_config and audio_supported functions could be
implemented as functions that may sleep. Hence, they should not be called
while holding a spinlock or a readlock.
The audio_start/audio_stop function is intended to effectively start/stop audio
playback after the configuration has taken place. These functions are designed
to be used in an atomic context. Hence, audio_start should return quickly and be
called only after all the needed resources for audio playback (audio FIFOs,
DMA channels, companion chips, etc) have been enabled to begin data transfers.
audio_stop is designed to only stop the audio transfers. The resources used
for playback are released using audio_disable.
The enum omap_dss_audio_state may be used to help the implementations of
the interface to keep track of the audio state. The initial state is _DISABLED;
then, the state transitions to _CONFIGURED, and then, when it is ready to
play audio, to _ENABLED. The state _PLAYING is used when the audio is being
rendered.
Panel and controller drivers
----------------------------
The drivers implement panel or controller specific functionality and are not
usually visible to users except through omapfb driver. They register
themselves to the DSS driver.
omapfb driver
-------------
The omapfb driver implements arbitrary number of standard linux framebuffers.
These framebuffers can be routed flexibly to any overlays, thus allowing very
dynamic display architecture.
The driver exports some omapfb specific ioctls, which are compatible with the
ioctls in the old driver.
The rest of the non standard features are exported via sysfs. Whether the final
implementation will use sysfs, or ioctls, is still open.
V4L2 drivers
------------
V4L2 is being implemented in TI.
From omapdss point of view the V4L2 drivers should be similar to framebuffer
driver.
Architecture
--------------------
Some clarification what the different components do:
- Framebuffer is a memory area inside OMAP's SRAM/SDRAM that contains the
pixel data for the image. Framebuffer has width and height and color
depth.
- Overlay defines where the pixels are read from and where they go on the
screen. The overlay may be smaller than framebuffer, thus displaying only
part of the framebuffer. The position of the overlay may be changed if
the overlay is smaller than the display.
- Overlay manager combines the overlays in to one image and feeds them to
display.
- Display is the actual physical display device.
A framebuffer can be connected to multiple overlays to show the same pixel data
on all of the overlays. Note that in this case the overlay input sizes must be
the same, but, in case of video overlays, the output size can be different. Any
framebuffer can be connected to any overlay.
An overlay can be connected to one overlay manager. Also DISPC overlays can be
connected only to DISPC overlay managers, and virtual overlays can be only
connected to virtual overlays.
An overlay manager can be connected to one display. There are certain
restrictions which kinds of displays an overlay manager can be connected:
- DISPC TV overlay manager can be only connected to TV display.
- Virtual overlay managers can only be connected to DBI or DSI displays.
- DISPC LCD overlay manager can be connected to all displays, except TV
display.
Sysfs
-----
The sysfs interface is mainly used for testing. I don't think sysfs
interface is the best for this in the final version, but I don't quite know
what would be the best interfaces for these things.
The sysfs interface is divided to two parts: DSS and FB.
/sys/class/graphics/fb? directory:
mirror 0=off, 1=on
rotate Rotation 0-3 for 0, 90, 180, 270 degrees
rotate_type 0 = DMA rotation, 1 = VRFB rotation
overlays List of overlay numbers to which framebuffer pixels go
phys_addr Physical address of the framebuffer
virt_addr Virtual address of the framebuffer
size Size of the framebuffer
/sys/devices/platform/omapdss/overlay? directory:
enabled 0=off, 1=on
input_size width,height (ie. the framebuffer size)
manager Destination overlay manager name
name
output_size width,height
position x,y
screen_width width
global_alpha global alpha 0-255 0=transparent 255=opaque
/sys/devices/platform/omapdss/manager? directory:
display Destination display
name
alpha_blending_enabled 0=off, 1=on
trans_key_enabled 0=off, 1=on
trans_key_type gfx-destination, video-source
trans_key_value transparency color key (RGB24)
default_color default background color (RGB24)
/sys/devices/platform/omapdss/display? directory:
=============== =============================================================
ctrl_name Controller name
mirror 0=off, 1=on
update_mode 0=off, 1=auto, 2=manual
enabled 0=off, 1=on
name
rotate Rotation 0-3 for 0, 90, 180, 270 degrees
timings Display timings (pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw)
When writing, two special timings are accepted for tv-out:
"pal" and "ntsc"
panel_name
tear_elim Tearing elimination 0=off, 1=on
output_type Output type (video encoder only): "composite" or "svideo"
=============== =============================================================
There are also some debugfs files at <debugfs>/omapdss/ which show information
about clocks and registers.
Examples
--------
The following definitions have been made for the examples below::
ovl0=/sys/devices/platform/omapdss/overlay0
ovl1=/sys/devices/platform/omapdss/overlay1
ovl2=/sys/devices/platform/omapdss/overlay2
mgr0=/sys/devices/platform/omapdss/manager0
mgr1=/sys/devices/platform/omapdss/manager1
lcd=/sys/devices/platform/omapdss/display0
dvi=/sys/devices/platform/omapdss/display1
tv=/sys/devices/platform/omapdss/display2
fb0=/sys/class/graphics/fb0
fb1=/sys/class/graphics/fb1
fb2=/sys/class/graphics/fb2
Default setup on OMAP3 SDP
--------------------------
Here's the default setup on OMAP3 SDP board. All planes go to LCD. DVI
and TV-out are not in use. The columns from left to right are:
framebuffers, overlays, overlay managers, displays. Framebuffers are
handled by omapfb, and the rest by the DSS::
FB0 --- GFX -\ DVI
FB1 --- VID1 --+- LCD ---- LCD
FB2 --- VID2 -/ TV ----- TV
Example: Switch from LCD to DVI
-------------------------------
::
w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1`
h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1`
echo "0" > $lcd/enabled
echo "" > $mgr0/display
fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h
# at this point you have to switch the dvi/lcd dip-switch from the omap board
echo "dvi" > $mgr0/display
echo "1" > $dvi/enabled
After this the configuration looks like:::
FB0 --- GFX -\ -- DVI
FB1 --- VID1 --+- LCD -/ LCD
FB2 --- VID2 -/ TV ----- TV
Example: Clone GFX overlay to LCD and TV
----------------------------------------
::
w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1`
h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1`
echo "0" > $ovl0/enabled
echo "0" > $ovl1/enabled
echo "" > $fb1/overlays
echo "0,1" > $fb0/overlays
echo "$w,$h" > $ovl1/output_size
echo "tv" > $ovl1/manager
echo "1" > $ovl0/enabled
echo "1" > $ovl1/enabled
echo "1" > $tv/enabled
After this the configuration looks like (only relevant parts shown)::
FB0 +-- GFX ---- LCD ---- LCD
\- VID1 ---- TV ---- TV
Misc notes
----------
OMAP FB allocates the framebuffer memory using the standard dma allocator. You
can enable Contiguous Memory Allocator (CONFIG_CMA) to improve the dma
allocator, and if CMA is enabled, you use "cma=" kernel parameter to increase
the global memory area for CMA.
Using DSI DPLL to generate pixel clock it is possible produce the pixel clock
of 86.5MHz (max possible), and with that you get 1280x1024@57 output from DVI.
Rotation and mirroring currently only supports RGB565 and RGB8888 modes. VRFB
does not support mirroring.
VRFB rotation requires much more memory than non-rotated framebuffer, so you
probably need to increase your vram setting before using VRFB rotation. Also,
many applications may not work with VRFB if they do not pay attention to all
framebuffer parameters.
Kernel boot arguments
---------------------
omapfb.mode=<display>:<mode>[,...]
- Default video mode for specified displays. For example,
"dvi:800x400MR-24@60". See drivers/video/modedb.c.
There are also two special modes: "pal" and "ntsc" that
can be used to tv out.
omapfb.vram=<fbnum>:<size>[@<physaddr>][,...]
- VRAM allocated for a framebuffer. Normally omapfb allocates vram
depending on the display size. With this you can manually allocate
more or define the physical address of each framebuffer. For example,
"1:4M" to allocate 4M for fb1.
omapfb.debug=<y|n>
- Enable debug printing. You have to have OMAPFB debug support enabled
in kernel config.
omapfb.test=<y|n>
- Draw test pattern to framebuffer whenever framebuffer settings change.
You need to have OMAPFB debug support enabled in kernel config.
omapfb.vrfb=<y|n>
- Use VRFB rotation for all framebuffers.
omapfb.rotate=<angle>
- Default rotation applied to all framebuffers.
0 - 0 degree rotation
1 - 90 degree rotation
2 - 180 degree rotation
3 - 270 degree rotation
omapfb.mirror=<y|n>
- Default mirror for all framebuffers. Only works with DMA rotation.
omapdss.def_disp=<display>
- Name of default display, to which all overlays will be connected.
Common examples are "lcd" or "tv".
omapdss.debug=<y|n>
- Enable debug printing. You have to have DSS debug support enabled in
kernel config.
TODO
----
DSS locking
Error checking
- Lots of checks are missing or implemented just as BUG()
System DMA update for DSI
- Can be used for RGB16 and RGB24P modes. Probably not for RGB24U (how
to skip the empty byte?)
OMAP1 support
- Not sure if needed
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
OMAP2/3 디스플레이 서브시스템
1-13이 문서는 `drivers/video/omap`에 있던 OMAP FB 드라이버, 즉 DSS1을 거의 전면 재작성한 DSS2를 설명합니다. DSS1과 비교한 주요 차이는 DSI, TV-out, 다중 디스플레이 지원이며 그 밖에도 여러 세부 개선이 포함됩니다.
DSS2 드라이버인 `omapdss` 모듈은 `arch/arm/plat-omap/dss/`에 있고, FB·패널·컨트롤러 드라이버는 `drivers/video/omap2/`에 있습니다. 당시에는 DSS1과 DSS2가 나란히 존재하므로 사용할 구현을 선택할 수 있습니다.
기능
14-38작동이 확인되고 시험된 기능은 다음과 같습니다.
- MIPI DPI 병렬 출력
- 명령 모드의 MIPI DSI 출력
- MIPI DBI(RFBI) 출력
- SDI 출력과 TV 출력
- 모든 구성 요소의 모듈 또는 커널 내장 빌드
- DISPC를 이용한 모든 출력 갱신
- CPU를 이용한 RFBI 또는 DSI 출력 갱신
- OMAP DISPC plane
- RGB16, packed RGB24, unpacked RGB24
- YUV2와 UYVY
- 스케일링
- 적절한 pixel clock을 찾기 위한 DSS FCK 조정
- DSI DPLL을 이용한 DSS FCK 생성
시험된 보드는 OMAP3 SDP 보드, Beagle 보드, N810입니다.
omapdss 드라이버
39-50DSS 드라이버 자체는 기존 드라이버처럼 Linux framebuffer나 V4L 등을 직접 지원하지 않습니다. 대신 상위 계층 드라이버가 사용할 수 있는 내부 커널 API를 제공합니다.
DSS 드라이버는 흔하지 않은 다중 디스플레이 구성도 표현할 수 있도록 OMAP의 overlay, overlay manager, display를 유연하게 모델링합니다. 하드웨어 overlay뿐 아니라 가상 overlay와 가상 overlay manager도 지원하며, 이 가상 구성 요소는 CPU 또는 system DMA로 디스플레이를 갱신할 때 사용할 수 있습니다.
omapdss 드라이버의 오디오 지원
51-95여러 디스플레이 기술과 표준은 오디오도 지원합니다. 따라서 DSS 장치 드라이버는 오디오 드라이버나 이 기능을 필요로 하는 다른 드라이버가 사용할 오디오 인터페이스를 제공해야 합니다.
`audio_enable`은 오디오 FIFO 활성화, IP reset 진입·해제, companion chip 활성화처럼 재생에 필요한 IP와 자원을 준비하며 `audio_start`보다 먼저 호출합니다. `audio_disable`은 그 반대 작업을 수행하고 `audio_stop` 뒤에 호출합니다.
DSS 장치 드라이버가 오디오 기능을 제공하더라도 특정 구성, 예를 들어 VESA video timing을 사용하는 HDMI display에서는 오디오를 지원하지 않을 수 있습니다. `audio_supported`는 현재 디스플레이 구성이 오디오를 지원하는지 조회합니다.
`audio_config`는 관련 오디오 매개변수를 구성합니다. 특정 DSS 장치 드라이버에 종속되지 않도록 `struct omap_dss_audio`를 정의했으며, 이 구조체는 오디오 구성에 필요한 값을 담습니다. 당시 구조체에는 IEC-60958 channel status word와 CEA-861 audio infoframe 구조체를 가리키는 포인터가 들어 있습니다. HDMI와 DisplayPort가 모두 CEA-861 및 IEC-60958에 기반하므로 이 정보로 두 규격을 지원할 수 있습니다.
`audio_enable`, `audio_disable`, `audio_config`, `audio_supported`는 sleep할 수 있는 함수로 구현될 수 있으므로 spinlock이나 readlock을 잡은 채 호출하면 안 됩니다.
`audio_start`와 `audio_stop`은 구성이 끝난 뒤 실제 오디오 재생을 시작하고 멈춥니다. 두 함수는 atomic context에서 쓰도록 설계되었습니다. 따라서 `audio_start`는 빨리 반환해야 하며, audio FIFO, DMA channel, companion chip 등 전송에 필요한 자원을 모두 활성화한 뒤 호출해야 합니다. `audio_stop`은 오디오 전송만 중단하고, 재생 자원은 `audio_disable`로 해제합니다.
`enum omap_dss_audio_state`를 사용하면 인터페이스 구현이 오디오 상태를 추적할 수 있습니다.
| 상태 | 의미와 전이 시점 |
|---|---|
| `_DISABLED` | 초기 상태, 오디오 기능이 비활성화됨 |
| `_CONFIGURED` | 오디오 매개변수 구성이 완료됨 |
| `_ENABLED` | 오디오를 재생할 준비가 완료됨 |
| `_PLAYING` | 오디오가 실제로 렌더링되는 중 |
패널 및 컨트롤러 드라이버
96-102이 드라이버들은 패널 또는 컨트롤러 고유 기능을 구현합니다. 보통 사용자는 `omapfb` 드라이버를 통하지 않고는 이들을 직접 보지 않으며, 각 드라이버는 자신을 DSS 드라이버에 등록합니다.
omapfb 드라이버
103-115`omapfb` 드라이버는 임의 개수의 표준 Linux framebuffer를 구현합니다. 각 framebuffer를 어떤 overlay로도 유연하게 라우팅할 수 있어 매우 동적인 디스플레이 구성이 가능합니다.
드라이버는 이전 드라이버의 ioctl과 호환되는 몇 가지 `omapfb` 전용 ioctl을 내보냅니다. 나머지 비표준 기능은 sysfs로 노출하지만, 최종 구현이 sysfs와 ioctl 가운데 어느 쪽을 사용할지는 이 문서 시점에 결정되지 않았습니다.
V4L2 드라이버
116-123V4L2 구현은 TI에서 진행 중입니다. `omapdss` 관점에서 V4L2 드라이버는 framebuffer 드라이버와 비슷하게 동작해야 합니다.
아키텍처
124-156각 구성 요소의 역할은 다음과 같습니다.
| 구성 요소 | 역할 |
|---|---|
| Framebuffer | OMAP SRAM/SDRAM 안에서 이미지 pixel data를 담는 메모리 영역이며 너비, 높이, color depth를 가집니다. |
| Overlay | pixel을 어디에서 읽어 화면의 어디로 보낼지 정합니다. framebuffer보다 작을 수 있어 일부만 표시할 수 있고, display보다 작으면 위치를 바꿀 수 있습니다. |
| Overlay manager | 여러 overlay를 한 이미지로 합쳐 display에 공급합니다. |
| Display | 실제 물리 디스플레이 장치입니다. |
하나의 framebuffer를 여러 overlay에 연결해 동일한 pixel data를 모두 표시할 수 있습니다. 이때 overlay의 입력 크기는 같아야 하지만 video overlay의 출력 크기는 서로 달라도 됩니다. 어떤 framebuffer도 어떤 overlay에든 연결할 수 있습니다.
overlay는 하나의 overlay manager에 연결됩니다. DISPC overlay는 DISPC overlay manager에만, virtual overlay는 virtual overlay manager에만 연결할 수 있습니다.
| overlay manager | 연결 가능한 display |
|---|---|
| DISPC TV overlay manager | TV display만 가능 |
| Virtual overlay manager | DBI 또는 DSI display만 가능 |
| DISPC LCD overlay manager | TV display를 제외한 모든 display 가능 |
Sysfs 인터페이스
157-212sysfs 인터페이스는 주로 시험에 사용합니다. 저자는 최종 버전에 가장 적합한 인터페이스라고 보지는 않았지만, 더 나은 인터페이스가 무엇인지는 아직 정하지 못했습니다. 인터페이스는 DSS 부분과 FB 부분으로 나뉩니다.
`/sys/class/graphics/fb?` 디렉터리의 항목입니다.
| 항목 | 값 또는 의미 |
|---|---|
| `mirror` | `0`=off, `1`=on |
| `rotate` | `0`~`3`: 0, 90, 180, 270도 회전 |
| `rotate_type` | `0`=DMA rotation, `1`=VRFB rotation |
| `overlays` | framebuffer pixel이 전달되는 overlay 번호 목록 |
| `phys_addr` | framebuffer의 물리 주소 |
| `virt_addr` | framebuffer의 가상 주소 |
| `size` | framebuffer 크기 |
`/sys/devices/platform/omapdss/overlay?` 디렉터리의 항목입니다.
| 항목 | 값 또는 의미 |
|---|---|
| `enabled` | `0`=off, `1`=on |
| `input_size` | `width,height`, 즉 framebuffer 크기 |
| `manager` | 목적지 overlay manager 이름 |
| `name` | overlay 이름 |
| `output_size` | `width,height` |
| `position` | `x,y` |
| `screen_width` | 화면 너비 |
| `global_alpha` | `0`~`255`: `0`=transparent, `255`=opaque |
`/sys/devices/platform/omapdss/manager?` 디렉터리의 항목입니다.
| 항목 | 값 또는 의미 |
|---|---|
| `display` | 목적지 display |
| `name` | manager 이름 |
| `alpha_blending_enabled` | `0`=off, `1`=on |
| `trans_key_enabled` | `0`=off, `1`=on |
| `trans_key_type` | `gfx-destination` 또는 `video-source` |
| `trans_key_value` | 투명 color key(RGB24) |
| `default_color` | 기본 background color(RGB24) |
`/sys/devices/platform/omapdss/display?` 디렉터리의 항목입니다.
| 항목 | 값 또는 의미 |
|---|---|
| `ctrl_name` | controller 이름 |
| `mirror` | `0`=off, `1`=on |
| `update_mode` | `0`=off, `1`=auto, `2`=manual |
| `enabled` | `0`=off, `1`=on |
| `name` | display 이름 |
| `rotate` | `0`~`3`: 0, 90, 180, 270도 회전 |
| `timings` | `pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw`; 기록할 때 TV-out용 `pal`, `ntsc`도 허용 |
| `panel_name` | panel 이름 |
| `tear_elim` | tearing elimination: `0`=off, `1`=on |
| `output_type` | video encoder 출력 형식: `composite` 또는 `svideo` |
또한 `<debugfs>/omapdss/` 아래에는 clock과 register 정보를 보여 주는 debugfs 파일이 있습니다.
예제에서 쓰는 정의
213-232뒤의 예제에서는 다음 shell 변수를 사용합니다.
ovl0=/sys/devices/platform/omapdss/overlay0
ovl1=/sys/devices/platform/omapdss/overlay1
ovl2=/sys/devices/platform/omapdss/overlay2
mgr0=/sys/devices/platform/omapdss/manager0
mgr1=/sys/devices/platform/omapdss/manager1
lcd=/sys/devices/platform/omapdss/display0
dvi=/sys/devices/platform/omapdss/display1
tv=/sys/devices/platform/omapdss/display2
fb0=/sys/class/graphics/fb0
fb1=/sys/class/graphics/fb1
fb2=/sys/class/graphics/fb2
OMAP3 SDP의 기본 구성
233-244OMAP3 SDP 보드의 기본 구성에서는 모든 plane이 LCD로 향하고 DVI와 TV-out은 사용하지 않습니다. 원문의 열은 왼쪽부터 framebuffer, overlay, overlay manager, display입니다. framebuffer는 `omapfb`가, 나머지는 DSS가 처리합니다.
세 framebuffer가 각 overlay를 거쳐 LCD manager로 합쳐지고 LCD display로 출력됩니다. TV manager와 TV display의 연결은 존재하지만 framebuffer 입력은 없고 DVI도 사용하지 않습니다.
예제: LCD에서 DVI로 전환
245-265DVI timing에서 너비와 높이를 읽고 LCD를 끈 다음 manager의 기존 display 연결을 해제합니다. `fb0` 해상도를 DVI에 맞춘 뒤 보드의 DVI/LCD DIP switch를 바꾸고 manager를 DVI에 연결해 DVI를 활성화합니다.
w=`cat $dvi/timings | cut -d "," -f 2 | cut -d "/" -f 1`
h=`cat $dvi/timings | cut -d "," -f 3 | cut -d "/" -f 1`
echo "0" > $lcd/enabled
echo "" > $mgr0/display
fbset -fb /dev/fb0 -xres $w -yres $h -vxres $w -vyres $h
# at this point you have to switch the dvi/lcd dip-switch from the omap board
echo "dvi" > $mgr0/display
echo "1" > $dvi/enabled
FB0, FB1, FB2는 각각 GFX, VID1, VID2 overlay를 거쳐 LCD manager에 합쳐지지만 manager의 목적지는 이제 DVI display입니다. TV manager와 TV display 경로는 그대로입니다.
예제: GFX overlay를 LCD와 TV로 복제
266-292TV timing에서 출력 크기를 구한 뒤 `ovl0`과 `ovl1`을 잠시 끕니다. `fb1`의 overlay 연결을 비우고 `fb0`을 overlay 0과 1에 함께 연결합니다. `ovl1`의 출력 크기를 TV에 맞추고 TV manager에 연결한 다음 두 overlay와 TV를 다시 활성화합니다.
w=`cat $tv/timings | cut -d "," -f 2 | cut -d "/" -f 1`
h=`cat $tv/timings | cut -d "," -f 3 | cut -d "/" -f 1`
echo "0" > $ovl0/enabled
echo "0" > $ovl1/enabled
echo "" > $fb1/overlays
echo "0,1" > $fb0/overlays
echo "$w,$h" > $ovl1/output_size
echo "tv" > $ovl1/manager
echo "1" > $ovl0/enabled
echo "1" > $ovl1/enabled
echo "1" > $tv/enabled
동일한 FB0 pixel data가 GFX overlay를 통해 LCD로, VID1 overlay를 통해 TV로 동시에 전달됩니다.
기타 참고 사항
293-311OMAP FB는 표준 DMA allocator로 framebuffer 메모리를 할당합니다. `CONFIG_CMA`로 Contiguous Memory Allocator를 활성화하면 DMA allocator를 개선할 수 있고, CMA가 켜져 있을 때 `cma=` 커널 매개변수로 전역 CMA 메모리 영역을 늘릴 수 있습니다.
DSI DPLL로 pixel clock을 만들면 가능한 최대값인 86.5MHz를 생성할 수 있으며, 이 clock으로 DVI에서 `1280x1024@57` 출력을 얻을 수 있습니다.
회전과 미러링은 당시 RGB565 및 RGB8888 mode만 지원하고 VRFB는 미러링을 지원하지 않습니다. VRFB 회전은 회전하지 않는 framebuffer보다 훨씬 많은 메모리가 필요하므로 사용 전에 `vram` 설정을 늘려야 할 수 있습니다. framebuffer의 모든 매개변수를 주의해서 다루지 않는 응용 프로그램은 VRFB와 함께 제대로 동작하지 않을 수 있습니다.
커널 부팅 인자
312-355| 인자 | 설명 |
|---|---|
| `omapfb.mode=<display>:<mode>[,...]` | 지정 display의 기본 video mode. 예: `dvi:800x400MR-24@60`. `drivers/video/modedb.c`를 참조하며 TV-out에는 `pal`, `ntsc` 특수 mode도 쓸 수 있습니다. |
| `omapfb.vram=<fbnum>:<size>[@<physaddr>][,...]` | framebuffer용 VRAM. display 크기에 따른 자동 할당 대신 더 크게 할당하거나 물리 주소를 지정할 수 있습니다. `1:4M`은 `fb1`에 4M를 할당합니다. |
| `omapfb.debug=<y|n>` | debug 출력을 켭니다. 커널 설정에서 OMAPFB debug 지원도 활성화해야 합니다. |
| `omapfb.test=<y|n>` | framebuffer 설정이 바뀔 때마다 test pattern을 그립니다. OMAPFB debug 지원이 필요합니다. |
| `omapfb.vrfb=<y|n>` | 모든 framebuffer에 VRFB rotation을 사용합니다. |
| `omapfb.rotate=<angle>` | 모든 framebuffer의 기본 회전. `0`, `1`, `2`, `3`은 각각 0, 90, 180, 270도입니다. |
| `omapfb.mirror=<y|n>` | 모든 framebuffer의 기본 mirror. DMA rotation에서만 동작합니다. |
| `omapdss.def_disp=<display>` | 모든 overlay를 연결할 기본 display 이름. 흔한 예는 `lcd`, `tv`입니다. |
| `omapdss.debug=<y|n>` | debug 출력을 켭니다. 커널 설정에서 DSS debug 지원도 활성화해야 합니다. |
남은 작업
356-372문서가 열거한 남은 작업은 다음과 같습니다.
- DSS locking
- Error checking: 많은 검사가 빠져 있거나 단순히 `BUG()`로 구현되어 있음
- DSI용 System DMA update: RGB16과 RGB24P에는 사용할 수 있지만 빈 byte를 건너뛰어야 하는 RGB24U에는 사용하기 어려울 가능성이 있음
- OMAP1 support가 필요한지는 불확실함
요약과 해설
dss.rst:1-372DSS2는 단일 framebuffer 장치가 아니라 framebuffer, overlay, overlay manager, 물리 display를 분리해 연결하는 디스플레이 파이프라인입니다. 이 분리 덕분에 같은 framebuffer를 여러 출력으로 복제하거나 LCD에서 DVI로 목적지를 바꾸는 구성을 sysfs에서 시험할 수 있습니다.
오디오 인터페이스는 sleep 가능한 준비·구성 단계와 atomic context에서 빠르게 실행해야 하는 시작·중지 단계를 구분합니다. VRFB, CMA, DSI DPLL처럼 메모리와 clock 제약을 함께 이해해야 실제 보드에서 안정적으로 구성할 수 있습니다.
pixel 저장 영역과 물리 출력 사이의 책임을 네 단계로 나눕니다.