Skip to content

Commit 90f652f

Browse files
committed
Add libmali-valhall-g610-g29p1-x11-wayland-gbm
1 parent 8af86bf commit 90f652f

5 files changed

Lines changed: 162 additions & 7 deletions

File tree

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
.deps
1010
.libs
1111
TAGS
12-
*\.a
12+
*.a
13+
*.deb
14+
*.pyc
15+
__pycache__/
16+
build*/
1317
libmali-*
1418
debian/libmali-*

README.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# libmali-rockchip
2+
3+
Mali GPU userspace driver binaries for Rockchip SoCs, with a meson build system that wraps them with standard library interfaces (GBM, EGL, GLESv1, GLESv2, Wayland EGL, OpenCL, Vulkan).
4+
5+
## Supported SoCs
6+
7+
| GPU | SoCs |
8+
|-----|------|
9+
| valhall-g610 | rk3588 |
10+
| bifrost-g52 | rk3566, rk3568, rk3562, rk3576 |
11+
| bifrost-g31 | px30, rk3326 |
12+
| midgard-t86x | rk3399, rk3399pro |
13+
| midgard-t76x | rk3288 |
14+
| utgard-450 | rk3328, rk3528 |
15+
| utgard-400 | px3se, rk3036, rk3032, rk312x, rk3128h |
16+
17+
## Dependencies
18+
19+
```bash
20+
sudo apt install meson pkg-config \
21+
libdrm-dev libx11-dev libx11-xcb-dev \
22+
libxcb-dri2-0-dev libwayland-dev
23+
```
24+
25+
## Building
26+
27+
### Configure
28+
29+
```bash
30+
meson setup build \
31+
-Dgpu=valhall-g610 \
32+
-Dversion=g24p0 \
33+
-Dplatform=x11-wayland-gbm \
34+
-Darch=aarch64
35+
```
36+
37+
### Build
38+
39+
```bash
40+
ninja -C build
41+
```
42+
43+
### Install to staging directory (for packaging)
44+
45+
```bash
46+
DESTDIR=$(pwd)/pkg ninja -C build install
47+
```
48+
49+
### Install to system
50+
51+
```bash
52+
sudo ninja -C build install
53+
```
54+
55+
## Meson Options
56+
57+
| Option | Default | Description |
58+
|--------|---------|-------------|
59+
| `arch` | auto | Target architecture: `aarch64`, `arm`, `armhf`, etc. |
60+
| `gpu` | midgard-t86x | GPU name (see table above) |
61+
| `version` | r18p0 | Driver version (e.g. `g24p0`, `g29p1`, `r18p0`) |
62+
| `subversion` | none | Driver subversion, or `all` to match any |
63+
| `platform` | gbm | Display platform(s): `gbm`, `x11-gbm`, `wayland-gbm`, `x11-wayland-gbm`, `dummy`, etc. |
64+
| `optimize-level` | O3 | Optimization level: `O0``O3`, `Os`, `Ofast`, `Og` |
65+
| `hooks` | true | Enable GBM hook library for extended format support |
66+
| `wrappers` | auto | Build wrapper shared libraries (EGL, GLESv2, etc.) |
67+
| `vendor-package` | false | Install wrappers to `lib/mali/` vendor subdirectory |
68+
| `opencl-icd` | true | Install OpenCL as ICD (`libMaliOpenCL`) instead of `libOpenCL` |
69+
| `wayland-egl` | true | Install `libwayland-egl` wrapper |
70+
| `firmware-dir` | /lib/firmware | Destination for GPU firmware (valhall-g610 only) |
71+
| `with-overlay` | false | Install init overlay scripts (utgard/midgard only) |
72+
| `khr-header` | false | Install `khrplatform.h` header |
73+
74+
## Available Library Variants
75+
76+
The library filename encodes the configuration:
77+
78+
```
79+
libmali-<gpu>-<version>[-<subversion>]-<platform>.so
80+
```
81+
82+
Examples:
83+
- `libmali-valhall-g610-g29p1-x11-wayland-gbm.so` — G610, g29p1, X11 + Wayland + GBM
84+
- `libmali-valhall-g610-g24p0-dummy.so` — G610, g24p0, no display (headless/compute)
85+
- `libmali-bifrost-g52-g24p0-wayland-gbm.so` — G52, g24p0, Wayland + GBM
86+
87+
Binaries live under `lib/<multiarch>/` and `optimize_3/<multiarch>/` (O3-optimized, preferred).
88+
89+
## Building a .deb Package
90+
91+
### Single package (manual)
92+
93+
```bash
94+
# 1. Configure and build
95+
meson setup build -Dgpu=valhall-g610 -Dversion=g29p1 -Dplatform=x11-wayland-gbm -Darch=aarch64
96+
ninja -C build
97+
98+
# 2. Stage the install
99+
DESTDIR=$(pwd)/build/pkg ninja -C build install
100+
101+
# 3. Write control file
102+
mkdir -p build/pkg/DEBIAN
103+
cat > build/pkg/DEBIAN/control << EOF
104+
Package: libmali-valhall-g610-g29p1-x11-wayland-gbm
105+
Version: 29
106+
Architecture: arm64
107+
Maintainer: Your Name <you@example.com>
108+
Provides: libmali
109+
Conflicts: libmali
110+
Replaces: libmali
111+
Depends: libdrm2, libwayland-client0, libwayland-server0, libx11-6, libxcb1, libxcb-dri2-0
112+
Description: Mali GPU User-Space Binary Drivers
113+
Mali Valhall G610 g29p1 userspace driver with X11, Wayland and GBM support.
114+
EOF
115+
116+
# 4. Build the .deb
117+
dpkg-deb --build build/pkg libmali-valhall-g610-g29p1-x11-wayland-gbm_29_arm64.deb
118+
```
119+
120+
### All packages via debhelper
121+
122+
```bash
123+
# Regenerate debian/targets and debian/control from all libs in lib/
124+
scripts/update_debian.sh
125+
126+
# Build all binary packages
127+
dpkg-buildpackage -b --no-sign
128+
```
129+
130+
To add a new library blob to the debian packaging:
131+
132+
1. Place the `.so` in `lib/<multiarch>/` (and optionally `optimize_3/<multiarch>/`)
133+
2. Filename must follow the convention: `libmali-<gpu>-<version>-<platform>.so`
134+
3. Run `scripts/update_debian.sh` to regenerate `debian/targets` and `debian/control`
135+
4. Build with `dpkg-buildpackage -b --no-sign`
136+
137+
## Adding a New Driver Blob
138+
139+
1. Copy the `.so` into `lib/aarch64-linux-gnu/` (rename to strip any arch suffix)
140+
2. Optionally also place it in `optimize_3/aarch64-linux-gnu/` for the O3 build path
141+
3. Run `scripts/update_debian.sh` to register it in `debian/targets` and `debian/control`
142+
4. Build the deb as shown above

debian/control

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,14 @@ Replaces: libmali
539539
Depends: ${shlibs:Depends}, ${misc:Depends}
540540
Description: Mali GPU User-Space Binary Drivers
541541

542+
Package: libmali-valhall-g610-g29p1-x11-wayland-gbm
543+
Architecture: arm64
544+
Provides: libmali
545+
Conflicts: libmali
546+
Replaces: libmali
547+
Depends: ${shlibs:Depends}, ${misc:Depends}
548+
Description: Mali GPU User-Space Binary Drivers
549+
542550
Package: libmali-valhall-g610-g6p0-dummy
543551
Architecture: armhf arm64
544552
Provides: libmali

debian/targets

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ aarch64-linux-gnu/libmali-bifrost-g31-g2p0-nocl-wayland-gbm.so
1414
aarch64-linux-gnu/libmali-bifrost-g31-g2p0-wayland-gbm.so
1515
aarch64-linux-gnu/libmali-bifrost-g31-g2p0-x11-gbm.so
1616
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-dummy-gbm.so
17-
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-dummy-wayland-gbm.so
1817
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-dummy.so
18+
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-dummy-wayland-gbm.so
1919
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-gbm.so
2020
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-nocl-dummy-gbm.so
2121
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-wayland-gbm.so
2222
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-x11-gbm.so
2323
aarch64-linux-gnu/libmali-bifrost-g52-g13p0-x11-wayland-gbm.so
2424
aarch64-linux-gnu/libmali-bifrost-g52-g24p0-dummy-gbm.so
25-
aarch64-linux-gnu/libmali-bifrost-g52-g24p0-dummy-wayland-gbm.so
2625
aarch64-linux-gnu/libmali-bifrost-g52-g24p0-dummy.so
26+
aarch64-linux-gnu/libmali-bifrost-g52-g24p0-dummy-wayland-gbm.so
2727
aarch64-linux-gnu/libmali-bifrost-g52-g24p0-gbm.so
2828
aarch64-linux-gnu/libmali-bifrost-g52-g24p0-nocl-dummy-gbm.so
2929
aarch64-linux-gnu/libmali-bifrost-g52-g24p0-wayland-gbm.so
@@ -47,12 +47,13 @@ aarch64-linux-gnu/libmali-valhall-g610-g13p0-wayland-gbm.so
4747
aarch64-linux-gnu/libmali-valhall-g610-g13p0-x11-gbm.so
4848
aarch64-linux-gnu/libmali-valhall-g610-g13p0-x11-wayland-gbm.so
4949
aarch64-linux-gnu/libmali-valhall-g610-g24p0-dummy-gbm.so
50-
aarch64-linux-gnu/libmali-valhall-g610-g24p0-dummy-wayland-gbm.so
5150
aarch64-linux-gnu/libmali-valhall-g610-g24p0-dummy.so
51+
aarch64-linux-gnu/libmali-valhall-g610-g24p0-dummy-wayland-gbm.so
5252
aarch64-linux-gnu/libmali-valhall-g610-g24p0-gbm.so
5353
aarch64-linux-gnu/libmali-valhall-g610-g24p0-wayland-gbm.so
5454
aarch64-linux-gnu/libmali-valhall-g610-g24p0-x11-gbm.so
5555
aarch64-linux-gnu/libmali-valhall-g610-g24p0-x11-wayland-gbm.so
56+
aarch64-linux-gnu/libmali-valhall-g610-g29p1-x11-wayland-gbm.so
5657
aarch64-linux-gnu/libmali-valhall-g610-g6p0-dummy.so
5758
aarch64-linux-gnu/libmali-valhall-g610-g6p0-gbm.so
5859
aarch64-linux-gnu/libmali-valhall-g610-g6p0-wayland-gbm.so
@@ -74,16 +75,16 @@ arm-linux-gnueabihf/libmali-bifrost-g31-g2p0-nocl-wayland-gbm.so
7475
arm-linux-gnueabihf/libmali-bifrost-g31-g2p0-wayland-gbm.so
7576
arm-linux-gnueabihf/libmali-bifrost-g31-g2p0-x11-gbm.so
7677
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-dummy-gbm.so
77-
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-dummy-wayland-gbm.so
7878
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-dummy.so
79+
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-dummy-wayland-gbm.so
7980
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-gbm.so
8081
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-nocl-dummy-gbm.so
8182
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-wayland-gbm.so
8283
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-x11-gbm.so
8384
arm-linux-gnueabihf/libmali-bifrost-g52-g13p0-x11-wayland-gbm.so
8485
arm-linux-gnueabihf/libmali-bifrost-g52-g24p0-dummy-gbm.so
85-
arm-linux-gnueabihf/libmali-bifrost-g52-g24p0-dummy-wayland-gbm.so
8686
arm-linux-gnueabihf/libmali-bifrost-g52-g24p0-dummy.so
87+
arm-linux-gnueabihf/libmali-bifrost-g52-g24p0-dummy-wayland-gbm.so
8788
arm-linux-gnueabihf/libmali-bifrost-g52-g24p0-gbm.so
8889
arm-linux-gnueabihf/libmali-bifrost-g52-g24p0-nocl-dummy-gbm.so
8990
arm-linux-gnueabihf/libmali-bifrost-g52-g24p0-wayland-gbm.so
@@ -117,8 +118,8 @@ arm-linux-gnueabihf/libmali-valhall-g610-g13p0-wayland-gbm.so
117118
arm-linux-gnueabihf/libmali-valhall-g610-g13p0-x11-gbm.so
118119
arm-linux-gnueabihf/libmali-valhall-g610-g13p0-x11-wayland-gbm.so
119120
arm-linux-gnueabihf/libmali-valhall-g610-g24p0-dummy-gbm.so
120-
arm-linux-gnueabihf/libmali-valhall-g610-g24p0-dummy-wayland-gbm.so
121121
arm-linux-gnueabihf/libmali-valhall-g610-g24p0-dummy.so
122+
arm-linux-gnueabihf/libmali-valhall-g610-g24p0-dummy-wayland-gbm.so
122123
arm-linux-gnueabihf/libmali-valhall-g610-g24p0-gbm.so
123124
arm-linux-gnueabihf/libmali-valhall-g610-g24p0-wayland-gbm.so
124125
arm-linux-gnueabihf/libmali-valhall-g610-g24p0-x11-gbm.so
Binary file not shown.

0 commit comments

Comments
 (0)