解压后进入libdrm-2.4.104目录 ,参考官网如下图操作即可。
mkdir build
mkdir install
创建cross_file.txt
meson --prefix=/root/work/code/software/drm/libdrm-2.4.104/install --cross-file=../cross_file.txt -D radeon=true -Dudev=true && ninja
njnja install
在cross_file.txt中指定编译器
[binaries]
c = 'aarch64-linux-gnu-gcc'
cpp = 'aarch64-linux-gnu-gcc'
ar = 'aarch64-linux-gnu-ar'
strip = 'aarch64-linux-gnu-strip'
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'armv7'
endian = 'little'
[build_machine]
system = 'linux'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
使用modetest
命令前,先停止使用/dev/dri/card0
节点的应用程序。
可以使用systemctl
命令,停止桌面显示服务,然后使用modetest
命令测试。
systemctl stop lightdm.service
## 1.停止桌面显示
root@linaro-alip:~# systemctl stop lightdm.service
[ 682.983722] rockchip-vop ff900000.vop: [drm:vop_crtc_enable] Update mode to 1024x768p60, type: 11
#modetest 参数
modetest -h #帮助
Query options:#用于查询的参数选项
-c list connectors #列举出所有的connectors
-e list encoders #列举出所有的encoders
-f list framebuffers #列举出所有的framebuffers
-p list CRTCs and planes (pipes) #列举出所有的CRTCs和planes
Test options:#用于测试的参数选项
#-P给CRTC指定plane
-P <plane_id>@<crtc_id>:<w>x<h>[+<x>+<y>][*<scale>][@<format>] set a plane
#-s 设置输出模式,选择connector和crtc
-s <connector_id>[,<connector_id>][@<crtc_id>]:[#<mode index>]<mode>[-<vrefresh>][@<format>] set a mode
-C test hw cursor
-v test vsynced page flipping
-r set the preferred mode for all connectors
-w <obj_id>:<prop_name>:<value> set property
-a use atomic API
-F pattern1,pattern2 specify fill patterns
Generic options:#指定打开设备、驱动
-d drop master after mode set
-M module use the given driver
-D device use the given device
Default is to dump all info.
#例子
#-s <connector_id>[,<connector_id>][@<crtc_id>]:[#<mode index>]<mode>[-<vrefresh>][@<format>]
#-P <plane_id>@<crtc_id>:<w>x<h>[+<x>+<y>][*<scale>][@<format>] set a plane
modetest -s 37@35:1024x768 -P 33@35:1024x768
$modetest -M atmel-hlcdc -s 24@31:800x480
24是connect id, 31 crtc id,这些id可以使用$./modetest 命令来获取
执行命令后
800x480的屏幕上会显示彩条
$modetest -M atmel-hlcdc -s 24@31:800x480 -w 30:alpha:100 -P 30@31:200x200+200+200
在base plane上显示id为30的plane,位置为(200,200),大小为200x200,同时设定该plane的透明度为100(最大255),这里的-w是设定property 参数