Documentation
¶
Overview ¶
Package gbm allocates GPU buffers for zero-copy screencast frames (wayle-share-preview dmabuf.rs): a gbm device on a DRM render node, buffer objects with a modifier the consumer takes, and their planes as dmabuf fds. libgbm is bound through purego, so the binary stays CGO_ENABLED=0. Everything here is best effort: any failure is an error the caller answers by staying on shared memory.
Index ¶
Constants ¶
const ( ModInvalid uint64 = 0x00ffffffffffffff ModLinear uint64 = 0 )
The DRM modifiers every allocator understands: implicit (the driver's choice) and linear.
Variables ¶
var ( FormatXRGB8888 = Fourcc('X', 'R', '2', '4') FormatARGB8888 = Fourcc('A', 'R', '2', '4') FormatXBGR8888 = Fourcc('X', 'B', '2', '4') FormatABGR8888 = Fourcc('A', 'B', '2', '4') )
The packed formats screencopy hands out.
var RenderNodes = []string{"/dev/dri/renderD128", "/dev/dri/renderD129", "/dev/dri/renderD130"}
RenderNodes are the DRM render nodes tried in order: unprivileged, and the right device for offscreen allocation.
Functions ¶
func ModifierCandidates ¶
ModifierCandidates is the order modifiers are tried in: the consumer's, then implicit and linear, which every driver takes.
Types ¶
type Buffer ¶
type Buffer struct {
Width, Height uint32
Fourcc uint32
Modifier uint64
Planes []Plane
// contains filtered or unexported fields
}
Buffer is one allocated buffer object and its exported planes; the plane fds stay open until Release.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is a gbm device on an open render node.