요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=================================
modedb default video mode support
=================================
Currently all frame buffer device drivers have their own video mode databases,
which is a mess and a waste of resources. The main idea of modedb is to have
- one routine to probe for video modes, which can be used by all frame buffer
devices
- one generic video mode database with a fair amount of standard videomodes
(taken from XFree86)
- the possibility to supply your own mode database for graphics hardware that
needs non-standard modes, like amifb and Mac frame buffer drivers (which
use macmodes.c)
When a frame buffer device receives a video= option it doesn't know, it should
consider that to be a video mode option. If no frame buffer device is specified
in a video= option, fbmem considers that to be a global video mode option.
Valid mode specifiers (mode_option argument)::
<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
<name>[-<bpp>][@<refresh>]
with <xres>, <yres>, <bpp> and <refresh> decimal numbers and <name> a string.
Things between square brackets are optional.
Valid names are::
- NSTC: 480i output, with the CCIR System-M TV mode and NTSC color encoding
- NTSC-J: 480i output, with the CCIR System-M TV mode, the NTSC color
encoding, and a black level equal to the blanking level.
- PAL: 576i output, with the CCIR System-B TV mode and PAL color encoding
- PAL-M: 480i output, with the CCIR System-M TV mode and PAL color encoding
If 'M' is specified in the mode_option argument (after <yres> and before
<bpp> and <refresh>, if specified) the timings will be calculated using
VESA(TM) Coordinated Video Timings instead of looking up the mode from a table.
If 'R' is specified, do a 'reduced blanking' calculation for digital displays.
If 'i' is specified, calculate for an interlaced mode. And if 'm' is
specified, add margins to the calculation (1.8% of xres rounded down to 8
pixels and 1.8% of yres).
Sample usage: 1024x768M@60m - CVT timing with margins
DRM drivers also add options to enable or disable outputs:
'e' will force the display to be enabled, i.e. it will override the detection
if a display is connected. 'D' will force the display to be enabled and use
digital output. This is useful for outputs that have both analog and digital
signals (e.g. HDMI and DVI-I). For other outputs it behaves like 'e'. If 'd'
is specified the output is disabled.
You can additionally specify which output the options matches to.
To force the VGA output to be enabled and drive a specific mode say::
video=VGA-1:1280x1024@60me
Specifying the option multiple times for different ports is possible, e.g.::
video=LVDS-1:d video=HDMI-1:D
Options can also be passed after the mode, using commas as separator.
Sample usage: 720x480,rotate=180 - 720x480 mode, rotated by 180 degrees
Valid options are::
- margin_top, margin_bottom, margin_left, margin_right (integer):
Number of pixels in the margins, typically to deal with overscan on TVs
- reflect_x (boolean): Perform an axial symmetry on the X axis
- reflect_y (boolean): Perform an axial symmetry on the Y axis
- rotate (integer): Rotate the initial framebuffer by x
degrees. Valid values are 0, 90, 180 and 270.
- tv_mode: Analog TV mode. One of "NTSC", "NTSC-443", "NTSC-J", "PAL",
"PAL-M", "PAL-N", or "SECAM".
- panel_orientation, one of "normal", "upside_down", "left_side_up", or
"right_side_up". For KMS drivers only, this sets the "panel orientation"
property on the kms connector as hint for kms users.
-----------------------------------------------------------------------------
What is the VESA(TM) Coordinated Video Timings (CVT)?
=====================================================
From the VESA(TM) Website:
"The purpose of CVT is to provide a method for generating a consistent
and coordinated set of standard formats, display refresh rates, and
timing specifications for computer display products, both those
employing CRTs, and those using other display technologies. The
intention of CVT is to give both source and display manufacturers a
common set of tools to enable new timings to be developed in a
consistent manner that ensures greater compatibility."
This is the third standard approved by VESA(TM) concerning video timings. The
first was the Discrete Video Timings (DVT) which is a collection of
pre-defined modes approved by VESA(TM). The second is the Generalized Timing
Formula (GTF) which is an algorithm to calculate the timings, given the
pixelclock, the horizontal sync frequency, or the vertical refresh rate.
The GTF is limited by the fact that it is designed mainly for CRT displays.
It artificially increases the pixelclock because of its high blanking
requirement. This is inappropriate for digital display interface with its high
data rate which requires that it conserves the pixelclock as much as possible.
Also, GTF does not take into account the aspect ratio of the display.
The CVT addresses these limitations. If used with CRT's, the formula used
is a derivation of GTF with a few modifications. If used with digital
displays, the "reduced blanking" calculation can be used.
From the framebuffer subsystem perspective, new formats need not be added
to the global mode database whenever a new mode is released by display
manufacturers. Specifying for CVT will work for most, if not all, relatively
new CRT displays and probably with most flatpanels, if 'reduced blanking'
calculation is specified. (The CVT compatibility of the display can be
determined from its EDID. The version 1.3 of the EDID has extra 128-byte
blocks where additional timing information is placed. As of this time, there
is no support yet in the layer to parse this additional blocks.)
CVT also introduced a new naming convention (should be seen from dmesg output)::
<pix>M<a>[-R]
where: pix = total amount of pixels in MB (xres x yres)
M = always present
a = aspect ratio (3 - 4:3; 4 - 5:4; 9 - 15:9, 16:9; A - 16:10)
-R = reduced blanking
example: .48M3-R - 800x600 with reduced blanking
Note: VESA(TM) has restrictions on what is a standard CVT timing:
- aspect ratio can only be one of the above values
- acceptable refresh rates are 50, 60, 70 or 85 Hz only
- if reduced blanking, the refresh rate must be at 60Hz
If one of the above are not satisfied, the kernel will print a warning but the
timings will still be calculated.
-----------------------------------------------------------------------------
To find a suitable video mode, you just call::
int __init fb_find_mode(struct fb_var_screeninfo *var,
struct fb_info *info, const char *mode_option,
const struct fb_videomode *db, unsigned int dbsize,
const struct fb_videomode *default_mode,
unsigned int default_bpp)
with db/dbsize your non-standard video mode database, or NULL to use the
standard video mode database.
fb_find_mode() first tries the specified video mode (or any mode that matches,
e.g. there can be multiple 640x480 modes, each of them is tried). If that
fails, the default mode is tried. If that fails, it walks over all modes.
To specify a video mode at bootup, use the following boot options::
video=<driver>:<xres>x<yres>[-<bpp>][@refresh]
where <driver> is a name from the table below. Valid default modes can be
found in drivers/video/fbdev/core/modedb.c. Check your driver's documentation.
There may be more modes::
Drivers that support modedb boot options
Boot Name Cards Supported
amifb - Amiga chipset frame buffer
aty128fb - ATI Rage128 / Pro frame buffer
atyfb - ATI Mach64 frame buffer
pm2fb - Permedia 2/2V frame buffer
pm3fb - Permedia 3 frame buffer
sstfb - Voodoo 1/2 (SST1) chipset frame buffer
tdfxfb - 3D Fx frame buffer
tridentfb - Trident (Cyber)blade chipset frame buffer
vt8623fb - VIA 8623 frame buffer
BTW, only a few fb drivers use this at the moment. Others are to follow
(feel free to send patches). The DRM drivers also support this.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
공통 비디오 모드 데이터베이스의 목적
1-20각 framebuffer driver가 별도 video mode database를 갖는 중복과 자원 낭비를 줄이는 것이 `modedb`의 목적입니다.
모든 framebuffer device가 함께 쓰는 mode probe routine 하나, XFree86에서 가져온 표준 mode를 충분히 포함한 generic database 하나, 그리고 `amifb`나 `macmodes.c`를 사용하는 Mac driver처럼 비표준 mode가 필요한 하드웨어가 자체 database를 제공하는 기능을 목표로 합니다.
framebuffer device가 알 수 없는 `video=` option을 받으면 video mode option으로 취급해야 합니다. `video=`에 driver가 지정되지 않으면 `fbmem`이 global video mode option으로 처리합니다.
공통 database와 장치별 예외 database를 한 probe 경로에서 사용합니다.
=================================
modedb default video mode support
=================================
Currently all frame buffer device drivers have their own video mode databases,
which is a mess and a waste of resources. The main idea of modedb is to have
- one routine to probe for video modes, which can be used by all frame buffer
devices
- one generic video mode database with a fair amount of standard videomodes
(taken from XFree86)
- the possibility to supply your own mode database for graphics hardware that
needs non-standard modes, like amifb and Mac frame buffer drivers (which
use macmodes.c)
When a frame buffer device receives a video= option it doesn't know, it should
consider that to be a video mode option. If no frame buffer device is specified
in a video= option, fbmem considers that to be a global video mode option.
mode_option 형식과 CVT suffix
21-46유효한 형식은 `<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]` 또는 `<name>[-<bpp>][@<refresh>]`입니다. `xres`, `yres`, `bpp`, `refresh`는 10진수이고 `name`은 문자열이며 대괄호 항목은 선택 사항입니다.
이름은 원문 표기의 `NSTC` 480i System-M/NTSC, `NTSC-J` 480i System-M/NTSC와 blanking level과 같은 black level, `PAL` 576i System-B/PAL, `PAL-M` 480i System-M/PAL을 지원합니다. 원문의 `NSTC` 철자를 그대로 보존합니다.
`M`은 table lookup 대신 VESA Coordinated Video Timings(CVT)로 계산합니다. `R`은 digital display용 reduced blanking, `i`는 interlaced mode, `m`은 margin 추가를 뜻합니다. margin은 xres의 1.8%를 8픽셀 단위로 내림하고 yres의 1.8%를 사용합니다.
예시 `1024x768M@60m`은 margin을 포함한 CVT 1024x768 60 Hz mode입니다.
Valid mode specifiers (mode_option argument)::
<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
<name>[-<bpp>][@<refresh>]
with <xres>, <yres>, <bpp> and <refresh> decimal numbers and <name> a string.
Things between square brackets are optional.
Valid names are::
- NSTC: 480i output, with the CCIR System-M TV mode and NTSC color encoding
- NTSC-J: 480i output, with the CCIR System-M TV mode, the NTSC color
encoding, and a black level equal to the blanking level.
- PAL: 576i output, with the CCIR System-B TV mode and PAL color encoding
- PAL-M: 480i output, with the CCIR System-M TV mode and PAL color encoding
If 'M' is specified in the mode_option argument (after <yres> and before
<bpp> and <refresh>, if specified) the timings will be calculated using
VESA(TM) Coordinated Video Timings instead of looking up the mode from a table.
If 'R' is specified, do a 'reduced blanking' calculation for digital displays.
If 'i' is specified, calculate for an interlaced mode. And if 'm' is
specified, add margins to the calculation (1.8% of xres rounded down to 8
pixels and 1.8% of yres).
Sample usage: 1024x768M@60m - CVT timing with margins
DRM 출력 선택과 후행 옵션
47-81DRM driver는 output 활성화 옵션을 추가합니다. `e`는 연결 감지를 덮어쓰고 display를 강제로 켭니다. `D`는 display를 강제로 켜고 digital output을 사용하며 HDMI나 DVI-I처럼 analog와 digital signal이 모두 있는 output에 유용합니다. 그 밖의 output에서는 `e`처럼 동작합니다. `d`는 output을 끕니다.
output 이름도 지정할 수 있습니다. `video=VGA-1:1280x1024@60me`는 VGA-1을 강제로 켜고 지정 mode와 margin을 사용합니다. 여러 port에는 `video=LVDS-1:d video=HDMI-1:D`처럼 option을 반복합니다.
쉼표로 mode 뒤에 추가 option을 둘 수 있습니다. `720x480,rotate=180`은 720x480 framebuffer를 180도 회전합니다.
`margin_top`, `margin_bottom`, `margin_left`, `margin_right`는 TV overscan을 보정할 픽셀 수입니다. `reflect_x`, `reflect_y`는 각 축 대칭, `rotate`는 0/90/180/270도 회전입니다.
`tv_mode`는 `NTSC`, `NTSC-443`, `NTSC-J`, `PAL`, `PAL-M`, `PAL-N`, `SECAM` 가운데 하나입니다. KMS 전용 `panel_orientation`은 `normal`, `upside_down`, `left_side_up`, `right_side_up` 가운데 하나이고 KMS 사용자에게 connector panel 방향 hint를 제공합니다.
DRM drivers also add options to enable or disable outputs:
'e' will force the display to be enabled, i.e. it will override the detection
if a display is connected. 'D' will force the display to be enabled and use
digital output. This is useful for outputs that have both analog and digital
signals (e.g. HDMI and DVI-I). For other outputs it behaves like 'e'. If 'd'
is specified the output is disabled.
You can additionally specify which output the options matches to.
To force the VGA output to be enabled and drive a specific mode say::
video=VGA-1:1280x1024@60me
Specifying the option multiple times for different ports is possible, e.g.::
video=LVDS-1:d video=HDMI-1:D
Options can also be passed after the mode, using commas as separator.
Sample usage: 720x480,rotate=180 - 720x480 mode, rotated by 180 degrees
Valid options are::
- margin_top, margin_bottom, margin_left, margin_right (integer):
Number of pixels in the margins, typically to deal with overscan on TVs
- reflect_x (boolean): Perform an axial symmetry on the X axis
- reflect_y (boolean): Perform an axial symmetry on the Y axis
- rotate (integer): Rotate the initial framebuffer by x
degrees. Valid values are 0, 90, 180 and 270.
- tv_mode: Analog TV mode. One of "NTSC", "NTSC-443", "NTSC-J", "PAL",
"PAL-M", "PAL-N", or "SECAM".
- panel_orientation, one of "normal", "upside_down", "left_side_up", or
"right_side_up". For KMS drivers only, this sets the "panel orientation"
property on the kms connector as hint for kms users.
VESA CVT가 해결하는 타이밍 문제
82-121VESA CVT는 CRT와 다른 display 기술을 모두 대상으로 표준 format, refresh rate와 timing 규격을 일관되게 생성해 source와 display 제조사가 호환성 높은 새 timing을 개발하도록 공통 도구를 제공하는 표준입니다.
VESA의 첫 timing 표준 DVT는 승인된 pre-defined mode 모음이고, 두 번째 Generalized Timing Formula(GTF)는 pixel clock, horizontal sync frequency 또는 vertical refresh rate로 timing을 계산하는 algorithm입니다.
GTF는 주로 CRT를 위해 설계되어 blanking 요구량이 크고 pixel clock을 인위적으로 높입니다. 높은 data rate에서 pixel clock을 아껴야 하는 digital display interface에는 부적합하며 display aspect ratio도 고려하지 않습니다.
CVT는 CRT에서는 수정된 GTF를 사용하고 digital display에서는 reduced blanking을 제공해 이 제약을 해결합니다. 따라서 제조사가 새 mode를 내놓을 때마다 global database에 format을 추가할 필요가 줄어듭니다.
새 CRT는 대부분 CVT와 동작하고 flat panel은 reduced blanking을 쓰면 대체로 동작할 가능성이 있습니다. display의 CVT 호환성은 EDID에서 확인할 수 있습니다. EDID 1.3의 추가 128-byte block에 timing 정보가 있지만 문서 작성 시점의 layer는 이를 parse하지 못했습니다.
-----------------------------------------------------------------------------
What is the VESA(TM) Coordinated Video Timings (CVT)?
=====================================================
From the VESA(TM) Website:
"The purpose of CVT is to provide a method for generating a consistent
and coordinated set of standard formats, display refresh rates, and
timing specifications for computer display products, both those
employing CRTs, and those using other display technologies. The
intention of CVT is to give both source and display manufacturers a
common set of tools to enable new timings to be developed in a
consistent manner that ensures greater compatibility."
This is the third standard approved by VESA(TM) concerning video timings. The
first was the Discrete Video Timings (DVT) which is a collection of
pre-defined modes approved by VESA(TM). The second is the Generalized Timing
Formula (GTF) which is an algorithm to calculate the timings, given the
pixelclock, the horizontal sync frequency, or the vertical refresh rate.
The GTF is limited by the fact that it is designed mainly for CRT displays.
It artificially increases the pixelclock because of its high blanking
requirement. This is inappropriate for digital display interface with its high
data rate which requires that it conserves the pixelclock as much as possible.
Also, GTF does not take into account the aspect ratio of the display.
The CVT addresses these limitations. If used with CRT's, the formula used
is a derivation of GTF with a few modifications. If used with digital
displays, the "reduced blanking" calculation can be used.
From the framebuffer subsystem perspective, new formats need not be added
to the global mode database whenever a new mode is released by display
manufacturers. Specifying for CVT will work for most, if not all, relatively
new CRT displays and probably with most flatpanels, if 'reduced blanking'
calculation is specified. (The CVT compatibility of the display can be
determined from its EDID. The version 1.3 of the EDID has extra 128-byte
blocks where additional timing information is placed. As of this time, there
is no support yet in the layer to parse this additional blocks.)
CVT 이름 규칙과 표준 조건
122-143CVT가 도입한 dmesg 이름 형식은 `<pix>M<a>[-R]`입니다. `pix`는 `xres*yres`의 전체 픽셀 수를 MB 단위로 나타내고 `M`은 항상 존재합니다. `a`는 aspect ratio로 3은 4:3, 4는 5:4, 9는 15:9 또는 16:9, A는 16:10입니다. `-R`은 reduced blanking입니다.
예시 `.48M3-R`은 reduced blanking을 쓰는 800x600 mode입니다.
표준 CVT timing은 aspect ratio가 정의된 값 가운데 하나여야 하고 refresh rate는 50, 60, 70, 85 Hz만 허용합니다. reduced blanking에서는 60 Hz여야 합니다. 조건을 위반하면 kernel이 warning을 출력하지만 timing 계산은 계속합니다.
CVT also introduced a new naming convention (should be seen from dmesg output)::
<pix>M<a>[-R]
where: pix = total amount of pixels in MB (xres x yres)
M = always present
a = aspect ratio (3 - 4:3; 4 - 5:4; 9 - 15:9, 16:9; A - 16:10)
-R = reduced blanking
example: .48M3-R - 800x600 with reduced blanking
Note: VESA(TM) has restrictions on what is a standard CVT timing:
- aspect ratio can only be one of the above values
- acceptable refresh rates are 50, 60, 70 or 85 Hz only
- if reduced blanking, the refresh rate must be at 60Hz
If one of the above are not satisfied, the kernel will print a warning but the
timings will still be calculated.
-----------------------------------------------------------------------------
`fb_find_mode()` 검색 순서와 boot option
144-182적합한 mode를 찾을 때 `fb_find_mode(struct fb_var_screeninfo *var, struct fb_info *info, const char *mode_option, const struct fb_videomode *db, unsigned int dbsize, const struct fb_videomode *default_mode, unsigned int default_bpp)`를 호출합니다.
`db`와 `dbsize`는 non-standard mode database이고 `NULL`이면 standard database를 사용합니다. `fb_find_mode()`는 먼저 지정 mode와 일치하는 모든 후보를 시도하고, 실패하면 default mode, 다시 실패하면 database 전체를 순회합니다.
부팅 형식은 `video=<driver>:<xres>x<yres>[-<bpp>][@refresh]`입니다. 기본 mode는 `drivers/video/fbdev/core/modedb.c`에서 찾고 driver 문서에 추가 mode가 있는지 확인합니다.
문서의 지원 driver 목록은 `amifb`, `aty128fb`, `atyfb`, `pm2fb`, `pm3fb`, `sstfb`, `tdfxfb`, `tridentfb`, `vt8623fb`입니다. 당시에는 일부 fb driver만 사용했지만 DRM driver도 이 option을 지원합니다.
명시한 mode에서 전체 database까지 단계적으로 범위를 넓힙니다.
To find a suitable video mode, you just call::
int __init fb_find_mode(struct fb_var_screeninfo *var,
struct fb_info *info, const char *mode_option,
const struct fb_videomode *db, unsigned int dbsize,
const struct fb_videomode *default_mode,
unsigned int default_bpp)
with db/dbsize your non-standard video mode database, or NULL to use the
standard video mode database.
fb_find_mode() first tries the specified video mode (or any mode that matches,
e.g. there can be multiple 640x480 modes, each of them is tried). If that
fails, the default mode is tried. If that fails, it walks over all modes.
To specify a video mode at bootup, use the following boot options::
video=<driver>:<xres>x<yres>[-<bpp>][@refresh]
where <driver> is a name from the table below. Valid default modes can be
found in drivers/video/fbdev/core/modedb.c. Check your driver's documentation.
There may be more modes::
Drivers that support modedb boot options
Boot Name Cards Supported
amifb - Amiga chipset frame buffer
aty128fb - ATI Rage128 / Pro frame buffer
atyfb - ATI Mach64 frame buffer
pm2fb - Permedia 2/2V frame buffer
pm3fb - Permedia 3 frame buffer
sstfb - Voodoo 1/2 (SST1) chipset frame buffer
tdfxfb - 3D Fx frame buffer
tridentfb - Trident (Cyber)blade chipset frame buffer
vt8623fb - VIA 8623 frame buffer
BTW, only a few fb drivers use this at the moment. Others are to follow
(feel free to send patches). The DRM drivers also support this.
요약·해설
modedb.rst:1-182`modedb`는 공통 mode database와 `fb_find_mode()` fallback을 제공하고 CVT, reduced blanking, interlace, margin, DRM output와 회전·TV option을 하나의 `video=` 형식으로 표현합니다.
문자열 mode를 timing과 output 상태로 변환합니다.