mirror of
https://github.com/linux-sunxi/meta-sunxi.git
synced 2024-11-08 06:18:22 +01:00
Enable open source GPU support
Enable open source GPU support for Mali Utgard GPUs (lima driver) and Mali Midgard and Bifrost GPUs (panfrost driver). The support is enabled by: - enabling DRM kernel CONFIGs - enabling lima, panfrost and kmsro in Mesa - disabling the specific mali driver overrides in sunxi-mali.inc To enable open source mainline graphics support just add the following line in your local.conf: MACHINEOVERRIDES .= ":use-mailine-graphics" Please note that some machines may need a bigger CMA value to be able to start Weston. To do that, add e.g. "cma=128M" to the kernel parameters. Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
This commit is contained in:
parent
fa0846c0eb
commit
1d6ef084db
15
conf/machine/include/sunxi-mali-driver.inc
Normal file
15
conf/machine/include/sunxi-mali-driver.inc
Normal 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 \
|
||||
"
|
@ -1,15 +1,5 @@
|
||||
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 \
|
||||
"
|
||||
# The "sunxi-mailine-graphics-drivers.inc" doesn't exist, but it can be created
|
||||
# in the future if needed. Using include directive ensures build doesn't fail
|
||||
# if .inc file doesn't exist:
|
||||
# https://www.yoctoproject.org/pipermail/yocto/2019-August/046484.html
|
||||
include ${@'sunxi-mali-driver.inc' if 'use-mailine-graphics' not in d.getVar("MACHINEOVERRIDES").split(":") else 'sunxi-mailine-graphics-drivers.inc' }
|
||||
|
5
recipes-graphics/mesa/mesa_%.bbappend
Normal file
5
recipes-graphics/mesa/mesa_%.bbappend
Normal 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"
|
@ -26,4 +26,6 @@ SRC_URI = "https://www.kernel.org/pub/linux/kernel/v5.x/linux-${PV}.tar.xz \
|
||||
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"
|
||||
|
8
recipes-kernel/linux/linux-mainline/drm.cfg
Normal file
8
recipes-kernel/linux/linux-mainline/drm.cfg
Normal 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
|
Loading…
Reference in New Issue
Block a user