CRTC
Streams the framebuffer following the screen’s timings
Driving screens : the CRT ControllerDriving screens : the CRT Controller
Streams the framebuffer following the screen’s timings
After each line, the CRTC must wait for the CRT to go back to the beginning of the next line (Horizontal Blank)
After each frame, the CRTC must wait for the CRT to go back to the first line (Vertical Blank)
Timings are met by programming the CRTC clock using PLLs
配置正确的显示设置,显示器时序和显示器分辨率。将framebuffer的内容扫描输出到一个或多个显示器。
更新 frame buffer,通过 struct drm_crtc_funcs 和 struct drm_crtc_helper_funcs 两个结构体来实现。
Configuring the CRTC
Extended display identification data Stored in each connector of the screen (small EEPROM)
Is usually accessed via a dedicated I2C line in the connector
Holds the modes supported by the screen connector
Processed by the host driver and exposed with the tool xrandr, see:
xrandr --verbose
Implement
struct drm_crtc_funcs {
[...]
int (*set_config)(struct drm_mode_set *set);
int (*page_flip)(struct drm_crtc *crtc, struct drm_framebuffer *fb, struct drm_pending_vblank_event *event, uint32_t flags);
[...]
};
set_config 主要负责配置以下几个事情:
更新待送显的 frame buffer
配置显示模式,主要是时序和分辨率
将连接器和编码器附到CRTC上
推荐使用** drm_crtc_helper_set_config **函数, 然后实现 **drm_crtc_helper_funcs **结构体,
除非你知道你自己在做什么.
struct drm_crtc_helper_funcs {
[...]
int (*mode_set)( struct drm_crtc *crtc, struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode,
int x, int y, struct drm_framebuffer *old_fb );
[...]
};