Jump to content

3D Acceleration

From postmarketOS Wiki
Revision as of 04:20, 15 September 2022 by Jenneron (talk | contribs) (diff for new mesa)
GPU Used in Driver Issues
Adreno Qualcomm freedreno
Vivante HiSilicon, Marvell, NXP i.MX, Rockchip etnaviv
Mali Allwinner, Exynos, HiSilicon, Intel, MediaTek, Rockchip, Spreadtrum, ST-Ericsson, WonderMedia lima
Mali T/G Allwinner, Exynos, HiSilicon, Intel, MediaTek, Rockchip, Spreadtrum panfrost
PowerVR Allwinner, Apple, Exynos, Intel, MediaTek, Rockchip, Spreadtrum, TI OMAP sgx-ddk, openpvrsgx
Tegra 2/3/4 Nvidia grate
Tegra K1/X1 Nvidia nouveau
VideoCore IV Broadcom vc4
VideoCore V/VI Broadcom v3d

Adreno

Vivante

Mali

There are two projects for open source Mali drivers.

The lima driver is for the Mali Utgard GPUs, specifically the Mali 400 (2008) and the Mali 450 (2012)

The panfrost drivers is for the Mali Midgard and Bifrost GPUs, except T604, T628 and G71.

Mali T720 and older are limited to OpenGL 2.1 and OpenGL ES 2.0.

Mali T628

We have patched linux-postmarketos-exynos5 kernel, but it is still needed for users to build patched mesa themselves.

1. Run pmbootstrap aportgen --fork-alpine mesa.

2. Go to ~/.local/var/pmbootstrap/cache_git/pmaports/temp/mesa.

3. Create a file e.g. enable-mali-t628.patch. Fill it with this:

diff --git a/src/panfrost/lib/pan_props.c b/src/panfrost/lib/pan_props.c
index b6249031730..048954b4c4d 100644
--- a/src/panfrost/lib/pan_props.c
+++ b/src/panfrost/lib/pan_props.c
@@ -54,6 +54,7 @@
 
 /* Table of supported Mali GPUs */
 const struct panfrost_model panfrost_model_list[] = {
+        MODEL(0x620, "T620", "T62x", NO_ANISO, 8192, {}),
         MODEL(0x720, "T720", "T72x", NO_ANISO, 8192, { .no_hierarchical_tiling = true }),
         MODEL(0x750, "T760", "T76x", NO_ANISO, 8192, {}),
         MODEL(0x820, "T820", "T82x", NO_ANISO, 8192, { .no_hierarchical_tiling = true }),

4. Add this file to source variable in APKBUILD file.

6. Increase pkgrel variable in APKBUILD file.

7. Run pmbootstrap checksum mesa.

8. Run pmbootstrap build --arch armv7 mesa.

Next time you run pmbootstrap install --sdcard /dev/sdX, you will get patched mesa installed.

Note Note: After installation, you may need to remove /etc/modprobe.d/mali.conf file.
Note Note: Your mesa may be replaced with new unpatched one after an upgrade in Alpine. In this case, you will have to rebuild it again. Your device package also may be upgraded, then you will have to remove /etc/modprobe.d/mali.conf file again.

Tegra

The opensource reverse-engineered driver for Tegra GPUs is Grate (anagram of "tegra"). It seems to work with Tegra 2, 3 and 4 GPUs

The newer Tegra K1 and X1 use an 3D core that can be used with Nouveau instead with a seperate tegra display driver to handle the I/O

VideoCore

There are two projects for open source VideoCore drivers.

The vc4 driver is for Broadcom VideoCore IV GPUs.

The v3d driver is for Broadcom VideoCore V and VideoCore VI GPUs.

PowerVR

There is no FOSS driver for the PowerVR SGX5 series GPUs found on OMAP3 and OMAP4 TI SoCs. However, these GPUs do work on the mainline kernel when the kernel is built with the open parts of the TI drivers, and you also run a patched Mesa. This work cannot be integrated into pmaports, but is maintained in a separate pmos-compatible repository, https://gitlab.com/pvrports