crtc 原理

2023-12-25 11:29:50

CRTC

Streams the framebuffer following the screen’s timings

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ca7QuYJA-1690187809168)(/uploads/andi/images/m_d5b86a6420d9e64c62fa355998855e3d_r.png)]

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 两个结构体来实现。
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-psfeH1mP-1690187809170)(/uploads/andi/images/m_2678a05b0c3db8bfa78a23e010580187_r.png)]

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 );
[...]
};

文章来源:https://blog.csdn.net/qq_38350702/article/details/131899589
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。