Documentation/fb/internals.rst GitHub 원문 ↗

Linux 6.18.37 · Frame Buffer

Frame Buffer device internals

fbdev 사용자·커널 구조체와 visual 형식을 설명하는 한국어 전문 번역입니다.

Source pathDocumentation/fb/internals.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

internals.rst:1-86

fbdev 내부 문서는 사용자 ioctl 구조체와 커널 인스턴스 구조체를 구분하고 monochrome, pseudocolor, truecolor, directcolor, grayscale의 픽셀 해석 차이를 설명합니다.

fbdev 정보 흐름
ioctl`fb_fix_screeninfo`/`fb_var_screeninfo`/`fb_cmap``fb_info`장치별 `par`visual 처리

사용자 요청이 공통 구조체를 거쳐 장치별 상태에 연결됩니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =============================
2 Frame Buffer device internals
3 =============================
4
5 This is a first start for some documentation about frame buffer device
6 internals.
7
8 Authors:
9
10 - Geert Uytterhoeven <geert@linux-m68k.org>, 21 July 1998
11 - James Simmons <jsimmons@user.sf.net>, Nov 26 2002
12
13 --------------------------------------------------------------------------------
14
15 Structures used by the frame buffer device API
16 ==============================================
17
18 The following structures play a role in the game of frame buffer devices. They
19 are defined in <linux/fb.h>.
20
21 1. Outside the kernel (user space)
22
23 - struct fb_fix_screeninfo
24
25 Device independent unchangeable information about a frame buffer device and
26 a specific video mode. This can be obtained using the FBIOGET_FSCREENINFO
27 ioctl.
28
29 - struct fb_var_screeninfo
30
31 Device independent changeable information about a frame buffer device and a
32 specific video mode. This can be obtained using the FBIOGET_VSCREENINFO
33 ioctl, and updated with the FBIOPUT_VSCREENINFO ioctl. If you want to pan
34 the screen only, you can use the FBIOPAN_DISPLAY ioctl.
35
36 - struct fb_cmap
37
38 Device independent colormap information. You can get and set the colormap
39 using the FBIOGETCMAP and FBIOPUTCMAP ioctls.
40
41
42 2. Inside the kernel
43
44 - struct fb_info
45
46 Generic information, API and low level information about a specific frame
47 buffer device instance (slot number, board address, ...).
48
49 - struct `par`
50
51 Device dependent information that uniquely defines the video mode for this
52 particular piece of hardware.
53
54
55 Visuals used by the frame buffer device API
56 ===========================================
57
58
59 Monochrome (FB_VISUAL_MONO01 and FB_VISUAL_MONO10)
60 --------------------------------------------------
61 Each pixel is either black or white.
62
63
64 Pseudo color (FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR)
65 ---------------------------------------------------------------------
66 The whole pixel value is fed through a programmable lookup table that has one
67 color (including red, green, and blue intensities) for each possible pixel
68 value, and that color is displayed.
69
70
71 True color (FB_VISUAL_TRUECOLOR)
72 --------------------------------
73 The pixel value is broken up into red, green, and blue fields.
74
75
76 Direct color (FB_VISUAL_DIRECTCOLOR)
77 ------------------------------------
78 The pixel value is broken up into red, green, and blue fields, each of which
79 are looked up in separate red, green, and blue lookup tables.
80
81
82 Grayscale displays
83 ------------------
84 Grayscale and static grayscale are special variants of pseudo color and static
85 pseudo color, where the red, green and blue components are always equal to
86 each other.
87

3. 한국어 전문 번역

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

프레임 버퍼 내부 문서와 API 구조체

1-20

이 문서는 프레임 버퍼 장치 내부 구조를 설명하기 위한 첫 출발점입니다. Geert Uytterhoeven이 1998년 7월 21일, James Simmons가 2002년 11월 26일에 작성했습니다.

프레임 버퍼 장치 API에서 사용하는 구조체는 `<linux/fb.h>`에 정의됩니다. 다음 절은 user space에서 보이는 구조체와 kernel 내부 구조체를 구분합니다.

fbdev 구조체의 위치
`<linux/fb.h>`user space ioctl 구조체kernel 내부 장치 구조체visual 형식

공통 헤더가 사용자 API와 커널 내부 정보를 함께 정의합니다.

=============================
Frame Buffer device internals
=============================

This is a first start for some documentation about frame buffer device
internals.

Authors:

- Geert Uytterhoeven <geert@linux-m68k.org>, 21 July 1998
- James Simmons <jsimmons@user.sf.net>, Nov 26 2002

--------------------------------------------------------------------------------

Structures used by the frame buffer device API
==============================================

The following structures play a role in the game of frame buffer devices. They
are defined in <linux/fb.h>.

사용자 공간과 커널 내부 구조체

21-54

`struct fb_fix_screeninfo`는 특정 프레임 버퍼 장치와 비디오 모드의 장치 독립적이고 변경할 수 없는 정보를 담습니다. `FBIOGET_FSCREENINFO` ioctl로 얻습니다.

`struct fb_var_screeninfo`는 장치 독립적이지만 변경 가능한 비디오 모드 정보를 담습니다. `FBIOGET_VSCREENINFO`로 읽고 `FBIOPUT_VSCREENINFO`로 갱신하며, 화면 pan만 필요하면 `FBIOPAN_DISPLAY`를 사용합니다.

`struct fb_cmap`은 장치 독립적인 color map 정보이며 `FBIOGETCMAP`과 `FBIOPUTCMAP` ioctl로 읽고 설정합니다.

커널 내부의 `struct fb_info`는 특정 프레임 버퍼 인스턴스의 일반 정보, API와 slot 번호·board address 같은 저수준 정보를 보관합니다. `struct par`는 특정 하드웨어의 비디오 모드를 고유하게 정의하는 장치 종속 정보입니다.

fbdev 핵심 구조체
영역구조체역할관련 ioctl
사용자`struct fb_fix_screeninfo`고정 정보`FBIOGET_FSCREENINFO`
사용자`struct fb_var_screeninfo`가변 모드 정보`FBIOGET_VSCREENINFO`, `FBIOPUT_VSCREENINFO`, `FBIOPAN_DISPLAY`
사용자`struct fb_cmap`컬러 맵`FBIOGETCMAP`, `FBIOPUTCMAP`
커널`struct fb_info`인스턴스와 API 정보내부 사용
커널`struct par`장치 종속 모드 정보내부 사용

1. Outside the kernel (user space)

  - struct fb_fix_screeninfo

    Device independent unchangeable information about a frame buffer device and
    a specific video mode. This can be obtained using the FBIOGET_FSCREENINFO
    ioctl.

  - struct fb_var_screeninfo

    Device independent changeable information about a frame buffer device and a
    specific video mode. This can be obtained using the FBIOGET_VSCREENINFO
    ioctl, and updated with the FBIOPUT_VSCREENINFO ioctl. If you want to pan
    the screen only, you can use the FBIOPAN_DISPLAY ioctl.

  - struct fb_cmap

    Device independent colormap information. You can get and set the colormap
    using the FBIOGETCMAP and FBIOPUTCMAP ioctls.


2. Inside the kernel

  - struct fb_info

    Generic information, API and low level information about a specific frame
    buffer device instance (slot number, board address, ...).

  - struct `par`

    Device dependent information that uniquely defines the video mode for this
    particular piece of hardware.

프레임 버퍼 visual 형식

55-86

`FB_VISUAL_MONO01`과 `FB_VISUAL_MONO10`은 각 픽셀이 검정 또는 흰색인 monochrome 형식입니다.

`FB_VISUAL_PSEUDOCOLOR`와 `FB_VISUAL_STATIC_PSEUDOCOLOR`에서는 전체 픽셀 값이 programmable lookup table의 인덱스가 됩니다. 가능한 각 픽셀 값에 빨강·초록·파랑 강도를 포함한 하나의 색이 대응합니다.

`FB_VISUAL_TRUECOLOR`는 픽셀 값을 빨강, 초록, 파랑 field로 직접 나눕니다. `FB_VISUAL_DIRECTCOLOR`도 RGB field로 나누지만 각 field를 별도의 red, green, blue lookup table에서 조회합니다.

grayscale과 static grayscale은 pseudo color와 static pseudo color의 특수한 변형이며 빨강, 초록, 파랑 성분이 항상 서로 같습니다.

프레임 버퍼 visual 비교
visual픽셀 해석
`FB_VISUAL_MONO01`, `FB_VISUAL_MONO10`검정 또는 흰색
`FB_VISUAL_PSEUDOCOLOR`전체 픽셀 값으로 programmable RGB table 조회
`FB_VISUAL_STATIC_PSEUDOCOLOR`전체 픽셀 값으로 고정 RGB table 조회
`FB_VISUAL_TRUECOLOR`픽셀 안의 RGB field를 직접 사용
`FB_VISUAL_DIRECTCOLOR`RGB field마다 별도 lookup table 조회
grayscalepseudo color에서 R=G=B

Visuals used by the frame buffer device API
===========================================


Monochrome (FB_VISUAL_MONO01 and FB_VISUAL_MONO10)
--------------------------------------------------
Each pixel is either black or white.


Pseudo color (FB_VISUAL_PSEUDOCOLOR and FB_VISUAL_STATIC_PSEUDOCOLOR)
---------------------------------------------------------------------
The whole pixel value is fed through a programmable lookup table that has one
color (including red, green, and blue intensities) for each possible pixel
value, and that color is displayed.


True color (FB_VISUAL_TRUECOLOR)
--------------------------------
The pixel value is broken up into red, green, and blue fields.


Direct color (FB_VISUAL_DIRECTCOLOR)
------------------------------------
The pixel value is broken up into red, green, and blue fields, each of which
are looked up in separate red, green, and blue lookup tables.


Grayscale displays
------------------
Grayscale and static grayscale are special variants of pseudo color and static
pseudo color, where the red, green and blue components are always equal to
each other.