gbm.rs wraps the CDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Smithay/gbm.rs/llms.txt
Use this file to discover all available pages before exploring further.
libgbm library in safe, ergonomic Rust types. It lets you allocate GPU-backed buffers, import external buffers from Wayland or EGL, and hook into DRM/KMS display pipelines — all without touching raw pointers or unsafe code in your application. The library is part of the Smithay ecosystem and works seamlessly alongside drm-rs.
Installation
Add gbm.rs to your Cargo.toml and choose the right feature flags for your use case.
Quickstart
Allocate your first GPU buffer and display it on screen in minutes.
Core Concepts
Understand Device, BufferObject, Surface, and how they relate to DRM/KMS.
API Reference
Full type signatures and parameter documentation for every public API.
What is the Generic Buffer Manager?
The Generic Buffer Manager (GBM) is a platform abstraction layer for GPU buffer allocation. It sits between your application and the kernel’s DRM subsystem, providing a portable interface for requesting memory buffers that the GPU can render into and the display controller can scan out. gbm.rs exposes this abstraction as safe Rust types with automatic reference counting and deterministic cleanup.DRM Integration
Use GBM buffers directly as KMS framebuffers with drm-rs.
Wayland Import
Import Wayland client buffers into GBM for display composition.
EGL Rendering
Create GBM surfaces for OpenGL ES rendering via EGL.
DMA-BUF Import
Import external DMA-BUF file descriptors as GBM buffer objects.
Cargo Features
Enable or disable Wayland, EGL, DRM, serde, and bindgen support.
Formats & Modifiers
DRM FourCC pixel formats and tiling modifiers explained.