dmabuf

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 5 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

This section is empty.

Variables

View Source
var ErrNoSyncFileImport = errors.New("dmabuf: the kernel attaches no sync_file to a dmabuf")

ErrNoSyncFileImport reports a kernel without DMA_BUF_IOCTL_IMPORT_SYNC_FILE, added in Linux 6.0.

Functions

func ImportSyncFile

func ImportSyncFile(fd, syncFile int) error

ImportSyncFile attaches the fence in syncFile to the dmabuf fd as its writer's: whoever uses the dmabuf with implicit synchronization (a compositor, a display) waits for it. syncFile stays the caller's.

Types

type Buffer

type Buffer struct {
	Width, Height int
	Format        fourcc.Format
	Modifier      fourcc.Modifier
	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