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 ¶
- type Node
- func (n *Node) AcquirePoint(syncFile int, timeline uint32, point uint64) error
- func (n *Node) Close() error
- func (n *Node) Create() (uint32, error)
- func (n *Node) Destroy(handle uint32) error
- func (n *Node) EventFD(handle uint32, point uint64, efd int) error
- func (n *Node) ExportTimeline(handle uint32) (int, error)
- func (n *Node) ImportFence(syncFile int) (uint32, error)
- func (n *Node) Query(handle uint32) (uint64, error)
- func (n *Node) ReleaseFence(timeline uint32, point uint64) (int, error)
- func (n *Node) Signal(handle uint32, point uint64) error
- func (n *Node) Signaled(handle uint32, point uint64) (bool, error)
- func (n *Node) Transfer(src uint32, srcPoint uint64, dst uint32, dstPoint uint64) error
- func (n *Node) WaitPoint(handle uint32, point uint64, timeout time.Duration) (bool, error)
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 (*Node) AcquirePoint ¶
AcquirePoint transfers the Vulkan submission's exported SYNC_FD into the persistent acquire timeline. The caller retains syncFile on import error.
func (*Node) EventFD ¶ added in v0.5.0
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 ¶
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 ¶
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 ¶
Query returns the last signaled point. This is diagnostic only: timeline wait, not an optimistic query, authorizes release.
func (*Node) ReleaseFence ¶
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
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.