syncobj

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 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) ExportTimeline

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

ExportTimeline returns a new owned syncobj FD (not a sync_file). The caller hands it to WLTurbo's ImportTimeline, which closes only after a successful request send; on send failure the caller must close the FD.

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) 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 from a waiter goroutine, never from the presentation loop. 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