UNPKG

4.25 kBMarkdownView Raw
1modetest
2===
3
4DRM/KMS驱动程序libdrm中的模式测试工具
5
6## 补充说明
7
8`modetest` 是一个用于测试和验证 DRM(Direct Rendering Manager)驱动程序功能的命令行工具。
9
10### 安装
11
12- **源码**:[Mesa / drm · GitLab](https://gitlab.freedesktop.org/mesa/drm)
13- **下载**:[Index of /libdrm (dri.freedesktop.org)](https://dri.freedesktop.org/libdrm/)
14
15__编译__
16
17```shell
18./configure --prefix=/opt/ --host=aarch64-linux-gnu
19make && make install
20## 编译删除
21make distclean
22```
23
24__参考__:[libdrm调试准备 - 简书](https://www.jianshu.com/p/a9152ca3e7ab)
25
26### 语法
27
28```shell
29modetest [选项]
30```
31
32### 选项
33
34```shell
35# 查询选项
36-c 列出连接器
37-e 列出编码器
38-f 列出帧缓冲
39-p 列出 CRTCs 和平面
40
41# 测试选项
42-P <plane_id>@<crtc_id>:<w>x<h>[+<x>+<y>][*<scale>][@<format>] 设置一个平面
43-s <connector_id>[,<connector_id>][@<crtc_id>]:<mode>[-<vrefresh>][@<format>] 设置一个显示模式
44-C 测试硬件光标
45-v 测试垂直同步页面翻转
46-w <obj_id>:<prop_name>:<value> 设置属性
47
48# 通用选项
49-a 启用原子模式设置
50-d 在模式设置后放弃主控权限
51-M <module> 指定要使用的驱动程序模块
52-D <device> 指定要使用的设
53```
54
55### 参数
56
57`<modele>` 驱动模块
58
59- i915:Intel 集成显卡驱动模块
60- amdgpu:AMD Radeon 显卡驱动模块
61- radeon:旧版 AMD Radeon 显卡驱动模块
62- nouveau:NVIDIA 开源显卡驱动模块
63- vmwgfx:VMware 显卡驱动模块
64- omapdrm:TI OMAP 显卡驱动模块
65- exynos:三星 Exynos 显卡驱动模块
66- tilcdc:TI LCD 控制器显卡驱动模块
67- msm:Qualcomm MSM 显卡驱动模块
68- sti:STMicroelectronics 显卡驱动模块
69- tegra:NVIDIA Tegra 显卡驱动模块
70- imx-drm:Freescale i.MX 显卡驱动模块
71- rockchip:Rockchip 显卡驱动模块
72
73### 实例
74
75使用 `modetest` 查看相关信息
76
77```shell
78~# modetest
79Encoders: # 省略了好多好多
80id crtc type possible crtcs possible clones
81194 0 Virtual 0x0000000f 0x00000001
82196 88 TMDS 0x00000002 0x00000002
83210 0 DSI 0x00000004 0x00000004
84213 0 TMDS 0x00000001 0x00000008
85
86Connectors: # 省略了好多好多
87id encoder status name size (mm) modes encoders
88197 196 connected HDMI-A-1 530x300 10 196
89 mode # 巴拉巴拉非常多的一大串
90211 210 connected DSI-1 184x114 1 210
91214 0 disconnected DP-1 0x0 0 213
92
93CRTCs: # 省略了好多好多****
94id fb pos size
9568 0 (0,0) (0x0)
96 0 0 0 0 0 0 0 0 0 0 flags: ; type:
9788 0 (0,0) (0x0)
98 0 0 0 0 0 0 0 0 0 0 flags: ; type:
99108 219 (0,0) (1200x1920)
100 1200x1920 60 1200 1280 1284 1344 1920 1955 1956 1981 159400 flags: ; type:
101128 0 (0,0) (0x0)
102 0 0 0 0 0 0 0 0 0 0 flags: ; type:
103
104Planes: # 省略了好多好多
105id crtc fb CRTC x,y x,y gamma size possible crtcs
10654 0 0 0,0 0,0 0 0x0000000f
107 formats: XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV21 NV16 NV61 NV24 NV42 NV15 NV20 NV30 YVYU VYUY YUYV UYVY
10874 0 0 0,0 0,0 0 0x0000000f
109 formats: XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV21 NV16 NV61 NV24 NV42 NV15 NV20 NV30 YVYU VYUY YUYV UYVY
11094 108 219 0,0 0,0 0 0x0000000f
111 formats: XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV21 NV16 NV61 NV24 NV42 NV15 NV20 NV30 YVYU VYUY YUYV UYVY
112
113```
114
115------
116
117根据以上信息在 `MIPI-DSI` 显示设备上使用 `Rockchip` 显卡驱动测试
118
119```shell
120~# modetest -M rockchip -s 211@108:1200x1920 -v
121freq: 59.90Hz
122freq: 59.87Hz
123freq: 59.87Hz
124freq: 59.87Hz
125freq: 59.87Hz
126freq: 59.87Hz
127freq: 59.87Hz
128freq: 59.87Hz
129freq: 59.87Hz
130```
131
132`MIPI` 屏幕上将会看到闪烁的彩色块。
133
134------
135
136```shell
137~# modetest -M rockchip -s 211@108:1200x1920 -C
138setting mode 1200x1920-60Hz@XR24 on connectors 211, crtc 108
139starting cursor
140```
141
142`MIPI` 屏幕上将会看到静止的彩色块。
143
144