diff options
| author | eunhhu <[email protected]> | 2026-09-27 14:59:54 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-27 14:59:54 +0100 |
| commit | 5313285bbfedf6154d2611c4923cff458d7ef271 (patch) | |
| tree | 81a9d1516f5666c351cf716b394523255d9a5183 /docs | |
| parent | 993871c6dfa19cf4e0bd4a16c9aad26cb0025d70 (diff) | |
| download | vega-5313285bbfedf6154d2611c4923cff458d7ef271.tar.gz vega-5313285bbfedf6154d2611c4923cff458d7ef271.zip | |
Put the frames on a display through KMS, checked by writeback
vega display draws the same frames on a display with the kernel's mode
setting and no library between: a connected connector's mode on a CRTC, its
primary plane flipped between two dumb buffers by atomic commits, the grid
as many cells as fit. Frames are drawn in cached memory and copied over,
since blending over write-combined buffers read them back slowly (a 1080p
frame took 370 ms; now 20.6 ms with a vertical sync and the check below).
This Pi has no screen but its display controller has writeback connectors:
--writeback sets a mode on one and takes every frame back as the controller
put it out. Each came back exactly as drawn, and the new check finds it the
pixel surface's frame for the same grid, pixel for pixel.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/design/003-pixel-surface.md | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/docs/design/003-pixel-surface.md b/docs/design/003-pixel-surface.md index f01406d..9d9f2b1 100644 --- a/docs/design/003-pixel-surface.md +++ b/docs/design/003-pixel-surface.md @@ -28,14 +28,29 @@ Raspberry Pi 5. todo 예제에 한글 항목 넷, 48×12칸, 20px: 실행 전체(3.6 MB 심볼 파일 열기, 글리프 약 40개 굽기, 그리기, PPM 쓰기)가 7 ms다. 192×45칸(1920×1350)은 프레임마다 12 ms다(그리기, 합성, 7.8 MB PPM을 `/dev/shm`에 쓰기). +## 디스플레이(KMS) + +`vega display MODULE --symbols FONT.vsym [--size PX] [--card PATH] [--writeback WxH --out PREFIX] < script`: 같은 프레임을 +디스플레이에 낸다(`surfaces/display.c`). 라이브러리 없이 커널의 ioctl로 한다. 연결된 커넥터를 찾아 그 모드를 CRTC에 걸고, +주 평면(primary plane)에 덤 버퍼 둘 중 하나를 atomic 커밋으로 넘긴다. 격자는 화면에 드는 만큼의 칸이다. 프레임은 캐시되는 +메모리에 그린 뒤 덤 버퍼로 복사한다. 덤 버퍼는 write-combine 메모리여서 글리프를 섞으려고 그 메모리를 읽으면 느리다. 처음에는 +그 버퍼에 바로 그렸고, 1080p 한 장에 약 370 ms가 들었다. + +이 Pi(vc4)는 HDMI가 비어 있어도 writeback 커넥터가 둘 있다. 디스플레이 컨트롤러가 내보낸 프레임을 메모리로 되돌려 쓰는 +출력이다. `--writeback`은 그 커넥터에 모드를 걸고, 프레임마다 돌아온 그림을 그린 것과 대 보고 PPM으로 쓴다. 1920×1080에서 +프레임 하나가 20.6 ms다(합성, 복사, 커밋과 수직 동기 한 번(60 Hz, 16.7 ms), 캡처를 읽어 대 보고 6 MB PPM을 쓰기까지). 돌아온 +그림은 늘 그린 것과 같았다(다른 픽셀 0). + ## 확인 +`tests/check.py` 11번과 12번. 12번은 writeback 커넥터가 있으면 같은 스크립트를 디스플레이로 돌린다. 프레임마다 돌아온 그림이 +그린 것과 같고, 같은 격자의 픽셀 표면 그림과 픽셀 하나까지 같다(640×480에서 프레임 둘, 589,512 픽셀). + `tests/check.py` 11번. 같은 스크립트를 `tui --dump`와 `pixels`로 돌려 글이 같고, 그림에서 빈 칸은 그 행의 배경(포커스 행은 제 색)뿐이며 글자가 있는 칸에는 잉크가 있다(프레임 둘, 칸 1,024개). ## 다음 -- 화면에 내기: KMS 덤 버퍼(XRGB8888)에 바로 합성하고 페이지를 넘긴다. 이 Pi는 HDMI가 비어 있어도 writeback 커넥터가 있어 화면 - 없이 확인할 수 있다. 바뀐 칸만 다시 그린다(TUI가 이미 칸마다 보인 것을 기억한다). +- 바뀐 칸만 다시 그리고 복사한다(TUI가 이미 칸마다 보인 것을 기억한다). 커밋을 기다리지 않고 페이지 넘김 이벤트로 맞춘다. - 입력: evdev(키보드, 마우스, 터치). 칸의 격자가 있으니 클릭이 곧 행이다(`vega_hit`). - 비례 글꼴의 줄: 칸이 아닌 글자 폭으로 놓는 표와 문단. 합성은 GPU로(아틀라스, [002](002-symbol-format.md)). |
