使用ZynqMP FPGA在Linux上设置X Window系统的指南
概述
本文档提供了如何在ZynqMP FPGA Linux环境下安装和配置X Window系统的详细指南。适用于需要在Zynq UltraScale+ MPSoC上运行ARM图形的场景。
主要特性
- xf86-video-armsoc-xilinx: ARM图形的X.org图形驱动。
- libmali-zynqmp: ARM图形的用户空间库。
- zynqmp-gpu-kmod-dpkg: ARM图形的内核模块。
安装步骤
1. 从GitHub下载源码
shell$ git clone -b v2019.2.1 git://github.com/ikwzm/ZynqMP-FPGA-Xserver
shell$ cd ZynqMP-FPGA-Xserver
2. 安装X Window系统核心
- 安装ZynqMP的内核模块。
- 安装X Window系统核心。
- 安装ZynqMP的用户空间库。
- 安装ZynqMP的X.org图形驱动。
- 配置
/etc/X11/xorg.conf
文件。 - 如有必要,安装开发文件。
3. 配置/etc/X11/xorg.conf
添加ZynqMP设备部分至xorg.conf
文件。
Section "Device"
Identifier "ZynqMP"
Driver "armsoc"
Option "DRI2" "true"
Option "DRI2_PAGE_FLIP" "false"
Option "DRI2_WAIT_VSYNC" "true"
Option "DEBUG" "true"
EndSection
Section "Screen"
Identifier "DefaultScreen"
Device "ZynqMP"
EndSection
4. 安装开发文件(如果需要)
安装各种开发库,如libmali-zynqmp-dev
, libegl1-zynqmp-dev
, libgles1-zynqmp-dev
等。
构建步骤
为了从源代码构建必要的软件包和模块,需要准备编译环境并执行相关的构建命令。
1. 准备编译环境
shell# apt install quilt dh-autoreconf dh-exec debhelper cmake cross-config
shell# apt install libdrm-dev libudev-dev libxext-dev pkg-config x11proto-core-dev x11proto-fonts-dev x11proto-gl-dev x11proto-xf86dri-dev xutils-dev xserver-xorg-dev
2. 构建xf86-video-armsoc-xilinx
shell# git clone --recursive --depth=1 -b v1.4-2 git://github.com/ikwzm/xf86-video-armsoc-xilinx.git
shell# cd xf86-video-armsoc-xilinx
shell# debian/rules binary
3. 构建libmali-zynqmp
shell# git clone --recursive --depth=1 -b v1.7-0 git://github.com/ikwzm/libmali-zynqmp.git
shell# cd libmali-zynqmp
shell# wget https://www.xilinx.com/publications/products/tools/mali-400-userspace.tar
shell# tar xf mali-400-userspace.tar mali/rel-v2019.1/r8p0-01rel0.tar
shell# tar xf mali/rel-v2019.1/r8p0-01rel0.tar
shell# debian/rules binary
4. 构建zynqmp-gpu内核模块
shell# git clone --recursive --depth=1 -b v0.1.2 git://github.com/ikwzm/zynqmp-gpu-kmod-dpkg
shell# cd zynqmp-gpu-kmod-dpkg
shell# wget https://developer.arm.com/-/media/Files/downloads/mali-drivers/kernel/mali-utgard-gpu/DX910-SW-99002-r8p0-01rel0.tgz
shell# tar xfz DX910-SW-99002-r8p0-01rel0.tgz
shell# git clone https://github.com/Xilinx/meta-xilinx.git
shell
# for file in `\find meta-xilinx/meta-xilinx-bsp/recipes-graphics/mali/kernel-module-mali -maxdepth 1 -type f | sort`; do patch -d DX910-SW-99002-r8p0-01rel0/driver/src/devicedrv/mali/ -p1 < $file ; done
shell# debian/rules binary
通过以上步骤,可以在ZynqMP FPGA Linux环境下成功设置和配置X Window系统,为使用Zynq UltraScale+ MPSoC上的ARM图形提供支持。