目录
系统wayland情况分析
后记:
系统wayland情况分析
UOS默认启用的是x11,但是华为L410 L420这种麒麟芯片的机器,默认启用的是wayland(原因后面再推测),所以也想看看非麒麟平台如何能切换到wayland试试效果。
系统里面查看,其实已经安装了支持wayland的窗管相关的包
$dpkg -l | grep -i wayland
ii dde-wayland-config 1.0.7-1 amd64 This package is the configuration file to adapt to the wayland environment
ii deepin-greeter-wayland 5.5.19-1 amd64 deepin desktop-environment - dde-session-shell module config files
ii kwayland-data 4:5.57.0.10-1+eagle all Qt library wrapper for Wayland libraries - data files
ii kwayland-integration:amd64 5.14.5-1 amd64 kwayland runtime integration plugins
ii kwin-wayland 4:5.15.10.12-1 amd64 KDE window manager, wayland version, PREVIEW release
ii kwin-wayland-backend-drm 4:5.15.10.12-1 amd64 KDE window manager drm plugin
ii libkf5waylandclient5:amd64 4:5.57.0.10-1+eagle amd64 Qt library wrapper for Wayland libraries
ii libkf5waylandserver5:amd64 4:5.57.0.10-1+eagle amd64 Qt library wrapper for Wayland libraries
ii libqt5waylandclient5:amd64 5.15.1.7-1+dde amd64 QtWayland client library
ii libqt5waylandcompositor5:amd64 5.15.1.7-1+dde amd64 QtWayland compositor library
ii libva-wayland2:amd64 2.4.0-1 amd64 Video Acceleration (VA) API for Linux -- Wayland runtime
ii libwayland-bin 1.16.0-1 amd64 wayland compositor infrastructure - binary utilities
ii libwayland-client0:amd64 1.16.0-1 amd64 wayland compositor infrastructure - client library
ii libwayland-client0:i386 1.16.0-1 i386 wayland compositor infrastructure - client library
ii libwayland-cursor0:amd64 1.16.0-1 amd64 wayland compositor infrastructure - cursor library
ii libwayland-cursor0:i386 1.16.0-1 i386 wayland compositor infrastructure - cursor library
ii libwayland-dev:amd64 1.16.0-1 amd64 wayland compositor infrastructure - development files
ii libwayland-egl1:amd64 1.16.0-1 amd64 wayland compositor infrastructure - EGL library
ii libwayland-egl1:i386 1.16.0-1 i386 wayland compositor infrastructure - EGL library
ii libwayland-server0:amd64 1.16.0-1 amd64 wayland compositor infrastructure - server library
ii libwayland-server0:i386 1.16.0-1 i386 wayland compositor infrastructure - server library
ii qtwayland5:amd64 5.15.1.7-1+dde amd64 QtWayland platform plugin
ii qtwayland5-doc 5.15.1.7-1+dde all Qt 5 Wayland Compositor documentation
ii wayland-protocols 1.17-1 all wayland compositor protocols
ii xwayland 2:1.20.4.20-1+dde amd64 X server for wayland
$dpkg -l kwin-wayland
期望状态=未知(u)/安装(i)/删除(r)/清除(p)/保持(h)
| 状态=未安装(n)/已安装(i)/仅存配置(c)/仅解压缩(U)/配置失败(F)/不完全安装(H)/触发器等待(W)/触发器未决(T)
|/ 错误?=(无)/须重装(R) (状态,错误:大写=故障)
||/ 名称 版本 体系结构 描述
+++-==============-==============-============-====================================================
ii kwin-wayland 4:5.15.10.12-1 amd64 KDE window manager, wayland version, PREVIEW release
而且系统也安装了好wayland-session的桌面加载session文件、
$ls /usr/share/xsessions/
cairo-dock.desktop deepin.desktop dwm.desktop i3.desktop i3-with-shmlog.desktop newdeepin.desktop twm.desktop xfce.desktop
$ls /usr/share/wayland-sessions/
DeepinOnXwayland.desktop Wayland.desktop
但默认的dde-session-shell这个包的配置并未开启读取/usr/share/wayland-session目录下的桌面session配置文件。
启动过程大致过程位 lightdm.service 启动lightdm,lightdm的配置文件配置如下:
$grep -v \# /etc/lightdm/lightdm.conf
[LightDM]
[Seat:*]
greeter-session=lightdm-deepin-greeter
user-session=deepin
[XDMCPServer]
[VNCServer]
主要配置了greeter-session 即登陆session位lightdm-deepin-greeter(对应配置应该是/usr/share/xgreeters/lightdm-deepin-greeter.desktop
),用户session位deepin(对应配置位/usr/share/xsessions/deepin.desktop),这样就定义了登陆界面的程序和加载整个dde桌面环境的命令,完成从启动登陆界面到登陆到系统后进入桌面操作系统。
在系统deepin-session-shell这个软件包中有一个定义文件 /usr/share/dsg/configs/org.deepin.dde.lightdm-deepin-greeter/org.deepin.dde.lightdm-deepin-greeter.json
其中有一个开关就是配置是否显示桌面wayland-session文件夹里面定义的session。
more /usr/share/dsg/configs/org.deepin.dde.lightdm-deepin-greeter/org.deepin.dde.lightdm-deepin-greeter.json
{
"magic": "dsg.config.meta",
"version": "1.0",
"contents": {
"useSolidBackground": {
"value": false,
"serial": 0,
"flags": ["global"],
"name": "UseSolidBackground",
"name[zh_CN]": "使用纯色背景",
"description": "是否使用纯色背景,默认为否。开启配置时,那么将不会加载背景图片,降低内存占用。禁用设置时,加载背景图片,比较美观,但是会增加内存占用。",
"permissions": "readwrite",
"visibility": "private"
},
"allowSwitchingToWayland": {
"value": false,
"serial": 0,
"flags": ["global"],
"name": "AllowSwitchingToWayland",
"name[zh_CN]": "允许用户切换到wayland",
"description": "是否允许用户切换到wayland,默认为否。开启配置时,如果用户安装了wayland和其它桌面环境,登录界面会显示桌面环境切换按钮,点击后用户可以选择wayland桌
面环境。关闭配置时,就算用户安装了wayland环境,也会默认隐藏起来,不让用户切换到wayland环境",
"permissions": "readwrite",
"visibility": "private"
},
"defaultSession": {
"value": "deepin",
"serial": 0,
"flags": ["global"],
"name": "DefaultSessionName",
"name[zh_CN]": "默认桌面环境名称",
"description": "默认的桌面环境名称,默认为deepin。新建用户首次登录的时候,默认的桌面由此配置决定",
"permissions": "readwrite",
"visibility": "private"
},
"numLockState": {
"value": [],
"serial": 0,
这个文件应该是由 /usr/share/xgreeters/lightdm-deepin-greeter.desktop定义的登陆界面程序读取,用于判断是否显示/usr/share/wayland-session/下面的桌面加载session。
修改配置文件的allowSwitchingToWayland的值为true,注销后登陆界面就能看到wayland选项了。
查看启动wayland的桌面,发现最终效果是加载了kwin_wayland 并通过startdde-wayland带起来整个wayland桌面。并启动了一个Xwayland 。
虚拟机里面测试了下,卡的不行,估计还是驱动问题,有时间物理机上试试,真显卡应该不一样。
后记:
intel集成显卡机器上实际测试了下直接黑屏,看来驱动不对啊。
再来聊一聊华为麒麟系列芯片机器和其他机器的不同,结论均为个人推测,仅供参考。
麒麟990这个芯片本来就是手机芯片,华为芯片生产受限后,就干脆把这些芯片做成笔记本,台式机的CPU,由于本来是为手机设计的,再加上7nm加持,能耗比非常好,L410这个笔记本本待机时间超长。
但是麒麟系列芯片的机器有个致命伤,软件生态非常不好。
因为本来linux和windows比,生态就烂的不行,arm 平台的Linux生态就更差了,如果是这样就不说了,但麒麟芯片系列配套的操作系统,由于是CPU芯片集成了GPU,图形协议用的是wayland而不是X11,导致在arm平台比如飞腾,鲲鹏上能运行的一部分程序在麒麟芯片的机器上不兼容不能运行,从而导致这些机器上可以运行的应用程序更少了。
选择wayland而不是x11,我想华为是为了追求节能和高效,因为ARM公司的mali图形驱动内核部分是闭源的,对应的userspace部分也是闭源的,而且userspace的闭源驱动很多型号只支持wayland不支持x11,我推测麒麟990自带的显卡G系列ARM公司提供的也是闭源且只支持wayland的驱动。所以就自然选择了wayland,但是强大如华为,在软件生态面前也没办法。
本来L410这个笔记本颜值高,摄像头指纹齐全,屏幕尺寸也大,待机时间据说能达到18小时,应该是可以秒杀一切国产笔记本的。但是由于软件生态上的问题,让这个笔记本二手鱼上价格沦落到1800-2500之间,能买这个本二手的人也就这些国产厂商用来测试的人吧,其他人买来真是用不了。
参考debian的wiki,
MaliGraphics - Debian Wikihttps://wiki.debian.org/MaliGraphicsdebian11 已经全面专享逆向ARM的驱动,不再使用arm官网提供的mali系列驱动,用户态驱动在mesa里面。但能效以及稳定性如何,目前还不得而知,这个本以后会不会走debian逆向的驱动,现在很难说。但二手鱼上越来越多的这个系列二手本,说明用户买来用不了,就只有一个选择,回收(垃圾桶)。
国产难啊,路漫漫其修远兮,我辈还需加倍努力!