Gralloc V5 implements (supported Android 14+) for managing system buffers by using GBM backends (Currently using libgbm from Mesa3d) and Linux DMA-BUF.
Tested working fine with Android Hardware Composer 3 (HWC3) DRM instance on RK3588 Platform on Android 17.
This Gralloc implement manages graphics buffers by using GBM, manages blob (linear) buffers by using Linux DMA-BUF.
- Download the source.
cd <path_to_aosp_root>
mkdir -p vendor/valentinliu0/
cd vendor/valentinliu0/
git clone https://github.com/ValentinLiu0/gralloc-generic.git- Add product packages.
# Gralloc Generic
PRODUCT_PACKAGES += \
android.hardware.graphics.allocator-service.generic \
mapper.genericNote: the file /vendor/bin/hw/android.hardware.graphics.allocator-service.generic should be labeled with correct SELinux label to execute.
Like:
/vendor/bin/hw/android\.hardware\.graphics\.allocator-service\.generic u:object_r:vendor_services_exec:s0- Build AOSP and product image.
| Project | Main build artifacts | Path | Usage |
|---|---|---|---|
| gralloc_gbm | libgralloc_gbm.so |
common/ |
Library provided by gralloc_gbm |
| Allocator V2 | android.hardware.graphics.allocator-service.generic |
allocator/ |
Allocator V2 AIDL service |
| Mapper Stable-C (Mapper V5) | mapper.generic.so |
mapper_stablec/ |
IMapper Stable-C implement |
- libgbm (Provided by Mesa3d alias
libgbm_mesa) - uthash (
include/uthash/)
This project is licensed under the Apache License, Version 2.0.
Copyright (c) 2026 Valentin Liu (LIU, YUANCHEN)
You may obtain a copy of the Apache License, Version 2.0 at:
Unless required by applicable law or agreed to in writing, software distributed under the Apache License, Version 2.0 is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| Project | License | Path |
|---|---|---|
| UTHASH | BSD-style License | include/uthash/ |
| Mesa3D | Multiple Licenses | Mesa3D Project |