1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /**
15 * @page page_zwp_linux_explicit_synchronization_unstable_v1 The zwp_linux_explicit_synchronization_unstable_v1 protocol
16 * @section page_ifaces_zwp_linux_explicit_synchronization_unstable_v1 Interfaces
17 * - @subpage page_iface_zwp_linux_explicit_synchronization_v1 - protocol for providing explicit synchronization
18 * - @subpage page_iface_zwp_linux_surface_synchronization_v1 - per-surface explicit synchronization support
19 * - @subpage page_iface_zwp_linux_buffer_release_v1 - buffer release explicit synchronization
20 * @section page_copyright_zwp_linux_explicit_synchronization_unstable_v1 Copyright
21 * <pre>
22 *
23 * Copyright 2016 The Chromium Authors.
24 * Copyright 2017 Intel Corporation
25 * Copyright 2018 Collabora, Ltd
26 *
27 * Permission is hereby granted, free of charge, to any person obtaining a
28 * copy of this software and associated documentation files (the "Software"),
29 * to deal in the Software without restriction, including without limitation
30 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
31 * and/or sell copies of the Software, and to permit persons to whom the
32 * Software is furnished to do so, subject to the following conditions:
33 *
34 * The above copyright notice and this permission notice (including the next
35 * paragraph) shall be included in all copies or substantial portions of the
36 * Software.
37 *
38 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
41 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
42 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
44 * DEALINGS IN THE SOFTWARE.
45 * </pre>
46 */
47 struct wl_surface;
48 struct zwp_linux_buffer_release_v1;
49 struct zwp_linux_explicit_synchronization_v1;
50 struct zwp_linux_surface_synchronization_v1;
51
52 #ifndef ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_INTERFACE
53 #define ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_INTERFACE
54 /**
55 * @page page_iface_zwp_linux_explicit_synchronization_v1 zwp_linux_explicit_synchronization_v1
56 * @section page_iface_zwp_linux_explicit_synchronization_v1_desc Description
57 *
58 * This global is a factory interface, allowing clients to request
59 * explicit synchronization for buffers on a per-surface basis.
60 *
61 * See zwp_linux_surface_synchronization_v1 for more information.
62 *
63 * This interface is derived from Chromium's
64 * zcr_linux_explicit_synchronization_v1.
65 *
66 * Warning! The protocol described in this file is experimental and
67 * backward incompatible changes may be made. Backward compatible changes
68 * may be added together with the corresponding interface version bump.
69 * Backward incompatible changes are done by bumping the version number in
70 * the protocol and interface names and resetting the interface version.
71 * Once the protocol is to be declared stable, the 'z' prefix and the
72 * version number in the protocol and interface names are removed and the
73 * interface version number is reset.
74 * @section page_iface_zwp_linux_explicit_synchronization_v1_api API
75 * See @ref iface_zwp_linux_explicit_synchronization_v1.
76 */
77 /**
78 * @defgroup iface_zwp_linux_explicit_synchronization_v1 The zwp_linux_explicit_synchronization_v1 interface
79 *
80 * This global is a factory interface, allowing clients to request
81 * explicit synchronization for buffers on a per-surface basis.
82 *
83 * See zwp_linux_surface_synchronization_v1 for more information.
84 *
85 * This interface is derived from Chromium's
86 * zcr_linux_explicit_synchronization_v1.
87 *
88 * Warning! The protocol described in this file is experimental and
89 * backward incompatible changes may be made. Backward compatible changes
90 * may be added together with the corresponding interface version bump.
91 * Backward incompatible changes are done by bumping the version number in
92 * the protocol and interface names and resetting the interface version.
93 * Once the protocol is to be declared stable, the 'z' prefix and the
94 * version number in the protocol and interface names are removed and the
95 * interface version number is reset.
96 */
97 extern const struct wl_interface zwp_linux_explicit_synchronization_v1_interface;
98 #endif
99 #ifndef ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_INTERFACE
100 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_INTERFACE
101 /**
102 * @page page_iface_zwp_linux_surface_synchronization_v1 zwp_linux_surface_synchronization_v1
103 * @section page_iface_zwp_linux_surface_synchronization_v1_desc Description
104 *
105 * This object implements per-surface explicit synchronization.
106 *
107 * Synchronization refers to co-ordination of pipelined operations performed
108 * on buffers. Most GPU clients will schedule an asynchronous operation to
109 * render to the buffer, then immediately send the buffer to the compositor
110 * to be attached to a surface.
111 *
112 * In implicit synchronization, ensuring that the rendering operation is
113 * complete before the compositor displays the buffer is an implementation
114 * detail handled by either the kernel or userspace graphics driver.
115 *
116 * By contrast, in explicit synchronization, dma_fence objects mark when the
117 * asynchronous operations are complete. When submitting a buffer, the
118 * client provides an acquire fence which will be waited on before the
119 * compositor accesses the buffer. The Wayland server, through a
120 * zwp_linux_buffer_release_v1 object, will inform the client with an event
121 * which may be accompanied by a release fence, when the compositor will no
122 * longer access the buffer contents due to the specific commit that
123 * requested the release event.
124 *
125 * Each surface can be associated with only one object of this interface at
126 * any time.
127 *
128 * In version 1 of this interface, explicit synchronization is only
129 * guaranteed to be supported for buffers created with any version of the
130 * wp_linux_dmabuf buffer factory. Version 2 additionally guarantees
131 * explicit synchronization support for opaque EGL buffers, which is a type
132 * of platform specific buffers described in the EGL_WL_bind_wayland_display
133 * extension. Compositors are free to support explicit synchronization for
134 * additional buffer types.
135 * @section page_iface_zwp_linux_surface_synchronization_v1_api API
136 * See @ref iface_zwp_linux_surface_synchronization_v1.
137 */
138 /**
139 * @defgroup iface_zwp_linux_surface_synchronization_v1 The zwp_linux_surface_synchronization_v1 interface
140 *
141 * This object implements per-surface explicit synchronization.
142 *
143 * Synchronization refers to co-ordination of pipelined operations performed
144 * on buffers. Most GPU clients will schedule an asynchronous operation to
145 * render to the buffer, then immediately send the buffer to the compositor
146 * to be attached to a surface.
147 *
148 * In implicit synchronization, ensuring that the rendering operation is
149 * complete before the compositor displays the buffer is an implementation
150 * detail handled by either the kernel or userspace graphics driver.
151 *
152 * By contrast, in explicit synchronization, dma_fence objects mark when the
153 * asynchronous operations are complete. When submitting a buffer, the
154 * client provides an acquire fence which will be waited on before the
155 * compositor accesses the buffer. The Wayland server, through a
156 * zwp_linux_buffer_release_v1 object, will inform the client with an event
157 * which may be accompanied by a release fence, when the compositor will no
158 * longer access the buffer contents due to the specific commit that
159 * requested the release event.
160 *
161 * Each surface can be associated with only one object of this interface at
162 * any time.
163 *
164 * In version 1 of this interface, explicit synchronization is only
165 * guaranteed to be supported for buffers created with any version of the
166 * wp_linux_dmabuf buffer factory. Version 2 additionally guarantees
167 * explicit synchronization support for opaque EGL buffers, which is a type
168 * of platform specific buffers described in the EGL_WL_bind_wayland_display
169 * extension. Compositors are free to support explicit synchronization for
170 * additional buffer types.
171 */
172 extern const struct wl_interface zwp_linux_surface_synchronization_v1_interface;
173 #endif
174 #ifndef ZWP_LINUX_BUFFER_RELEASE_V1_INTERFACE
175 #define ZWP_LINUX_BUFFER_RELEASE_V1_INTERFACE
176 /**
177 * @page page_iface_zwp_linux_buffer_release_v1 zwp_linux_buffer_release_v1
178 * @section page_iface_zwp_linux_buffer_release_v1_desc Description
179 *
180 * This object is instantiated in response to a
181 * zwp_linux_surface_synchronization_v1.get_release request.
182 *
183 * It provides an alternative to wl_buffer.release events, providing a
184 * unique release from a single wl_surface.commit request. The release event
185 * also supports explicit synchronization, providing a fence FD for the
186 * client to synchronize against.
187 *
188 * Exactly one event, either a fenced_release or an immediate_release, will
189 * be emitted for the wl_surface.commit request. The compositor can choose
190 * release by release which event it uses.
191 *
192 * This event does not replace wl_buffer.release events; servers are still
193 * required to send those events.
194 *
195 * Once a buffer release object has delivered a 'fenced_release' or an
196 * 'immediate_release' event it is automatically destroyed.
197 * @section page_iface_zwp_linux_buffer_release_v1_api API
198 * See @ref iface_zwp_linux_buffer_release_v1.
199 */
200 /**
201 * @defgroup iface_zwp_linux_buffer_release_v1 The zwp_linux_buffer_release_v1 interface
202 *
203 * This object is instantiated in response to a
204 * zwp_linux_surface_synchronization_v1.get_release request.
205 *
206 * It provides an alternative to wl_buffer.release events, providing a
207 * unique release from a single wl_surface.commit request. The release event
208 * also supports explicit synchronization, providing a fence FD for the
209 * client to synchronize against.
210 *
211 * Exactly one event, either a fenced_release or an immediate_release, will
212 * be emitted for the wl_surface.commit request. The compositor can choose
213 * release by release which event it uses.
214 *
215 * This event does not replace wl_buffer.release events; servers are still
216 * required to send those events.
217 *
218 * Once a buffer release object has delivered a 'fenced_release' or an
219 * 'immediate_release' event it is automatically destroyed.
220 */
221 extern const struct wl_interface zwp_linux_buffer_release_v1_interface;
222 #endif
223
224 #ifndef ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_ENUM
225 #define ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_ENUM
226 enum zwp_linux_explicit_synchronization_v1_error {
227 /**
228 * the surface already has a synchronization object associated
229 */
230 ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_SYNCHRONIZATION_EXISTS = 0,
231 };
232 #endif /* ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_ERROR_ENUM */
233
234 #define ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_DESTROY 0
235 #define ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_GET_SYNCHRONIZATION 1
236
237
238 /**
239 * @ingroup iface_zwp_linux_explicit_synchronization_v1
240 */
241 #define ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_DESTROY_SINCE_VERSION 1
242 /**
243 * @ingroup iface_zwp_linux_explicit_synchronization_v1
244 */
245 #define ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_GET_SYNCHRONIZATION_SINCE_VERSION 1
246
247 /** @ingroup iface_zwp_linux_explicit_synchronization_v1 */
248 static inline void
zwp_linux_explicit_synchronization_v1_set_user_data(struct zwp_linux_explicit_synchronization_v1 * zwp_linux_explicit_synchronization_v1,void * user_data)249 zwp_linux_explicit_synchronization_v1_set_user_data(struct zwp_linux_explicit_synchronization_v1 *zwp_linux_explicit_synchronization_v1, void *user_data)
250 {
251 wl_proxy_set_user_data((struct wl_proxy *) zwp_linux_explicit_synchronization_v1, user_data);
252 }
253
254 /** @ingroup iface_zwp_linux_explicit_synchronization_v1 */
255 static inline void *
zwp_linux_explicit_synchronization_v1_get_user_data(struct zwp_linux_explicit_synchronization_v1 * zwp_linux_explicit_synchronization_v1)256 zwp_linux_explicit_synchronization_v1_get_user_data(struct zwp_linux_explicit_synchronization_v1 *zwp_linux_explicit_synchronization_v1)
257 {
258 return wl_proxy_get_user_data((struct wl_proxy *) zwp_linux_explicit_synchronization_v1);
259 }
260
261 static inline uint32_t
zwp_linux_explicit_synchronization_v1_get_version(struct zwp_linux_explicit_synchronization_v1 * zwp_linux_explicit_synchronization_v1)262 zwp_linux_explicit_synchronization_v1_get_version(struct zwp_linux_explicit_synchronization_v1 *zwp_linux_explicit_synchronization_v1)
263 {
264 return wl_proxy_get_version((struct wl_proxy *) zwp_linux_explicit_synchronization_v1);
265 }
266
267 /**
268 * @ingroup iface_zwp_linux_explicit_synchronization_v1
269 *
270 * Destroy this explicit synchronization factory object. Other objects,
271 * including zwp_linux_surface_synchronization_v1 objects created by this
272 * factory, shall not be affected by this request.
273 */
274 static inline void
zwp_linux_explicit_synchronization_v1_destroy(struct zwp_linux_explicit_synchronization_v1 * zwp_linux_explicit_synchronization_v1)275 zwp_linux_explicit_synchronization_v1_destroy(struct zwp_linux_explicit_synchronization_v1 *zwp_linux_explicit_synchronization_v1)
276 {
277 wl_proxy_marshal_flags((struct wl_proxy *) zwp_linux_explicit_synchronization_v1,
278 ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_linux_explicit_synchronization_v1), WL_MARSHAL_FLAG_DESTROY);
279 }
280
281 /**
282 * @ingroup iface_zwp_linux_explicit_synchronization_v1
283 *
284 * Instantiate an interface extension for the given wl_surface to provide
285 * explicit synchronization.
286 *
287 * If the given wl_surface already has an explicit synchronization object
288 * associated, the synchronization_exists protocol error is raised.
289 *
290 * Graphics APIs, like EGL or Vulkan, that manage the buffer queue and
291 * commits of a wl_surface themselves, are likely to be using this
292 * extension internally. If a client is using such an API for a
293 * wl_surface, it should not directly use this extension on that surface,
294 * to avoid raising a synchronization_exists protocol error.
295 */
296 static inline struct zwp_linux_surface_synchronization_v1 *
zwp_linux_explicit_synchronization_v1_get_synchronization(struct zwp_linux_explicit_synchronization_v1 * zwp_linux_explicit_synchronization_v1,struct wl_surface * surface)297 zwp_linux_explicit_synchronization_v1_get_synchronization(struct zwp_linux_explicit_synchronization_v1 *zwp_linux_explicit_synchronization_v1, struct wl_surface *surface)
298 {
299 struct wl_proxy *id;
300
301 id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_linux_explicit_synchronization_v1,
302 ZWP_LINUX_EXPLICIT_SYNCHRONIZATION_V1_GET_SYNCHRONIZATION, &zwp_linux_surface_synchronization_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_linux_explicit_synchronization_v1), 0, NULL, surface);
303
304 return (struct zwp_linux_surface_synchronization_v1 *) id;
305 }
306
307 #ifndef ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_ENUM
308 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_ENUM
309 enum zwp_linux_surface_synchronization_v1_error {
310 /**
311 * the fence specified by the client could not be imported
312 */
313 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_INVALID_FENCE = 0,
314 /**
315 * multiple fences added for a single surface commit
316 */
317 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_DUPLICATE_FENCE = 1,
318 /**
319 * multiple releases added for a single surface commit
320 */
321 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_DUPLICATE_RELEASE = 2,
322 /**
323 * the associated wl_surface was destroyed
324 */
325 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_NO_SURFACE = 3,
326 /**
327 * the buffer does not support explicit synchronization
328 */
329 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_UNSUPPORTED_BUFFER = 4,
330 /**
331 * no buffer was attached
332 */
333 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_NO_BUFFER = 5,
334 };
335 #endif /* ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_ERROR_ENUM */
336
337 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_DESTROY 0
338 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_SET_ACQUIRE_FENCE 1
339 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_GET_RELEASE 2
340
341
342 /**
343 * @ingroup iface_zwp_linux_surface_synchronization_v1
344 */
345 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_DESTROY_SINCE_VERSION 1
346 /**
347 * @ingroup iface_zwp_linux_surface_synchronization_v1
348 */
349 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_SET_ACQUIRE_FENCE_SINCE_VERSION 1
350 /**
351 * @ingroup iface_zwp_linux_surface_synchronization_v1
352 */
353 #define ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_GET_RELEASE_SINCE_VERSION 1
354
355 /** @ingroup iface_zwp_linux_surface_synchronization_v1 */
356 static inline void
zwp_linux_surface_synchronization_v1_set_user_data(struct zwp_linux_surface_synchronization_v1 * zwp_linux_surface_synchronization_v1,void * user_data)357 zwp_linux_surface_synchronization_v1_set_user_data(struct zwp_linux_surface_synchronization_v1 *zwp_linux_surface_synchronization_v1, void *user_data)
358 {
359 wl_proxy_set_user_data((struct wl_proxy *) zwp_linux_surface_synchronization_v1, user_data);
360 }
361
362 /** @ingroup iface_zwp_linux_surface_synchronization_v1 */
363 static inline void *
zwp_linux_surface_synchronization_v1_get_user_data(struct zwp_linux_surface_synchronization_v1 * zwp_linux_surface_synchronization_v1)364 zwp_linux_surface_synchronization_v1_get_user_data(struct zwp_linux_surface_synchronization_v1 *zwp_linux_surface_synchronization_v1)
365 {
366 return wl_proxy_get_user_data((struct wl_proxy *) zwp_linux_surface_synchronization_v1);
367 }
368
369 static inline uint32_t
zwp_linux_surface_synchronization_v1_get_version(struct zwp_linux_surface_synchronization_v1 * zwp_linux_surface_synchronization_v1)370 zwp_linux_surface_synchronization_v1_get_version(struct zwp_linux_surface_synchronization_v1 *zwp_linux_surface_synchronization_v1)
371 {
372 return wl_proxy_get_version((struct wl_proxy *) zwp_linux_surface_synchronization_v1);
373 }
374
375 /**
376 * @ingroup iface_zwp_linux_surface_synchronization_v1
377 *
378 * Destroy this explicit synchronization object.
379 *
380 * Any fence set by this object with set_acquire_fence since the last
381 * commit will be discarded by the server. Any fences set by this object
382 * before the last commit are not affected.
383 *
384 * zwp_linux_buffer_release_v1 objects created by this object are not
385 * affected by this request.
386 */
387 static inline void
zwp_linux_surface_synchronization_v1_destroy(struct zwp_linux_surface_synchronization_v1 * zwp_linux_surface_synchronization_v1)388 zwp_linux_surface_synchronization_v1_destroy(struct zwp_linux_surface_synchronization_v1 *zwp_linux_surface_synchronization_v1)
389 {
390 wl_proxy_marshal_flags((struct wl_proxy *) zwp_linux_surface_synchronization_v1,
391 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_linux_surface_synchronization_v1), WL_MARSHAL_FLAG_DESTROY);
392 }
393
394 /**
395 * @ingroup iface_zwp_linux_surface_synchronization_v1
396 *
397 * Set the acquire fence that must be signaled before the compositor
398 * may sample from the buffer attached with wl_surface.attach. The fence
399 * is a dma_fence kernel object.
400 *
401 * The acquire fence is double-buffered state, and will be applied on the
402 * next wl_surface.commit request for the associated surface. Thus, it
403 * applies only to the buffer that is attached to the surface at commit
404 * time.
405 *
406 * If the provided fd is not a valid dma_fence fd, then an INVALID_FENCE
407 * error is raised.
408 *
409 * If a fence has already been attached during the same commit cycle, a
410 * DUPLICATE_FENCE error is raised.
411 *
412 * If the associated wl_surface was destroyed, a NO_SURFACE error is
413 * raised.
414 *
415 * If at surface commit time the attached buffer does not support explicit
416 * synchronization, an UNSUPPORTED_BUFFER error is raised.
417 *
418 * If at surface commit time there is no buffer attached, a NO_BUFFER
419 * error is raised.
420 */
421 static inline void
zwp_linux_surface_synchronization_v1_set_acquire_fence(struct zwp_linux_surface_synchronization_v1 * zwp_linux_surface_synchronization_v1,int32_t fd)422 zwp_linux_surface_synchronization_v1_set_acquire_fence(struct zwp_linux_surface_synchronization_v1 *zwp_linux_surface_synchronization_v1, int32_t fd)
423 {
424 wl_proxy_marshal_flags((struct wl_proxy *) zwp_linux_surface_synchronization_v1,
425 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_SET_ACQUIRE_FENCE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_linux_surface_synchronization_v1), 0, fd);
426 }
427
428 /**
429 * @ingroup iface_zwp_linux_surface_synchronization_v1
430 *
431 * Create a listener for the release of the buffer attached by the
432 * client with wl_surface.attach. See zwp_linux_buffer_release_v1
433 * documentation for more information.
434 *
435 * The release object is double-buffered state, and will be associated
436 * with the buffer that is attached to the surface at wl_surface.commit
437 * time.
438 *
439 * If a zwp_linux_buffer_release_v1 object has already been requested for
440 * the surface in the same commit cycle, a DUPLICATE_RELEASE error is
441 * raised.
442 *
443 * If the associated wl_surface was destroyed, a NO_SURFACE error
444 * is raised.
445 *
446 * If at surface commit time there is no buffer attached, a NO_BUFFER
447 * error is raised.
448 */
449 static inline struct zwp_linux_buffer_release_v1 *
zwp_linux_surface_synchronization_v1_get_release(struct zwp_linux_surface_synchronization_v1 * zwp_linux_surface_synchronization_v1)450 zwp_linux_surface_synchronization_v1_get_release(struct zwp_linux_surface_synchronization_v1 *zwp_linux_surface_synchronization_v1)
451 {
452 struct wl_proxy *release;
453
454 release = wl_proxy_marshal_flags((struct wl_proxy *) zwp_linux_surface_synchronization_v1,
455 ZWP_LINUX_SURFACE_SYNCHRONIZATION_V1_GET_RELEASE, &zwp_linux_buffer_release_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_linux_surface_synchronization_v1), 0, NULL);
456
457 return (struct zwp_linux_buffer_release_v1 *) release;
458 }
459
460 /**
461 * @ingroup iface_zwp_linux_buffer_release_v1
462 * @struct zwp_linux_buffer_release_v1_listener
463 */
464 struct zwp_linux_buffer_release_v1_listener {
465 /**
466 * release buffer with fence
467 *
468 * Sent when the compositor has finalised its usage of the
469 * associated buffer for the relevant commit, providing a dma_fence
470 * which will be signaled when all operations by the compositor on
471 * that buffer for that commit have finished.
472 *
473 * Once the fence has signaled, and assuming the associated buffer
474 * is not pending release from other wl_surface.commit requests, no
475 * additional explicit or implicit synchronization is required to
476 * safely reuse or destroy the buffer.
477 *
478 * This event destroys the zwp_linux_buffer_release_v1 object.
479 * @param fence fence for last operation on buffer
480 */
481 void (*fenced_release)(void *data,
482 struct zwp_linux_buffer_release_v1 *zwp_linux_buffer_release_v1,
483 int32_t fence);
484 /**
485 * release buffer immediately
486 *
487 * Sent when the compositor has finalised its usage of the
488 * associated buffer for the relevant commit, and either performed
489 * no operations using it, or has a guarantee that all its
490 * operations on that buffer for that commit have finished.
491 *
492 * Once this event is received, and assuming the associated buffer
493 * is not pending release from other wl_surface.commit requests, no
494 * additional explicit or implicit synchronization is required to
495 * safely reuse or destroy the buffer.
496 *
497 * This event destroys the zwp_linux_buffer_release_v1 object.
498 */
499 void (*immediate_release)(void *data,
500 struct zwp_linux_buffer_release_v1 *zwp_linux_buffer_release_v1);
501 };
502
503 /**
504 * @ingroup iface_zwp_linux_buffer_release_v1
505 */
506 static inline int
zwp_linux_buffer_release_v1_add_listener(struct zwp_linux_buffer_release_v1 * zwp_linux_buffer_release_v1,const struct zwp_linux_buffer_release_v1_listener * listener,void * data)507 zwp_linux_buffer_release_v1_add_listener(struct zwp_linux_buffer_release_v1 *zwp_linux_buffer_release_v1,
508 const struct zwp_linux_buffer_release_v1_listener *listener, void *data)
509 {
510 return wl_proxy_add_listener((struct wl_proxy *) zwp_linux_buffer_release_v1,
511 (void (**)(void)) listener, data);
512 }
513
514 /**
515 * @ingroup iface_zwp_linux_buffer_release_v1
516 */
517 #define ZWP_LINUX_BUFFER_RELEASE_V1_FENCED_RELEASE_SINCE_VERSION 1
518 /**
519 * @ingroup iface_zwp_linux_buffer_release_v1
520 */
521 #define ZWP_LINUX_BUFFER_RELEASE_V1_IMMEDIATE_RELEASE_SINCE_VERSION 1
522
523
524 /** @ingroup iface_zwp_linux_buffer_release_v1 */
525 static inline void
zwp_linux_buffer_release_v1_set_user_data(struct zwp_linux_buffer_release_v1 * zwp_linux_buffer_release_v1,void * user_data)526 zwp_linux_buffer_release_v1_set_user_data(struct zwp_linux_buffer_release_v1 *zwp_linux_buffer_release_v1, void *user_data)
527 {
528 wl_proxy_set_user_data((struct wl_proxy *) zwp_linux_buffer_release_v1, user_data);
529 }
530
531 /** @ingroup iface_zwp_linux_buffer_release_v1 */
532 static inline void *
zwp_linux_buffer_release_v1_get_user_data(struct zwp_linux_buffer_release_v1 * zwp_linux_buffer_release_v1)533 zwp_linux_buffer_release_v1_get_user_data(struct zwp_linux_buffer_release_v1 *zwp_linux_buffer_release_v1)
534 {
535 return wl_proxy_get_user_data((struct wl_proxy *) zwp_linux_buffer_release_v1);
536 }
537
538 static inline uint32_t
zwp_linux_buffer_release_v1_get_version(struct zwp_linux_buffer_release_v1 * zwp_linux_buffer_release_v1)539 zwp_linux_buffer_release_v1_get_version(struct zwp_linux_buffer_release_v1 *zwp_linux_buffer_release_v1)
540 {
541 return wl_proxy_get_version((struct wl_proxy *) zwp_linux_buffer_release_v1);
542 }
543
544 /** @ingroup iface_zwp_linux_buffer_release_v1 */
545 static inline void
zwp_linux_buffer_release_v1_destroy(struct zwp_linux_buffer_release_v1 * zwp_linux_buffer_release_v1)546 zwp_linux_buffer_release_v1_destroy(struct zwp_linux_buffer_release_v1 *zwp_linux_buffer_release_v1)
547 {
548 wl_proxy_destroy((struct wl_proxy *) zwp_linux_buffer_release_v1);
549 }
550
551 #ifdef __cplusplus
552 }
553 #endif
554
555 #endif
556