嵌入式桌面(1)——weston桌面

weston参考文档:
https://www.mankier.com/5/weston.ini
https://www.mankier.com/7/weston-drm
http://manpages.org/westonini/5

weston的使用
https://blog.csdn.net/u012080932/article/details/114373675
weston设置
https://blog.csdn.net/weixin_42892101/article/details/107696652
键盘配置
https://www.mankier.com/7/xkeyboard-config

RK3399平台weston桌面

平台:RK3399
系统:Linux4.4+buildroot

相关文件

/etc/init.d/S31weston 			//weston自启动程序
/etc/xdg/weston/weston.ini		//weston配置文件
/etc/profile.d/env.sh			//环境变量配置
/etc/init.d/S31weston 
#!/bin/sh
#
# Start linux launcher...
#

case "$1" in
  start)
                printf "Starting weston"
                source /etc/profile.d/env.sh
                weston -c /etc/xdg/weston/weston.ini --tty=2 --idle-time=0 --log=/var/log/weston.log &
        ;;
  stop)
                killall weston
                printf "stop finished"
        ;;
  *)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac
exit 0
/etc/xdg/weston/weston.ini
[core]
# Boards could have not any input device, and only use
# removable input device like usb(keyboard, mouse).
#require-input=false

[shell]
panel-position=none
/etc/profile.d/env.sh 
#!/bin/sh 

export LC_ALL='zh_CN.utf8'
export QT_QPA_PLATFORM=wayland
#export WESTON_DRM_MIRROR=1
export WESTON_DRM_KEEP_RATIO=1
export QT_GSTREAMER_WINDOW_VIDEOSINK=waylandsink
mkdir -p /tmp/.xdg &&  chmod 0700 /tmp/.xdg
export XDG_RUNTIME_DIR=/tmp/.xdg
export PATH=$PATH:/usr/bin/cmd
export QT_QPA_GENERIC_PLUGINS=evdevkeyboard

weston配置文件解析

weston是可以从命令行和配置文件(weston.ini)这两部分获取配置信息的。

weston.ini文件的位置:

$XDG_CONFIG_HOME/weston.ini   (if $XDG_CONFIG_HOME is set)
$HOME/.config/weston.ini      (if $HOME is set)
weston/weston.ini in each
    $XDG_CONFIG_DIR           (if $XDG_CONFIG_DIRS is set)
/etc/xdg/weston/weston.ini    (if $XDG_CONFIG_DIRS is not set)

其中环境变量HOME是用户的主目录,XDG_CONFIG_HOME是用户特定的配置目录,XDG_CONFIG_DIRS是冒号“:”分隔的配置基目录列表,例如/etc/xdg-foo:/etc/xdg .

weston.ini文件的组成部分

weston.ini文件由多个部分(section)组成,可存在于任何顺序的,或者省略(使用默认配置)
section如下:

core           The core modules and options(核心部分用于选择启动合成器模块和常规选项。)
libinput       Input device configuration(libinput 部分用于在使用 libinput 输入设备后端时配置输入设备。 默认值由 libinput 确定,并根据对任何给定设备最合理的方式而有所不同。)
shell          Desktop customization(shell 部分用于自定义合成器。 某些键可能无法由不同的 shell 插件处理。)
launcher       Add launcher to the panel(可以有多个启动器部分,每个启动器一个。)
output         Output configuration(可以有多个输出部分,每个部分对应一个输出。 它目前仅被 drm 和 x11 后端识别。)
input-method   Onscreen keyboard input(设置屏幕键盘输入法(字符串)的路径。)
keyboard       Keyboard layouts(设置键盘格式等参数)
terminal       Terminal application options(包含 Weston 终端应用程序 (weston-terminal) 的设置。 它允许自定义命令行界面的字体和shell。)
xwayland       XWayland options(设置要运行的 xserver 的路径(字符串)。)
screen-share   Screen sharing options(设置命令以启动全屏shell服务器以进行屏幕共享(字符串)。)

旋转weston渲染的qt程序

配置output字段,添加显示设备的名称和旋转角度。
前面weston通过如下指令启动:

weston -c /etc/xdg/weston/weston.ini --tty=2 --idle-time=0 --log=/var/log/weston.log &

所以weston的启动log保存在/var/log/weston.log文件中,通过cat /var/log/weston.log | grep Output查看显示设备的名称:

[root@rk3399:/]# cat  /var/log/weston.log | grep Output
[06:35:51.270] Output repaint window is 15 ms maximum.
[06:35:51.510] Output DSI-1, (connector 91, crtc 83)

在weston.ini中添加如下配置即可旋转weston上跑的qt程序:

[output]
name=DSI-1
transform=90

经测试,触摸也跟着显示一起旋转了,猜测应该是weston的默认配置起了作用。

鼠标光标的显示和隐藏

TBC

相关内容

5718

root@ok5718-idk:~# ls /sys/class/drm/
card0/          card0-DPI-1/    card0-HDMI-A-1/ card1/          controlD64/     renderD128/     renderD129/     version

3399

[root@rk3399:/]# ls /sys/class/drm/
card0-DSI-1/     card0/           renderD128/
card0-HDMI-A-1/  controlD64/      version
[output]      
name=HDMI-A-1 
virtualIndex=0
              
[output]      
name=DSI-1    
virtualIndex=1

你可能感兴趣的:(RK3399,显示,Linux,linux,wayland)