2020-12-14 19:04:27 -05:00
|
|
|
Panfrost
|
|
|
|
|
========
|
|
|
|
|
|
2021-09-21 14:45:35 -04:00
|
|
|
The Panfrost driver stack includes an OpenGL ES implementation for Arm Mali
|
|
|
|
|
GPUs based on the Midgard and Bifrost microarchitectures. It is **conformant**
|
|
|
|
|
on Mali G52 but **non-conformant** on other GPUs. The following hardware is
|
|
|
|
|
currently supported:
|
2020-12-14 19:04:27 -05:00
|
|
|
|
|
|
|
|
========= ============ ============ =======
|
|
|
|
|
Product Architecture OpenGL ES OpenGL
|
|
|
|
|
========= ============ ============ =======
|
|
|
|
|
Mali T720 Midgard (v4) 2.0 2.1
|
2021-06-09 16:15:19 -04:00
|
|
|
Mali T760 Midgard (v5) 3.1 3.1
|
|
|
|
|
Mali T820 Midgard (v5) 3.1 3.1
|
2022-01-25 20:23:46 -05:00
|
|
|
Mali T830 Midgard (v5) 3.1 3.1
|
2021-06-09 16:15:19 -04:00
|
|
|
Mali T860 Midgard (v5) 3.1 3.1
|
2022-01-25 20:23:46 -05:00
|
|
|
Mali T880 Midgard (v5) 3.1 3.1
|
2021-06-09 16:15:19 -04:00
|
|
|
Mali G72 Bifrost (v6) 3.1 3.1
|
|
|
|
|
Mali G31 Bifrost (v7) 3.1 3.1
|
2022-01-25 20:23:46 -05:00
|
|
|
Mali G51 Bifrost (v7) 3.1 3.1
|
2021-06-09 16:15:19 -04:00
|
|
|
Mali G52 Bifrost (v7) 3.1 3.1
|
2022-01-25 20:23:46 -05:00
|
|
|
Mali G76 Bifrost (v7) 3.1 3.1
|
2020-12-14 19:04:27 -05:00
|
|
|
========= ============ ============ =======
|
|
|
|
|
|
2022-01-25 20:23:46 -05:00
|
|
|
Other Midgard and Bifrost chips (T604, T628, G71) are not yet supported.
|
2020-12-14 19:04:27 -05:00
|
|
|
|
2020-12-17 18:58:56 -05:00
|
|
|
Older Mali chips based on the Utgard architecture (Mali 400, Mali 450) are
|
2020-12-14 19:04:27 -05:00
|
|
|
supported in the Lima driver, not Panfrost. Lima is also available in Mesa.
|
|
|
|
|
|
|
|
|
|
Other graphics APIs (Vulkan, OpenCL) are not supported at this time.
|
2020-12-17 19:14:24 -05:00
|
|
|
|
|
|
|
|
Building
|
|
|
|
|
--------
|
|
|
|
|
|
2021-05-10 11:07:56 -04:00
|
|
|
Panfrost's OpenGL support is a Gallium driver. Since Mali GPUs are 3D-only and
|
|
|
|
|
do not include a display controller, Mesa uses kmsro to support display
|
|
|
|
|
controllers paired with Mali GPUs. If your board with a Panfrost supported GPU
|
|
|
|
|
has a display controller with mainline Linux support not supported by kmsro,
|
|
|
|
|
it's easy to add support, see the commit ``cff7de4bb597e9`` as an example.
|
2020-12-17 19:14:24 -05:00
|
|
|
|
|
|
|
|
LLVM is *not* required by Panfrost's compilers. LLVM support in Mesa can
|
|
|
|
|
safely be disabled for most OpenGL ES users with Panfrost.
|
|
|
|
|
|
2021-09-17 11:08:42 -04:00
|
|
|
Build like ``meson . build/ -Ddri-drivers= -Dvulkan-drivers=
|
2021-08-12 11:05:26 -04:00
|
|
|
-Dgallium-drivers=panfrost -Dllvm=disabled`` for a build directory
|
2020-12-17 19:14:24 -05:00
|
|
|
``build``.
|
|
|
|
|
|
|
|
|
|
For general information on building Mesa, read :doc:`the install documentation
|
2021-01-06 13:23:35 +01:00
|
|
|
<../install>`.
|
2020-12-17 19:36:20 -05:00
|
|
|
|
|
|
|
|
Chat
|
|
|
|
|
----
|
|
|
|
|
|
2021-09-21 14:50:39 -04:00
|
|
|
Panfrost developers and users hang out on IRC at ``#panfrost`` on OFTC. Note
|
|
|
|
|
that registering and authenticating with `NickServ` is required to prevent
|
2021-10-12 02:09:38 +08:00
|
|
|
spam. `Join the chat. <https://webchat.oftc.net/?channels=#panfrost>`_
|
2022-04-14 10:53:08 -04:00
|
|
|
|
|
|
|
|
U-interleaved tiling
|
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
|
|
Panfrost supports u-interleaved tiling. U-interleaved tiling is
|
|
|
|
|
indicated by the ``DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED`` modifier.
|
|
|
|
|
|
|
|
|
|
The tiling reorders whole pixels (blocks). It does not compress or modify the
|
|
|
|
|
pixels themselves, so it can be used for any image format. Internally, images
|
|
|
|
|
are divided into tiles. Tiles occur in source order, but pixels (blocks) within
|
|
|
|
|
each tile are reordered according to a space-filling curve.
|
|
|
|
|
|
|
|
|
|
For regular formats, 16x16 tiles are used. This harmonizes with the default tile
|
|
|
|
|
size for binning and CRCs (transaction elimination). It also means a single line
|
|
|
|
|
(16 pixels) at 4 bytes per pixel equals a single 64-byte cache line.
|
|
|
|
|
|
|
|
|
|
For formats that are already block compressed (S3TC, RGTC, etc), 4x4 tiles are
|
|
|
|
|
used, where entire blocks are reorder. Most of these formats compress 4x4
|
|
|
|
|
blocks, so this gives an effective 16x16 tiling. This justifies the tile size
|
|
|
|
|
intuitively, though it's not a rule: ASTC may uses larger blocks.
|
|
|
|
|
|
|
|
|
|
Within a tile, the X and Y bits are interleaved (like Morton order), but with a
|
|
|
|
|
twist: adjacent bit pairs are XORed. The reason to add XORs is not obvious.
|
|
|
|
|
Visually, addresses take the form::
|
|
|
|
|
|
|
|
|
|
| y3 | (x3 ^ y3) | y2 | (y2 ^ x2) | y1 | (y1 ^ x1) | y0 | (y0 ^ x0) |
|
|
|
|
|
|
|
|
|
|
Reference routines to encode/decode u-interleaved images are available in
|
|
|
|
|
``src/panfrost/shared/test/test-tiling.cpp``, which documents the space-filling
|
|
|
|
|
curve. This reference implementation is used to unit test the optimized
|
|
|
|
|
implementation used in production. The optimized implementation is available in
|
|
|
|
|
``src/panfrost/shared/pan_tiling.c``.
|
|
|
|
|
|
|
|
|
|
Although these routines are part of Panfrost, they are also used by Lima, as Arm
|
|
|
|
|
introduced the format with Utgard. It is the only tiling supported on Utgard. On
|
|
|
|
|
Mali-T760 and newer, Arm Framebuffer Compression (AFBC) is more efficient and
|
|
|
|
|
should be used instead where possible. However, not all formats are
|
|
|
|
|
compressible, so u-interleaved tiling remains an important fallback on Panfrost.
|