syncobj

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package syncobj bridges Vulkan SYNC_FD semaphores and Wayland DRM syncobj timelines on the compositor-selected render node. It never interprets a Vulkan OPAQUE_FD as a DRM syncobj FD.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

Node owns the DRM render fd. Only open the render node of the Vulkan device matched to linux-dmabuf main_device. Never substitute a different GPU.

func Open

func Open(path string) (*Node, error)

func (*Node) AcquirePoint

func (n *Node) AcquirePoint(syncFile int, timeline uint32, point uint64) error

AcquirePoint transfers the Vulkan submission's exported SYNC_FD into the persistent acquire timeline. The caller retains syncFile on import error.

func (*Node) Close

func (n *Node) Close() error

func (*Node) Create

func (n *Node) Create() (uint32, error)

func (*Node) Destroy

func (n *Node) Destroy(handle uint32) error

func (*Node) EventFD added in v0.5.0

func (n *Node) EventFD(handle uint32, point uint64, efd int) error

EventFD arms efd, an eventfd owned by the caller, to become readable when point of the timeline behind handle is signaled. The point need not be submitted yet. The registration is one-shot: re-arm after every use. The call returns at once and never waits.

func (*Node) ExportTimeline

func (n *Node) ExportTimeline(handle uint32) (int, error)

ExportTimeline returns a new owned syncobj FD (not a sync_file). The caller owns it and closes it, or passes a duplicate to its Wayland client.

func (*Node) ImportFence

func (n *Node) ImportFence(syncFile int) (uint32, error)

ImportFence consumes syncFile only after FD_TO_HANDLE imports it into a pre-created destination syncobj. With IMPORT_SYNC_FILE, Handle is an input, not an output: asking the kernel to import into handle zero returns ENOENT. The caller retains syncFile if the ioctl rejects it.

func (*Node) Query

func (n *Node) Query(handle uint32) (uint64, error)

Query returns the last signaled point. This is diagnostic only: timeline wait, not an optimistic query, authorizes release.

func (*Node) ReleaseFence

func (n *Node) ReleaseFence(timeline uint32, point uint64) (int, error)

ReleaseFence exports a compositor release point as a sync_file suitable for TEMPORARY Vulkan semaphore import. The caller owns the returned FD until Vulkan accepts the import; failed imports must close it.

func (*Node) Signal added in v0.5.0

func (n *Node) Signal(handle uint32, point uint64) error

Signal signals one timeline point from the CPU (DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL). The compositor does this through its release timeline; clients use it only to simulate that in tests.

func (*Node) Signaled

func (n *Node) Signaled(handle uint32, point uint64) (bool, error)

Signaled performs a zero-time wait for tests and shutdown diagnostics.

func (*Node) Transfer

func (n *Node) Transfer(src uint32, srcPoint uint64, dst uint32, dstPoint uint64) error

func (*Node) WaitPoint

func (n *Node) WaitPoint(handle uint32, point uint64, timeout time.Duration) (bool, error)

WaitPoint waits for a submitted release point for at most timeout. Call it only off the render path: it can block for up to timeout. WAIT_FOR_SUBMIT handles the interval before the compositor attaches its fence to the point.

Jump to

Keyboard shortcuts

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