ext-image-copy-capture-v1: add explicit sync support

Add set_acquire_point and set_release_point requests to
ext_image_copy_capture_frame_v1. These allow clients to provide DRM
syncobj timeline points that the compositor waits on before writing into
the capture buffer (acquire) and signals once the write is complete
(release), enabling GPU-to-GPU capture pipelines without relying on
implicit synchronization.

Timeline objects are imported via the existing
wp_linux_drm_syncobj_manager_v1.import_timeline request from the
linux-drm-syncobj-v1 protocol.

Explicit sync is opt-in per frame. If neither point is set the
compositor falls back to implicit synchronization, preserving full
backwards compatibility with version 1 clients and compositors. Explicit
sync is guaranteed to work with dma-buf buffers. Compositors may support
it for other buffer types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Doğukan Korkmaztürk <dkorkmazturk@nvidia.com>
This commit is contained in:
Doğukan Korkmaztürk 2026-04-15 10:38:52 -04:00
parent 911ab509ed
commit f73b48feee

View file

@ -199,7 +199,7 @@
</request>
</interface>
<interface name="ext_image_copy_capture_frame_v1" version="1">
<interface name="ext_image_copy_capture_frame_v1" version="2">
<description summary="image capture frame">
This object represents an image capture frame.
@ -211,12 +211,31 @@
event.
If the capture fails, the compositor must send the failed event.
Explicit synchronization may be enabled by setting an acquire and a
release timeline point before calling capture. Both points must be set,
or else the no_acquire_point or no_release_point protocol error is raised.
If neither is set the compositor falls back to implicit synchronization,
preserving backwards compatibility with version 1 compositors and clients.
The acquire and release timeline points must come from timeline objects
imported via wp_linux_drm_syncobj_manager_v1.import_timeline from the
linux-drm-syncobj-v1 protocol. Explicit synchronization is guaranteed for
dma-buf buffers. Compositors may support it for other buffer types.
</description>
<enum name="error">
<entry name="no_buffer" value="1" summary="capture sent without attach_buffer"/>
<entry name="invalid_buffer_damage" value="2" summary="invalid buffer damage"/>
<entry name="already_captured" value="3" summary="capture request has been sent"/>
<entry name="no_acquire_point" value="4"
summary="capture sent with a release point but no acquire point"/>
<entry name="no_release_point" value="5"
summary="capture sent with an acquire point but no release point"/>
<entry name="conflicting_points" value="6"
summary="acquire and release use the same timeline with acquire point >= release point"/>
<entry name="unsupported_buffer" value="7"
summary="the buffer does not support explicit synchronization"/>
</enum>
<request name="destroy" type="destructor">
@ -281,6 +300,9 @@
This request may only be sent once, or else the already_captured
protocol error is raised. A buffer must be attached before this request
is sent, or else the no_buffer protocol error is raised.
If an acquire or release timeline point has been set, both must be set
or the no_acquire_point or no_release_point protocol error is raised.
</description>
</request>
@ -336,6 +358,10 @@
The buffer may be re-used by the client after this event.
When explicit synchronization is in use, the delivery of this event
becomes undefined. Clients must instead wait for the release timeline
point to be signalled before accessing the buffer contents.
After receiving this event, the client must destroy the object.
</description>
</event>
@ -367,6 +393,68 @@
</description>
<arg name="reason" type="uint" enum="failure_reason"/>
</event>
<request name="set_acquire_point" since="2">
<description summary="set the acquire timeline point">
Set the timeline point the compositor must wait for before it may write
captured content into the buffer.
The compositor waits on this point before beginning the write into
the attached buffer. The client must signal this point once it has
finished any reads from a previous use of the same buffer, so the
compositor may safely overwrite it.
The 64-bit unsigned value combined from point_hi and point_lo is the
point value.
This request must not be sent after capture, or else the
already_captured protocol error is raised.
If at capture time a release point has been set but no acquire point
has been set, the no_acquire_point protocol error is raised.
If at capture time the acquire and release timelines are identical,
the acquire point value must be strictly less than the release point
value, or else the conflicting_points protocol error is raised.
</description>
<arg name="timeline" type="object" interface="wp_linux_drm_syncobj_timeline_v1"
summary="DRM syncobj timeline"/>
<arg name="point_hi" type="uint" summary="high 32 bits of the point value"/>
<arg name="point_lo" type="uint" summary="low 32 bits of the point value"/>
</request>
<request name="set_release_point" since="2">
<description summary="set the release timeline point">
Set the timeline point the compositor will signal once it has finished
writing captured content into the buffer.
After this point is signalled the client may safely access the captured
buffer contents without additional synchronization.
Because signalling a timeline point also signals every earlier point,
it is strongly recommended that each buffer use a dedicated timeline for
its release points. Reusing the same timeline for multiple buffers'
release points risks a release point being signalled before the
compositor has finished writing, if the compositor signals them out of
submission order.
The 64-bit unsigned value combined from point_hi and point_lo is the
point value.
This request must not be sent after capture, or else the
already_captured protocol error is raised.
If at capture time an acquire point has been set but no release point
has been set, the no_release_point protocol error is raised.
If at capture time the attached buffer does not support explicit
synchronization, the unsupported_buffer protocol error is raised.
</description>
<arg name="timeline" type="object" interface="wp_linux_drm_syncobj_timeline_v1"
summary="DRM syncobj timeline"/>
<arg name="point_hi" type="uint" summary="high 32 bits of the point value"/>
<arg name="point_lo" type="uint" summary="low 32 bits of the point value"/>
</request>
</interface>
<interface name="ext_image_copy_capture_cursor_session_v1" version="1">