dmabufprobe

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 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 dmabufprobe picks the DRM modifier a screencopy into GPU memory uses: the modifiers the compositor imports, ordered against the ones the device renders and exports, tried one at a time until a buffer allocates, imports and takes a frame. The ScreenCast portal and the recorder both allocate this way.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoLayout = errors.New("dmabufprobe: the compositor and the device share no modifier")

ErrNoLayout is a probe that found no modifier to try.

Functions

This section is empty.

Types

type Layout

type Layout struct {
	Modifier fourcc.Modifier
	Render   bool
}

Layout is one modifier to probe and how its buffers are allocated: for rendering into, when the device renders the modifier, or only for transfer and sampling, when it only exports it (linear on NVIDIA).

func First

func First[T any](layouts []Layout, try func(Layout) (T, error)) (T, Layout, error)

First tries layouts in order, one at a time, and returns the first one try accepts with its result. One at a time, because a compositor may advertise a tiling it then fails to import (sway's Vulkan renderer on NVIDIA), and a set would leave the pick to the driver. Declining every layout names why each one failed.

func Layouts

func Layouts(compositor, rendered, exported []fourcc.Modifier) []Layout

Layouts orders the modifiers to probe among the ones the compositor imports, in its order: linear first, the layout every consumer and driver takes, then the ones the device renders in, then the ones it only exports. A modifier the device neither renders nor exports is left out.

Jump to

Keyboard shortcuts

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