瑞芯微buildroot默认都是编译wayland桌面,需要用X11桌面需要某些版本编译好的ubuntu根文件系统,里面的XORG好像修改过某些地方视频mali驱动,如果apt update升级了xorg会导致黑屏。
因为测试需要自己编译XORG,所以想到了SDK里面的buildroot,编译x11桌面,首先需要修改buildroot defconfig文件去掉weston.config,添加x11.config,下面是我配置好的defconfig文件:
#include "base/base.config"
#include "chips/rk3566_rk3568_aarch64.config"
#include "font/chinese.config"
#include "fs/exfat.config"
#include "fs/ntfs.config"
#include "fs/vfat.config"
#include "gpu/gpu.config"
#include "multimedia/audio.config"
#include "multimedia/camera.config"
#include "multimedia/mpp.config"
#include "wifibt/bt.config"
#include "wifibt/wireless.config"
#include "benchmark.config"
#include "chromium.config"
#include "debug.config"
#include "npu2.config"
#include "powermanager.config"
#include "test.config"
#include "x11.config"
#include "qt/qt5.config"
#include "qt/qt5webengine.config"
#include "qt/app.config"
BR2_CPAN_MIRROR="http://mirrors.nju.edu.cn/CPAN"
BR2_GNU_MIRROR="http://mirrors.nju.edu.cn/gnu/"
BR2_PACKAGE_BINUTILS=y
BR2_PACKAGE_BINUTILS_TARGET=y
# BR2_PACKAGE_CAMERA_ENGINE is reset to default
BR2_PACKAGE_DHRYSTONE=y
BR2_PACKAGE_FILE=y
BR2_PACKAGE_GLIBC_UTILS=y
BR2_PACKAGE_GZIP=y
BR2_PACKAGE_IPERF=y
BR2_PACKAGE_LIBERATION=y
BR2_PACKAGE_MEMTESTER=y
BR2_PACKAGE_OPENSSH=y
BR2_PACKAGE_QT53D=y
BR2_PACKAGE_QT5BASE_TSLIB=y
BR2_PACKAGE_QT5BASE_USE_RGA=y
# BR2_PACKAGE_RKNPU2 is reset to default
# BR2_PACKAGE_ROCKCHIP_MALI_HAS_GBM is not set
# BR2_PACKAGE_ROCKCHIP_TEST is reset to default
BR2_PACKAGE_STRESSAPPTEST=y
BR2_PACKAGE_UNZIP=y
BR2_PACKAGE_VIM=y
# BR2_PACKAGE_WAYLAND is reset to default
BR2_PACKAGE_WGET=y
BR2_PACKAGE_WQY_ZENHEI=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_KEYBOARD=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_MOUSE=y
BR2_PACKAGE_XDRIVER_XF86_INPUT_TSLIB=y
BR2_PACKAGE_XDRIVER_XF86_VIDEO_FBDEV=y
BR2_PACKAGE_ZIP=y
BR2_ROOTFS_OVERLAY+="board/rockchip/rk3566_rk3568/fs-overlay/"
修改完defconfig文件后还需要修改modesettings配置文件(这个文件位置package/x11r7/xserver_xorg-server/20-modesetting.conf),下面是我修改后的配置:
Section "Device"
Identifier "Rockchip Graphics"
Driver "modesetting"
### Use Rockchip RGA 2D HW accel
# Option "AccelMethod" "exa"
### Use GPU HW accel
Option "AccelMethod" "glamor"
Option "DRI" "2"
### Set to "always" to avoid tearing, could lead to up 50% performance loss
Option "FlipFB" "none"
### Limit flip rate and drop frames for "FlipFB" to reduce performance lost
# Option "MaxFlipRate" "25"
Option "NoEDID" "true"
Option "UseGammaLUT" "true"
EndSection
Section "Screen"
Identifier "DSI-1"
Device "Rockchip Graphics"
Monitor "DSI-1"
EndSection
Section "Monitor"
Identifier "DSI-1"
Option "Rotate" "right"
Option "DPMS" "true"
# Modeline "800x1280_60.00" 85.25 800 856 936 1072 1280 1283 1293 1327 -hsync +vsync
EndSection
Section "ServerFlags"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection
Section "Module"
Load "glamoregl"
EndSection
修改完这些就差不多可以了,后续编译可能有报错,我编译的时候提示缺少头文件xdamage.h, 解决版本是手动编译安装xlib_libxdamage。另外x11.config默认使用openbox窗口管理器编译报错的话直接, 然后重新编译即可。