sys结点位置: /sys/module/drm/parameters/debug
debug:Enable debug output, where each bit enables a debug category.
Bit 0 (0x01) will enable CORE messages (drm core code)
Bit 1 (0x02) will enable DRIVER messages (drm controller code)
Bit 2 (0x04) will enable KMS messages (modesetting code)
Bit 3 (0x08) will enable PRIME messages (prime code)
Bit 4 (0x10) will enable ATOMIC messages (atomic code)
Bit 5 (0x20) will enable VBL messages (vblank code) (int)
示例: echo 0x0c > /sys/module/drm/parameters/debug
打开了KMS, PRIME这些的打印, kernel驱动中使用DRM_DEBUG_KMS和
DRM_DEBUG_PRIME打印的信息都可以打印出来
一般设置为如下值:
echo 0x1f > /sys/module/drm/parameters/debug
(shell)# cat /sys/kernel/debug/clk/clk_summary | grep vop
dclk_vop0 2 2 135000000 0 0
dclk_vop1 0 1 0 0 0
aclk_vop0 2 3 594000000 0 0
aclk_vop1 0 2 594000000 0 0
hclk_vop0 2 3 198000000 0 0
hclk_vop1 0 2 198000000 0 0
需要关注的
显示时钟为:
dclk_vop:
即pixel clock, 像素时钟, 该时钟由具体的显示timing决定, 如果dclk不正确, 可能导致fps不对或直接不显示.
edp, mipi, lvds等显示接口对应dclk的容忍性较好, 有些偏差也不影响正常显示. 但hdmi, dp等高清显示接口,
是有严格要求的, 这类显示接口的频率要给的很精准.
aclk_vop:
如果该时钟频率太低, 可能会导致显示出现抖动, 另外如果aclk 没有使能的话, 访问vop的寄存器也可能引发
总线挂死
hclk_vop:
如果该时钟未使能, 不能访问vop的寄存器, 一但访问vop寄存器, 会造成总线挂死.
dmesg | grep drm
rk3399_all:/ # cat /d/dri/0/summary
VOP [ff900000.vop]: DISABLED
VOP [ff8f0000.vop]: ACTIVE
Connector: DSI
overlay_mode[0] bus_format[0] output_mode[0] color_space[0]
Display mode: 1920x1080p60
clk[147444] real_clk[147444] type[8] flag[a]
H: 1920 2120 2140 2200
V: 1080 1106 1114 1126
win0-0: ACTIVE
format: AB24 little-endian (0x34324241) SDR[0] color_space[0]
csc: y2r[0] r2r[0] r2y[0] csc mode[0]
zpos: 1
src: pos[0x0] rect[1920x1080]
dst: pos[0x0] rect[1920x1080]
buf[0]: addr: 0x0000000005906000 pitch: 7680 offset: 0
win2-0: ACTIVE
format: XB24 little-endian (0x34324258) SDR[0] color_space[0]
csc: y2r[0] r2r[0] r2y[0] csc mode[0]
zpos: 0
src: pos[0x0] rect[1920x1080]
dst: pos[0x0] rect[1920x1080]
buf[0]: addr: 0x000000000202a000 pitch: 7680 offset: 0
win2-1: DISABLED
win2-2: DISABLED
win2-3: DISABLED
post: sdr2hdr[0] hdr2sdr[0]
pre : sdr2hdr[0]
post CSC: r2y[0] y2r[0] CSC mode[0]
cat /d/dw-hdmi/status
不管hdmi接没接, 强行使能hdmi
echo on > /sys/devices/platform/display-subsystem/drm/card0/card0-HDMI-A-1/status
关闭hdmi
echo off > /sys/devices/platform/display-subsystem/drm/card0/card0-HDMI-A-1/status
监测hdmi插拔,正常情况以就是在这个状态
echo detect > /sys/devices/platform/display-subsystem/drm/card0/card0-HDMI-A-1/status