Skip to content

PanVK Mali (Based on Mesa 27.0.0-devel)

Choose a tag to compare

@JimVulkan JimVulkan released this 25 Oct 21:14
· 5 commits to main since this release

mali-panvk r8

PanVK for Arm Mali GPUs on stock Android. Mesa's PanVK Vulkan driver runs on the kernel driver the
phone already has (Arm's kbase, /dev/mali0): no root, no custom kernel. Now based on Mesa
27.0.0-devel, and no longer Bifrost only: this release adds Valhall.

mali-panvk-27.0.0-devel-r8.zip, sha256
d82d8f2dd4a368770b9b43566f7b5295d205060cb6ffd536b07afc33914858a1. Built from d896b0a.

Supported GPUs

Architecture GPUs Vulkan Status
Bifrost Mali-G31, G51, G52, G71, G72, G76 1.3 as in r4
Valhall, first generation Mali-G57, G68, G77, G78 1.3 new
Valhall with the command stream frontend Mali-G610, G710, G615, G715, G720 1.4 new, experimental

Tested on

Phone GPU SoC
Galaxy S10e Mali-G76 MC12 Exynos 9820
Galaxy Tab A11 Mali-G57 MC2 MediaTek Helio G99
Galaxy S20 Ultra, S20+ Mali-G77 MC11 Exynos 990
Galaxy S21 Mali-G78 MC14 Exynos 2100
Galaxy Tab S10+ Immortalis-G720 MC12 MediaTek Dimensity 9300+

Testers ran it in Minecraft (MojoLauncher) on a Mali-G57 and a Mali-G615 phone. On the S10e this
exact build gives the same results as r4's driver on the draw, geometry shader, transform feedback
and tessellation test matrices; the Valhall code is the same as in the test builds checked on the
phones above.

Changes since r4

  • Valhall, first generation (G57, G68, G77, G78): drawing, indexed, indirect and multi-draw
    calls, geometry shaders and transform feedback.

  • Valhall with the command stream frontend (G610 and later), experimental:

    • Presentation and semaphores without CPU stalls. A frame with 3000 draws went from 6.55 ms to
      about 1 ms on the G720.
    • Fixed skipped frames that ended in a lost device on a Mali-G615, and a phone reboot when
      MojoLauncher's "Alternate Surface Rendering" was off.
  • Faster draws. Draw-heavy frames cost the GPU much less: the driver no longer makes each draw
    wait for the previous one to finish (Valhall), or each draw's tiling wait in line behind the next
    draw's vertex work (Bifrost). It also rebuilds fewer descriptors per draw. 2000 small draws per
    frame:

    • Mali-G77: 6.55 ms to 2.2 ms, the same as Arm's driver (2.18 ms).
    • Mali-G76: 6.0 ms to 3.7 ms (Arm's driver: 2.8 ms).

    Testers saw the speed-up in Minecraft on a G57 and a G76.

  • OpenGL through zink on Valhall. zink needs null descriptors, which Valhall did not have.

  • Gralloc. On phones with a gralloc 4 HAL, the driver asks it how each window and shared buffer
    is laid out. Elsewhere it reads Arm's and MediaTek's buffer handles, as before. Also fixed: some
    buffers shared by other apps were refused (VK_ERROR_INVALID_EXTERNAL_HANDLE).

  • GPU faults are reported in detail: set MESA_LOG=file to get them in a log file.

  • The source build no longer needs anything from a phone: the gralloc headers ship in the
    repository, and the build generates the libraries it links against.

Known limitations

  • The command stream GPUs (G610 and later) are experimental.
  • Geometry shaders combined with indirect draws are skipped on first-generation Valhall.
  • No timestamp queries on Bifrost and first-generation Valhall, so zink reports OpenGL 3.2. With
    MESA_GL_VERSION_OVERRIDE=3.3 it reports 3.3, and our OpenGL tests pass.
  • Not done yet: Direct3D 12 through vkd3d-proton, and mesh shaders (no Bifrost or Valhall GPU has
    them in hardware).
  • The driver uses the phone's own gralloc libraries (libhidlbase.so, libutils.so,
    libgralloctypes.so, the gralloc 4 mapper). Every Android 11+ phone has them, but a launcher
    that hides system libraries from the driver will not load it. Build with GRALLOC=0 ./build.sh
    for a driver without that dependency.
  • On phones with 4 GB of RAM or less, give Minecraft about 600 MB of Java heap.