DRM sync objects are kernel-managed fence binding points. A sync object starts empty (unsignalled). A GPU command submission IOCTL — or an explicit signal call — attaches a fence to it. Once the fence fires (the GPU work completes), the sync object becomes signalled and any waiters are unblocked. Sync objects serve as the bridge between GPU execution and display: an atomic commit can accept a sync object that fires only when the previous frame’s GPU rendering finishes, preventing tearing and removing the need for CPU-side blocking. drm-rs exposes both the binary sync object model (a single fence slot, suitable for VulkanDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Smithay/drm-rs/llms.txt
Use this file to discover all available pages before exploring further.
VkFence semantics) and the timeline sync object model (an ordered sequence of sequence points, suitable for Vulkan VkSemaphore with timeline semantics).
Check
DriverCapability::SyncObj before using binary sync objects and DriverCapability::TimelineSyncObj before using timeline operations. Calling sync object ioctls on a driver that does not support them returns an error.syncobj::Handle
An opaque, copy-cheap handle to a sync object resource. Internally a NonZeroU32 wrapped with repr(transparent). Also implements bytemuck::NoUninit, allowing slices of handles to be cast directly to &[u32] for batch operations.
Binary Sync Object Operations
create_syncobj
signalled is true, the object starts in the signalled state (useful for priming the first frame of a sequence where no prior GPU work exists).
destroy_syncobj
syncobj_to_fd
export_sync_file: false— exports as an opaque inter-process sync object fd, suitable for importing into another process withfd_to_syncobj.export_sync_file: true— exports as a pollablesync_filefd. This fd becomes readable (EPOLLIN) when the underlying fence signals. Compatible withepoll,poll, andtokio::io::unix::AsyncFd.
fd_to_syncobj
import_sync_file: false— imports an opaque sync object fd exported bysyncobj_to_fd(false).import_sync_file: true— imports async_filefd (e.g. from a GPU command submission) into a new sync object.
syncobj_wait
| Parameter | Description |
|---|---|
handles | Slice of sync object handles to wait on |
timeout_nsec | Timeout in nanoseconds. Use i64::MAX to wait indefinitely. A value of 0 polls without blocking. |
wait_all | true to wait until all handles signal; false to return when any handle signals |
wait_for_submit | true to wait even if no fence has been attached yet (the sync object is empty); false to return immediately with an error if a handle has no attached fence |
handles, or an error if the timeout expires.
syncobj_reset
syncobj_signal
Timeline Sync Object Operations
Timeline sync objects assign a monotonically increasingu64 sequence point to each fence. This maps directly to Vulkan timeline semaphore semantics and allows multiple in-flight frames to share a single sync object.
Requires
DriverCapability::TimelineSyncObj. Check the capability before calling any of these methods.syncobj_timeline_wait
handles and points are parallel slices — handles[i] must reach at least points[i] for that entry to be considered signalled.
wait_available: true waits until the timeline point has been submitted (a fence attached at that point) without waiting for it to signal. Useful for chaining submission on the CPU side.
Returns the index of the first satisfied entry.
syncobj_timeline_query
points[i] holds the highest signalled sequence point for handles[i]. If last_submitted is true, reports the highest submitted (not yet necessarily signalled) point instead.
syncobj_timeline_transfer
src_point of src_handle into dst_point of dst_handle. This lets you alias a single GPU fence across multiple timeline points or sync objects without re-exporting.
syncobj_timeline_signal
handles[i] is signalled at points[i].
syncobj_eventfd
eventfd to be incremented when a timeline sync object reaches the given point. wait_available: true fires the eventfd when the point is submitted rather than when it signals. Useful for integrating sync object events into an epoll-based or async event loop.