Multi 2D Graphics or simply libm2d is a free and open-source library for GNU Linux, which provides a common API to abstract 2D GPUs. This API is inspired from OpenGL but adapted to 2D GPUs.
Currently libm2d supports the following 2D GPUs:
- Microchip GFX2D
- Vivante GC520UL (with either nano2D or etnaviv driver)
Based on the choice of the GPU libm2d is compiled for, the list of dependencies varies.
- libdrm >= 2.4.0
- nano2D >= 2.0.41
- libdrm >= 2.4.0
- libdrm_etnaviv >= 2.4.0
Optionally, if tests are enabled then extra dependencies are added to the list:
- cairo >= 1.14.6
This project uses cmake. Only the GPU option is mandatory to select the GPU and driver libm2d is built for:
microchip,sam9x60-gfx2dfor the Microchip GFX2D embeded in SAM9X60 SoCsmicrochip,sam9x7-gfx2dfor the Microchip GFX2D embedded in SAM9X75 SoCsvivante,gc-nano2dfor the Vivante GC520UL with nano2D drivervivante,gc-etnavivfor the Vivante GC520UL with etnaviv driver
The ENABLE_TESTS option triggers the compilation of libm2d test applications like m2d_test.
For instance, for the Microchip GFX2D GPU embedded in SAM9X75 SoCs with m2d_test:
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DGPU=microchip,sam9x7-gfx2d -DENABLE_TESTS=ON
ninja -C build -j $(nproc)libm2d is released under the terms of the Apache 2 license. See the COPYING
file for more information.