g2d-sys
Low-level FFI bindings for NXP i.MX G2D 2D graphics accelerator.
This crate provides unsafe bindings to libg2d.so for hardware-accelerated 2D graphics operations on NXP i.MX8/i.MX9 platforms.
Features
- Dynamic loading - Library loaded at runtime via
libloading - ABI compatibility - Handles G2D library version differences
- Zero dependencies on NXP SDK - Compiles anywhere, runs on i.MX
Usage
use ;
Supported Operations
| Operation | Description |
|---|---|
blit |
Copy with format conversion and scaling |
clear |
Fill rectangle with solid color |
enable/disable |
Configure colorspace (BT.601/BT.709) |
Library Scope
This is a low-level FFI crate — it provides direct access to libg2d.so
functions without safe Rust abstractions. When using DMA-buf buffers, you are
responsible for correct cache management, including DRM PRIME attachment for
cached heaps. See ARCHITECTURE.md
for the complete cache coherency protocol and
hardware_tests.rs for working examples.
Requirements
- Rust 1.75+ (MSRV)
- NXP i.MX8/i.MX9 platform
libg2d.so.2installed
Tested Platforms
- i.MX 8M Plus ✅
- i.MX 95 ✅
- Other i.MX variants should work but are not tested
License
Apache-2.0