dmabufwl

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 11 Imported by: 2 modules, 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 dmabufwl builds zwp_linux_buffer_params_v1 objects from dmabuf descriptions, the step every linux-dmabuf import shares, and reads the compositor's linux-dmabuf feedback, default and per surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Device

func Device(words []int32) (uint64, error)

Device decodes a dev_t sent as a wl_array, the shape of linux-dmabuf feedback's main_device and ext-image-copy-capture's dmabuf_device.

func Modifiers

func Modifiers(words []int32) ([]fourcc.Modifier, error)

Modifiers decodes a wl_array of DRM format modifiers, such as ext-image-copy-capture's dmabuf_format sends, into the explicit ones in their order: implicit layouts and repeats left out.

func Params

Params validates b and returns params carrying its planes, ready for create or create_immed.

Types

type Feedback

type Feedback struct {
	Device    uint64
	Modifiers map[fourcc.Format][]fourcc.Modifier
	Tranches  []Tranche
}

Feedback is a compositor's linux-dmabuf feedback (version 4), default or for a surface: the device it wants buffers allocated on (main_device, a dev_t), its tranches in preference order, and per DRM format the explicit modifiers it imports across them all, tranche by tranche.

func DefaultFeedback

func DefaultFeedback(mgr *wlr.ZwpDmabufV1, version uint32, roundtrip func() error) (Feedback, error)

DefaultFeedback asks mgr, bound at version, for its default feedback and dispatches through roundtrip until the compositor has sent it whole. A version below 4, which has no feedback, and a compositor that names no main device are errors.

func (Feedback) Equal

func (f Feedback) Equal(g Feedback) bool

Equal reports whether f and g name the same main device and the same tranches in the same order: a feedback resent unchanged needs no new buffers.

func (Feedback) Preferred

func (f Feedback) Preferred(format fourcc.Format) (Tranche, bool)

Preferred is the tranche to allocate a buffer of format from: the first scanout tranche that takes format, else the first tranche that does. It is false when no tranche takes format in an explicit modifier.

type SurfaceFeedback

type SurfaceFeedback struct {
	// contains filtered or unexported fields
}

SurfaceFeedback follows a surface's linux-dmabuf feedback for as long as it lives: the first feedback and every change the compositor sends, such as a scanout tranche added when the surface could go on a plane and removed when it no longer can.

func WatchSurfaceFeedback

func WatchSurfaceFeedback(mgr *wlr.ZwpDmabufV1, version uint32, surface *wlr.Surface, update func(Feedback, error)) (*SurfaceFeedback, error)

WatchSurfaceFeedback asks mgr, bound at version, for surface's feedback and calls update, on the goroutine that dispatches the connection, with each feedback the compositor finishes, or with why it is malformed: a bad format table or device, or no main device. A version below 4, which has no feedback, is an error. The feedback is followed until Destroy.

func (*SurfaceFeedback) Destroy

func (s *SurfaceFeedback) Destroy() error

Destroy stops following the feedback and releases its object.

type Tranche

type Tranche struct {
	Device    uint64
	Flags     TrancheFlags
	Modifiers map[fourcc.Format][]fourcc.Modifier
}

Tranche is one preference tranche of linux-dmabuf feedback: the device its buffers are to be allocated on (target_device, a dev_t), its flags, and per DRM format the explicit modifiers it takes, in the compositor's preference order.

func (Tranche) Scanout

func (t Tranche) Scanout() bool

Scanout reports whether the tranche carries TrancheScanout.

type TrancheFlags

type TrancheFlags uint32

TrancheFlags are a feedback tranche's zwp_linux_dmabuf_feedback_v1 tranche_flags.

TrancheScanout marks a tranche whose buffers the compositor can put on a display plane directly, without compositing them.

Jump to

Keyboard shortcuts

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