SCREEN 的启动
screen 服务在 qnx 系统中一般由命令 screen -c /lib64/graphics.conf 启动,这个动作通常由 startupmanager 带起来
static const char* screen_arg [] = {
"screen",
"-c",
"/lib64/graphics.conf",
NULL
};
static const struct aaction screen = {
.type = TYPE_CMD,
.c = {
.flags = FLAG_BACKGROUND,
.path = "screen",
.arg = screen_arg,
.secpol_type = "screen_t",
.uid=SCREEN_UID,
.gid=SCREEN_GID,
.rmasks = 0xFE,
},
};screen 服务初始化依赖于 openwfd 显示框架,所以要求启动顺序在 wfd 服务之后:
32795 wfd_server -U 70:70,33,21
32797 wfd_be 5
32798 screen -c /lib64/graphics.conf需要注意的是 screen 的初始化并不依赖于 GPU,所以它可以优先于 GPU 驱动,但是,正常 screen 接口使用一定要在 GPU 驱动初始化结束之后
SCREEN debug 方法
/dev/screen 目录
screen 服务正常启动之后会在 /dev/ 目录下,生成 screen 文件夹:
# ls /dev/screen/
0 9711657 mtouch
1196133 buffers qvm
487478 gpus requests
495671 input ssplash
766018 life_cycle_man_demo
823370 lpms
# 0:包含 screen 配置的主要信息,包括 display 配置信息,frame buffer 配置信息
# ls
blt-1 dpy-2 str-2
blt-2 framebuffer1 str-4
ctx-0 framebuffer2 win-0
dpy-1 globals win-1
# pwd
/dev/screen/0
# frame buffer:可以获取当前屏幕显示的 buffer 数据内容
# find ./
./
./ctx-1
./ssn-0
./str-0
./str-0/str-0
./str-0/str-0-1
./win-2
# ls ./str-0/str-0-1/
buf-62 buf-62.bmp buf-62.data
# pwd
/dev/screen/9711657screencmd
用于设置修改 Windows 的属性
screencmd setiv win-8 SCREEN_PROPERTY_SIZE 400,400
screencmd setiv win-8 SCREEN_PROPERTY_ROTATION 90
screencmd setiv win-4 SCREEN_PROPERTY_ZORDER 1000使用的时候,需要知道想要修改的Windows是哪一个,可以在 /dev/screen/$pid/ 目录下找到这个信息
# ls /dev/screen/
0 9711657 mtouch
1196133 buffers qvm
487478 gpus requests
495671 input ssplash
766018 life_cycle_man_demo
823370 lpms
# ls /dev/screen/9711657/
ctx-1 ssn-0 str-0 win-2
# dump 图层信息
执行:echo surfacedump=0xFF > /dev/displaylog
可以在 /tmp 目录下得到dump出来的图层文件
# ls /tmp/displog_surface_dump_*
/tmp/displog_surface_dump_8_[00:00:39.085]_1920x1080_argb8888.rgb这个方法其实是 wfd 的 debug 方法,可以 dump 各个 pipeline 上显示的图像数据,dump 输出的数据是 raw 的 rgb 数据,可以用 yuv player 一类的工具直接打开
# cat /tmp/displog_help
Input Commands:
echo ? > /dev/displaylog --> help
echo s > /dev/displaylog --> status
echo ll=n > /dev/displaylog --> change log level (default=0x8A)
0x00000000 NONE
0x00000001 API_TYPE
0x00000002 ERROR_INFO_TYPE
0x00000004 PROFILE_TYPE
0x00000008 CRITICAL_ERROR_TYPE
0x00000010 INFO_TYPE
0x00000020 KERNEL_TRACK_TYPE
0x00000040 ISR_ERROR_INFO_TYPE
0x00000080 CRITICAL_INFO_TYPE
0x00000100 BACK_TRACE_TYPE
0X00000200 WARNING_INFO_TYPE
0x00000400 API_PERF_INFO_TYPE
echo rd=n [submodule] [submodule ID]> /dev/displaylog --> register dump
1: MDP
[submodule]
1: SWI
2: CTL
3: VIG
4: VIG_SSPP
5: RGB
6: RGB_SSPP
7: DMA
8: DMA_SSPP
9: CURSOR_SSPP
10: LAYER_MIXER
11: DSPP
12: WB
13: INTF
14: PP
15: ENCR_NS
16: ENCR_S
17: AADC
18: CDM
19: DSC
20: QDSS
2: DSI0
3: DSI1
[submodule]
1: CTRL
2: PHYREG
3: PHY
4: PHYPLL
4: EDP
5: DP0
6: DP1
[submodule]
0: AHBCLK
1: AUXCLK
2: LCLK
3: PCLK
echo surfacedump=n [m] > /dev/displaylog --> dump input surfaces to /tmp/*
1: RGB0 5: VG0 t9: DMA0 13: CURSOR0
2: RGB1 6: VG1 t10: DMA1 14: CURSOR1
3: RGB2 7: VG2 t11: DMA2 15: CURSOR2
4: RGB3 8: VG3 t12: DMA3 16: CURSOR3
0xFF: dump valid surfaces attached to all mdp pipes
[m]: Number of frames to dump for multiframe option
echo apibtenable=n > /dev/displaylog --> API backtrace enable
0: disable
1: enable
echo apibtdump > /dev/displaylog --> Dump API backtrace to file
echo smmudump > /dev/displaylog --> dump SMMU info to /tmp/*
echo md > /dev/displaylog --> dump Mutex info to /tmp/*
echo wfd ?>/dev/displaylog --> dump wfd help info to /tmp/
echo forcereset=n > /dev/displaylog --> forcefully reset a display module
1: PRIMARY
2: EXTERNAL
3: WRITEBACK
echo dpauxread [module] [aux_addr] [len] --> To read the DPCD registers
module:
4: EDP
5: DP0
6: DP1
aux_addr: DPCD address
len: number of DPCD registers to be read
echo dpTPG [module] [stream] [enable] [pattern]
module:
4: EDP
5: DP0
6: DP1
stream:
0: stream 0
1: stream 1
enable:
0: disable
1: enable
TPG pattern:
0: CHECKERED_RECTANGLE_PATTERN[default]
1: BASIC_COLOR_CHANGING_PATTERN
2: COLOR_SQUARE
3: BLACK_WHITE_VERTICAL_LINES
4: GRAYSCALE_RAMP
echo dsiTPG [module] [enable] [pattern]
module:
2: DSI0
3: DSI1
Enable:
0: Disable
1: Enable
pattern:
0: CHECKERED_RECTANGLE_PATTERN[default]
1: BASIC_COLOR_CHANGING_PATTERN
2: COLOR_SQUARE
3: BLACK_WHITE_VERTICAL_LINES
4: GRAYSCALE_RAMP
Reading Outputs:
cat /dev/displaylog
# Keep reading
Previous and next follow publication time.
Previous
Nothing nearby yet
Next
Nothing nearby yet
Same subject
Other pieces close to this subject.
Nothing nearby yet Back to journal
About this piece
Updated Aug 7, 202666 views