tools:modetest代码逻辑

参考代码:https://cgit.freedesktop.org/mesa/drm/tree/tests/modetest

modetest本质上是设置property,加载图片,显示单一静态图片.

main 函数
1.解析输入参数

    parse_plane 图像格式,分辨率长宽,绑定的crtcid
        struct plane_args 里面有:                        
	        uint32_t crtc_id;& unsigned int fb_id; 印证plane是fb与crtc的桥梁。绑定crtc与framebuffer
	        bool has_position;& int32_t x, y;& uint32_t w, h; 位置大小
	        double scale; 支持缩放
	        struct bo *bo;
	        char format_str[5];& unsigned int fourcc;  图像格式
    parse_connector 图像格式,绑定的ctrcid,connectorid,刷新率
        贴一段pipe_args的注释:
            Mode setting with the kernel interfaces is a bit of a chore. 
            First you have to find the connector in question and make sure the requested mode is available. 
            Then you need to find the encoder attached to that connector so you can bind it with a free crtc.
            这也是为什么结构体叫做pipe_args.你需要对应crtc->encoder->connector;而这个通路,称为pipe
        struct pipe_args 里面有:
    	    const char **cons;& uint32_t *con_ids;& unsigned int num_cons; connector名字,数量,id
	        uint32_t crtc_id;& struct crtc *crtc; 真正的crtc结构体和crtc id
	        char mode_str[64];&  drmModeModeInfo *mode; &unsigned int vrefresh; 图像模式
	        char format_str[5];&
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值