Skip to content

Commit

Permalink
[DRAFT] Enable open source GPU support
Browse files Browse the repository at this point in the history
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

TODO: allow peaceful cohabitation with mali driver.

Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
  • Loading branch information
diegorondini committed Dec 1, 2019
1 parent d6917d1 commit b8f6944
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
30 changes: 15 additions & 15 deletions conf/machine/include/sunxi-mali.inc
Original file line number Diff line number Diff line change
@@ -1,15 +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 \
"
#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 \
# "
5 changes: 5 additions & 0 deletions recipes-graphics/mesa/mesa_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Enable lima and panfrost Mesa drivers
PACKAGECONFIG_append = " lima panfrost"
# Enable KMS renderonly Mesa support
# See https://cgit.freedesktop.org/mesa/mesa/commit/?id=2b780fe89300199f2334539aa1678e9b68f0434f
GALLIUMDRIVERS_append = ",kmsro"
8 changes: 8 additions & 0 deletions recipes-kernel/linux/linux-mainline/drm.cfg
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions recipes-kernel/linux/linux-mainline_5.3.8.bb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ SRC_URI = "https://www.kernel.org/pub/linux/kernel/v5.x/linux-${PV}.tar.xz \
file://defconfig \
"

SRC_URI_append = " file://drm.cfg"

SRC_URI_append_orange-pi-zero += "\
file://0001-dts-orange-pi-zero-Add-wifi-support.patch \
"

0 comments on commit b8f6944

Please sign in to comment.