Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
Add a sync_fence event to the export-dmabuf protocol.
Browse files Browse the repository at this point in the history
This commit adds a sync_fence FD to the export-dmabuf protocol, allowing
for clients to synchronize their readout of the frame with the last
operation the compositor performs to the frame, thus eliminating any
race conditions where the compositor gives the frame to a client while
still compositing to it.
  • Loading branch information
cyanreg committed Mar 27, 2020
1 parent 55cdefe commit 0c2dba5
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions unstable/wlr-export-dmabuf-unstable-v1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
interface version number is reset.
</description>

<interface name="zwlr_export_dmabuf_manager_v1" version="1">
<interface name="zwlr_export_dmabuf_manager_v1" version="2">
<description summary="manager to inform clients and begin capturing">
This object is a manager with which to start capturing from sources.
</description>
Expand All @@ -59,7 +59,7 @@
</request>
</interface>

<interface name="zwlr_export_dmabuf_frame_v1" version="1">
<interface name="zwlr_export_dmabuf_frame_v1" version="2">
<description summary="a DMA-BUF frame">
This object represents a single DMA-BUF frame.

Expand All @@ -75,6 +75,9 @@
responsible for closing the associated file descriptor.

All frames are read-only and may not be written into or altered.

If a sync_fence event is received, clients must wait on the sync
fence to be signalled by the compositor before using the frame.
</description>

<enum name="flags">
Expand Down Expand Up @@ -141,9 +144,11 @@

<event name="ready">
<description summary="indicates frame is available for reading">
This event is sent as soon as the frame is presented, indicating it is
available for reading. This event includes the time at which
presentation happened at.
This event is sent as soon as all the data pertaining to the frame has
been received by the client. This event includes the time at which
the scanout began at.
If a sync_fence object has been received, the clients must wait for it
to be signalled, otherwise the frame can be considered ready to be read.

The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec triples,
each component being an unsigned 32-bit value. Whole seconds are in
Expand Down Expand Up @@ -199,5 +204,16 @@
to close any FDs it has been given.
</description>
</request>

<!-- Version 2 additions -->
<event name="sync_fence" since="2">
<description summary="explicit synchronization fence">
This event provides a dma_fence kernel object which will be signalled
when the client can start sampling from the buffer.
</description>
<arg name="fd" type="fd"
summary="fence fd for last operation on buffer"/>
</event>

</interface>
</protocol>

0 comments on commit 0c2dba5

Please sign in to comment.