Merge pull request #285 from Kynetics/use-mainline-graphics

Enable open source GPU drivers
This commit is contained in:
Marek Belisko 2020-03-19 07:49:36 +01:00 committed by GitHub
commit ee3a551b83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 49 additions and 18 deletions

View File

@ -19,8 +19,12 @@ Maintainers:
Kernel / U-Boot Version Kernel / U-Boot Version
=========== ===========
Most Allwinner devices and hardware are supported in mainline kernel and U-Boot, so this layer builds mainline by default. Most Allwinner devices and hardware are supported in mainline kernel and U-Boot, so this layer builds mainline by default.
Legacy sunxi Kernel / U-Boot
-----------
There is a custom U-Boot and Kernel version for sunxi devices which includes some special drivers not mainlined. There is a custom U-Boot and Kernel version for sunxi devices which includes some special drivers not mainlined.
These versions are rather old (3.4 for kernel and 2014.04 for U-Boot), but may support more functions and devices than current mainline These versions are rather old (3.4 for kernel and 2014.04 for U-Boot), but may support more functions and devices than current mainline.
If you want to switch back to sunxi versions for some reasons (no device tree available, unsupported hardware), either: If you want to switch back to sunxi versions for some reasons (no device tree available, unsupported hardware), either:
- change the file conf/machine/include/sunxi.inc to include the following block - change the file conf/machine/include/sunxi.inc to include the following block
@ -35,9 +39,16 @@ If you already have built the mainline versions it might be necessary to reset t
bitbake -c clean virtual/kernel virtual/bootloader bitbake -c clean virtual/kernel virtual/bootloader
For mainline kernel we have now support for latest LTS, stable and bleeding edge (latest possible rc). Mainline Kernel / U-Boot
-----------
For mainline kernel we have now support for latest LTS and stable.
By default we use latest LTS. If you would like to change version please update ```PREFERRED_VERSION_linux-mainline``` in: By default we use latest LTS. If you would like to change version please update ```PREFERRED_VERSION_linux-mainline``` in:
* [conf/machine/include/sunxi.inc](https://github.com/linux-sunxi/meta-sunxi/blob/4921234ed77f9df77c65c88637ce50468f65bde7/conf/machine/include/sunxi.inc#L16) * [conf/machine/include/sunxi.inc](https://github.com/linux-sunxi/meta-sunxi/blob/fa0846c0eb23e3424b89acb4d5a327e921f73497/conf/machine/include/sunxi.inc#L16)
When using mainline kernel ≥ 5.2 it is now possible to use the mainline graphics drivers *lima* and *panfrost*, instead of the *mali* driver provided by ARM. To enable open source mainline graphics support add the following line in your `local.conf`:
MACHINEOVERRIDES .= ":use-mailine-graphics"
Performance Performance
=========== ===========

View File

@ -0,0 +1,15 @@
PREFERRED_PROVIDER_virtual/mesa ?= "mesa-gl"
PREFERRED_PROVIDER_virtual/libgl ?= "mesa-gl"
PREFERRED_PROVIDER_virtual/libgles1 ?= "sunxi-mali"
PREFERRED_PROVIDER_virtual/libgles2 ?= "sunxi-mali"
PREFERRED_PROVIDER_virtual/egl ?= "sunxi-mali"
PACKAGECONFIG_remove_pn-xserver-xorg = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glamor', '', d)}"
XSERVER += "sunxi-mali \
sunxi-mali-dev"
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "\
kernel-module-mali \
kernel-module-mali-drm \
"

View File

@ -1,15 +1,5 @@
PREFERRED_PROVIDER_virtual/mesa ?= "mesa-gl" # The "sunxi-mailine-graphics-drivers.inc" doesn't exist, but it can be created
PREFERRED_PROVIDER_virtual/libgl ?= "mesa-gl" # in the future if needed. Using include directive ensures build doesn't fail
PREFERRED_PROVIDER_virtual/libgles1 ?= "sunxi-mali" # if .inc file doesn't exist:
PREFERRED_PROVIDER_virtual/libgles2 ?= "sunxi-mali" # https://www.yoctoproject.org/pipermail/yocto/2019-August/046484.html
PREFERRED_PROVIDER_virtual/egl ?= "sunxi-mali" include ${@'sunxi-mali-driver.inc' if 'use-mailine-graphics' not in d.getVar("MACHINEOVERRIDES").split(":") else 'sunxi-mailine-graphics-drivers.inc' }
PACKAGECONFIG_remove_pn-xserver-xorg = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glamor', '', d)}"
XSERVER += "sunxi-mali \
sunxi-mali-dev"
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "\
kernel-module-mali \
kernel-module-mali-drm \
"

View File

@ -0,0 +1,5 @@
# Enable lima and panfrost Mesa drivers
PACKAGECONFIG_append_use-mailine-graphics = " lima panfrost"
# Enable KMS renderonly Mesa support
# See https://cgit.freedesktop.org/mesa/mesa/commit/?id=2b780fe89300199f2334539aa1678e9b68f0434f
GALLIUMDRIVERS_append_use-mailine-graphics = ",kmsro"

View File

@ -26,4 +26,6 @@ SRC_URI = "https://www.kernel.org/pub/linux/kernel/v5.x/linux-${PV}.tar.xz \
file://defconfig \ file://defconfig \
" "
SRC_URI_append_use-mailine-graphics = " file://drm.cfg"
FILES_${KERNEL_PACKAGE_NAME}-base_append = " ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo" FILES_${KERNEL_PACKAGE_NAME}-base_append = " ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo"

View File

@ -0,0 +1,8 @@
CONFIG_DRM=y
CONFIG_DRM_SUN4I=y
CONFIG_DRM_SUN8I_DW_HDMI=y
CONFIG_DRM_SUN8I_MIXER=y
CONFIG_DRM_LIMA=y
CONFIG_DRM_PANFROST=y
CONFIG_CMA=y
CONFIG_DMA_CMA=y