图形驱动框架
1.整体框架
2.环境配置及依赖
2.1 kernel
进入 linux kernel 源码目录,在 config 中将PowerVR打开:
CONFIG_POWERVR_ROGUE=y #将PowerVR_rogue打开
或在 menuconfig 中进行配置:执行make menuconfig,如下图所示,进入配置界面,在 Device Drivers -> Graphics support -> PowerVR GPU 路径下打开 PowerVR GPU 选项。
<*> Lontium LT9711 DSI to DP
< > null drm disp
<*> PowerVR GPU #打开 PowerVR GPU 选项
[ ] Enable legacy drivers (DANGEROUS) ----
Frame buffer Devices --->
2.2 PVR DDK
由于版权问题,PVR GPU的驱动开发工具包(Device Development Kit, DDK)不能提供出来,PVR GPU驱动的用户层闭源代码使用 so 动态库的形式提供了OpenGLES、Vulkan和OpenCL的API实现。在bianbu-linux和bianbu-desktop上开启PVR GPU驱动的方式如下:
-
在 bianbu-linux 上,需要在编译 build root 时设置 config 文件中 BR2_PACKAGE_IMG_GPU_POWERVR=y;或者在 bianbu-linux 源码目录下,执行 make menuconfig,在 External options -> Bianbu config 路径下打开 img-gpu-powervr 选项。
[*] rtk hciattach
*** spacemit mpp package ***
-*- spacemit mpp
[*] img-gpu-powervr #打开 img-gpu-powervr 选项
Output option (Wayland) --->
[ ] install examples -
在 bianbu-desktop上,涉及到版权问题的闭源代码使用 so 动态库的形式通过 img-gpu-powervr deb包来提供。用户可通过 apt install img-gpu-powervr 来获得 PVR GPU 驱动程序的使用。需要注意的是,GPU内核层驱动与用户层驱动版本需保持一致,版本查看方法如下:
# 查看内核层驱动
➜ ~ journalctl -b | grep "Initialized pvr"
11月 21 14:11:37 spacemit-k1-x-MUSE-Pi-board kernel: [drm] Initialized pvr 24.2.6603887 20170530 for cac00000.imggpu on minor 1 # 版本为24.2
# 查看用户层驱动
➜ ~ dpkg -s img-gpu-powervr
Package: img-gpu-powervr
Status: install ok installed
Priority: optional
Section: graphics
Installed-Size: 70314
Maintainer: bianbu <bo.deng@spacemit.com>
Architecture: all
Version: 24.2-6603887bb1 # 版本为24.2

