dmabuf

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 1 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dmabuf describes Linux dma-buf frames: GPU (or udmabuf) memory handed to the compositor by file descriptor through zwp_linux_dmabuf_v1, with no copy. capture fills them with screen contents; widget.GPUArea presents them.

Index

Constants

View Source
const (
	// FormatXRGB8888 is DRM_FORMAT_XRGB8888 ('XR24').
	FormatXRGB8888 uint32 = 0x34325258
	// FormatARGB8888 is DRM_FORMAT_ARGB8888 ('AR24').
	FormatARGB8888 uint32 = 0x34325241
	// ModifierLinear is DRM_FORMAT_MOD_LINEAR.
	ModifierLinear uint64 = 0
	// ModifierInvalid is DRM_FORMAT_MOD_INVALID: an implicit,
	// driver-chosen layout.
	ModifierInvalid uint64 = 0x00ffffffffffffff
)

DRM fourcc formats and modifiers the lys packages name; any other DRM code works the same way.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	Width, Height int
	// Format is the DRM fourcc.
	Format uint32
	// Modifier is the DRM format modifier.
	Modifier uint64
	Planes   []Plane
}

Buffer describes a dmabuf. The caller allocates it (gbm, a DRM dumb buffer, udmabuf) and keeps the plane fds open for as long as the compositor-side buffer lives; importing dups nothing. The planes must be the ones Format calls for.

func (Buffer) Validate

func (b Buffer) Validate() error

Validate reports a buffer the compositor would reject as a protocol error: a non-positive size, no planes or more than four, or a plane without a stride or fd.

type Plane

type Plane struct {
	FD     int
	Offset uint32
	Stride uint32
}

Plane is one plane of a dmabuf: its file descriptor and the plane's byte offset and stride within it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL