A memory management library for Mailbox, VCSM (VideoCore Shared Memory), and V3D DRM on Raspberry Pi.
- You need to install the development package of
libdrm by running
apt-get install libdrm-dev
. - The mailbox library is also needed. Refer to its README file for install instruction.
- Depending on which subsystem you use to allocate memory, you additionally need
to:
- be
root
user to use Mailbox functions. - belong to
video
group or beroot
user to use VCSM and V3D DRM functions.
- be
$ git clone https://github.com/Idein/librpimemmgr
$ cd librpimemmgr/
$ cmake -B build/
$ cmake --build build/ --target package
$ sudo dpkg -i librpimemmgr-x.y.z-arch.deb
type | flag | busaddr | |
---|---|---|---|
BCM2835 | BCM2836, BCM2837 | ||
VCSM | NONE | 0xde400000 | 0xfe400000 |
HOST | 0xde400000 | 0xfe400000 | |
VC | 0x1e400000 | 0x3e400000 | |
HOST_AND_VC | 0x1e400000 | 0x3e400000 | |
Mailbox | NORMAL | 0x1e400000 | 0x3e400000 |
DIRECT | 0xde400000 | 0xfe400000 | |
COHERENT | 0x9e400000 | 0xbe400000 | |
L1_NONALLOCATING | 0x5e400000 | 0xbe400000 |
type | flag | memcpy speed [MiB/s] | |||
---|---|---|---|---|---|
Raspberry Pi 1 | Raspberry Pi 2 | Raspberry Pi 3 | Raspberry Pi 3+ | ||
malloc | 300 | 921 | 1038 | 1138 | |
VCSM | NONE | 134 | 173 | 268 | 275 |
HOST | 388 | 961 | 1163 | 1153 | |
VC | 134 | 173 | 268 | 275 | |
HOST_AND_VC | 388 | 958 | 1162 | 1159 | |
Mailbox | DIRECT | 152 | 173 | 268 | 275 |
L1_NONALLOCATING | 134 |