1
0

linux-dmabuf-server-protocol.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996
  1. /* Generated by wayland-scanner 1.26.0 */
  2. #ifndef LINUX_DMABUF_V1_SERVER_PROTOCOL_H
  3. #define LINUX_DMABUF_V1_SERVER_PROTOCOL_H
  4. #include <stdint.h>
  5. #include <stddef.h>
  6. #include "wayland-server.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. struct wl_client;
  11. struct wl_resource;
  12. /**
  13. * @page page_linux_dmabuf_v1 The linux_dmabuf_v1 protocol
  14. * @section page_ifaces_linux_dmabuf_v1 Interfaces
  15. * - @subpage page_iface_zwp_linux_dmabuf_v1 - factory for creating dmabuf-based wl_buffers
  16. * - @subpage page_iface_zwp_linux_buffer_params_v1 - parameters for creating a dmabuf-based wl_buffer
  17. * - @subpage page_iface_zwp_linux_dmabuf_feedback_v1 - dmabuf feedback
  18. * @section page_copyright_linux_dmabuf_v1 Copyright
  19. * <pre>
  20. *
  21. * Copyright © 2014, 2015 Collabora, Ltd.
  22. *
  23. * Permission is hereby granted, free of charge, to any person obtaining a
  24. * copy of this software and associated documentation files (the "Software"),
  25. * to deal in the Software without restriction, including without limitation
  26. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  27. * and/or sell copies of the Software, and to permit persons to whom the
  28. * Software is furnished to do so, subject to the following conditions:
  29. *
  30. * The above copyright notice and this permission notice (including the next
  31. * paragraph) shall be included in all copies or substantial portions of the
  32. * Software.
  33. *
  34. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  35. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  36. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  37. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  38. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  39. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  40. * DEALINGS IN THE SOFTWARE.
  41. * </pre>
  42. */
  43. struct wl_buffer;
  44. struct wl_surface;
  45. struct zwp_linux_buffer_params_v1;
  46. struct zwp_linux_dmabuf_feedback_v1;
  47. struct zwp_linux_dmabuf_v1;
  48. #ifndef ZWP_LINUX_DMABUF_V1_INTERFACE
  49. #define ZWP_LINUX_DMABUF_V1_INTERFACE
  50. /**
  51. * @page page_iface_zwp_linux_dmabuf_v1 zwp_linux_dmabuf_v1
  52. * @section page_iface_zwp_linux_dmabuf_v1_desc Description
  53. *
  54. * This interface offers ways to create generic dmabuf-based wl_buffers.
  55. *
  56. * For more information about dmabuf, see:
  57. * https://www.kernel.org/doc/html/next/userspace-api/dma-buf-alloc-exchange.html
  58. *
  59. * Clients can use the get_surface_feedback request to get dmabuf feedback
  60. * for a particular surface. If the client wants to retrieve feedback not
  61. * tied to a surface, they can use the get_default_feedback request.
  62. *
  63. * The following are required from clients:
  64. *
  65. * - Clients must ensure that either all data in the dma-buf is
  66. * coherent for all subsequent read access or that coherency is
  67. * correctly handled by the underlying kernel-side dma-buf
  68. * implementation.
  69. *
  70. * - Don't make any more attachments after sending the buffer to the
  71. * compositor. Making more attachments later increases the risk of
  72. * the compositor not being able to use (re-import) an existing
  73. * dmabuf-based wl_buffer.
  74. *
  75. * The underlying graphics stack must ensure the following:
  76. *
  77. * - The dmabuf file descriptors relayed to the server will stay valid
  78. * for the whole lifetime of the wl_buffer. This means the server may
  79. * at any time use those fds to import the dmabuf into any kernel
  80. * sub-system that might accept it.
  81. *
  82. * However, when the underlying graphics stack fails to deliver the
  83. * promise, because of e.g. a device hot-unplug which raises internal
  84. * errors, after the wl_buffer has been successfully created the
  85. * compositor must not raise protocol errors to the client when dmabuf
  86. * import later fails.
  87. *
  88. * To create a wl_buffer from one or more dmabufs, a client creates a
  89. * zwp_linux_buffer_params_v1 object with a zwp_linux_dmabuf_v1.create_params
  90. * request. All planes required by the intended format are added with
  91. * the 'add' request. Finally, a 'create' or 'create_immed' request is
  92. * issued, which has the following outcome depending on the import success.
  93. *
  94. * The 'create' request,
  95. * - on success, triggers a 'created' event which provides the final
  96. * wl_buffer to the client.
  97. * - on failure, triggers a 'failed' event to convey that the server
  98. * cannot use the dmabufs received from the client.
  99. *
  100. * For the 'create_immed' request,
  101. * - on success, the server immediately imports the added dmabufs to
  102. * create a wl_buffer. No event is sent from the server in this case.
  103. * - on failure, the server can choose to either:
  104. * - terminate the client by raising a fatal error.
  105. * - mark the wl_buffer as failed, and send a 'failed' event to the
  106. * client. If the client uses a failed wl_buffer as an argument to any
  107. * request, the behaviour is compositor implementation-defined.
  108. *
  109. * For all DRM formats and unless specified in another protocol extension,
  110. * pre-multiplied alpha is used for pixel values.
  111. *
  112. * Unless specified otherwise in another protocol extension, implicit
  113. * synchronization is used. In other words, compositors and clients must
  114. * wait and signal fences implicitly passed via the DMA-BUF's reservation
  115. * mechanism.
  116. * @section page_iface_zwp_linux_dmabuf_v1_api API
  117. * See @ref iface_zwp_linux_dmabuf_v1.
  118. */
  119. /**
  120. * @defgroup iface_zwp_linux_dmabuf_v1 The zwp_linux_dmabuf_v1 interface
  121. *
  122. * This interface offers ways to create generic dmabuf-based wl_buffers.
  123. *
  124. * For more information about dmabuf, see:
  125. * https://www.kernel.org/doc/html/next/userspace-api/dma-buf-alloc-exchange.html
  126. *
  127. * Clients can use the get_surface_feedback request to get dmabuf feedback
  128. * for a particular surface. If the client wants to retrieve feedback not
  129. * tied to a surface, they can use the get_default_feedback request.
  130. *
  131. * The following are required from clients:
  132. *
  133. * - Clients must ensure that either all data in the dma-buf is
  134. * coherent for all subsequent read access or that coherency is
  135. * correctly handled by the underlying kernel-side dma-buf
  136. * implementation.
  137. *
  138. * - Don't make any more attachments after sending the buffer to the
  139. * compositor. Making more attachments later increases the risk of
  140. * the compositor not being able to use (re-import) an existing
  141. * dmabuf-based wl_buffer.
  142. *
  143. * The underlying graphics stack must ensure the following:
  144. *
  145. * - The dmabuf file descriptors relayed to the server will stay valid
  146. * for the whole lifetime of the wl_buffer. This means the server may
  147. * at any time use those fds to import the dmabuf into any kernel
  148. * sub-system that might accept it.
  149. *
  150. * However, when the underlying graphics stack fails to deliver the
  151. * promise, because of e.g. a device hot-unplug which raises internal
  152. * errors, after the wl_buffer has been successfully created the
  153. * compositor must not raise protocol errors to the client when dmabuf
  154. * import later fails.
  155. *
  156. * To create a wl_buffer from one or more dmabufs, a client creates a
  157. * zwp_linux_buffer_params_v1 object with a zwp_linux_dmabuf_v1.create_params
  158. * request. All planes required by the intended format are added with
  159. * the 'add' request. Finally, a 'create' or 'create_immed' request is
  160. * issued, which has the following outcome depending on the import success.
  161. *
  162. * The 'create' request,
  163. * - on success, triggers a 'created' event which provides the final
  164. * wl_buffer to the client.
  165. * - on failure, triggers a 'failed' event to convey that the server
  166. * cannot use the dmabufs received from the client.
  167. *
  168. * For the 'create_immed' request,
  169. * - on success, the server immediately imports the added dmabufs to
  170. * create a wl_buffer. No event is sent from the server in this case.
  171. * - on failure, the server can choose to either:
  172. * - terminate the client by raising a fatal error.
  173. * - mark the wl_buffer as failed, and send a 'failed' event to the
  174. * client. If the client uses a failed wl_buffer as an argument to any
  175. * request, the behaviour is compositor implementation-defined.
  176. *
  177. * For all DRM formats and unless specified in another protocol extension,
  178. * pre-multiplied alpha is used for pixel values.
  179. *
  180. * Unless specified otherwise in another protocol extension, implicit
  181. * synchronization is used. In other words, compositors and clients must
  182. * wait and signal fences implicitly passed via the DMA-BUF's reservation
  183. * mechanism.
  184. */
  185. extern const struct wl_interface zwp_linux_dmabuf_v1_interface;
  186. #endif
  187. #ifndef ZWP_LINUX_BUFFER_PARAMS_V1_INTERFACE
  188. #define ZWP_LINUX_BUFFER_PARAMS_V1_INTERFACE
  189. /**
  190. * @page page_iface_zwp_linux_buffer_params_v1 zwp_linux_buffer_params_v1
  191. * @section page_iface_zwp_linux_buffer_params_v1_desc Description
  192. *
  193. * This temporary object is a collection of dmabufs and other
  194. * parameters that together form a single logical buffer. The temporary
  195. * object may eventually create one wl_buffer unless cancelled by
  196. * destroying it before requesting 'create'.
  197. *
  198. * Single-planar formats only require one dmabuf, however
  199. * multi-planar formats may require more than one dmabuf. For all
  200. * formats, an 'add' request must be called once per plane (even if the
  201. * underlying dmabuf fd is identical).
  202. *
  203. * You must use consecutive plane indices ('plane_idx' argument for 'add')
  204. * from zero to the number of planes used by the drm_fourcc format code.
  205. * All planes required by the format must be given exactly once, but can
  206. * be given in any order. Each plane index can only be set once; subsequent
  207. * calls with a plane index which has already been set will result in a
  208. * plane_set error being generated.
  209. * @section page_iface_zwp_linux_buffer_params_v1_api API
  210. * See @ref iface_zwp_linux_buffer_params_v1.
  211. */
  212. /**
  213. * @defgroup iface_zwp_linux_buffer_params_v1 The zwp_linux_buffer_params_v1 interface
  214. *
  215. * This temporary object is a collection of dmabufs and other
  216. * parameters that together form a single logical buffer. The temporary
  217. * object may eventually create one wl_buffer unless cancelled by
  218. * destroying it before requesting 'create'.
  219. *
  220. * Single-planar formats only require one dmabuf, however
  221. * multi-planar formats may require more than one dmabuf. For all
  222. * formats, an 'add' request must be called once per plane (even if the
  223. * underlying dmabuf fd is identical).
  224. *
  225. * You must use consecutive plane indices ('plane_idx' argument for 'add')
  226. * from zero to the number of planes used by the drm_fourcc format code.
  227. * All planes required by the format must be given exactly once, but can
  228. * be given in any order. Each plane index can only be set once; subsequent
  229. * calls with a plane index which has already been set will result in a
  230. * plane_set error being generated.
  231. */
  232. extern const struct wl_interface zwp_linux_buffer_params_v1_interface;
  233. #endif
  234. #ifndef ZWP_LINUX_DMABUF_FEEDBACK_V1_INTERFACE
  235. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_INTERFACE
  236. /**
  237. * @page page_iface_zwp_linux_dmabuf_feedback_v1 zwp_linux_dmabuf_feedback_v1
  238. * @section page_iface_zwp_linux_dmabuf_feedback_v1_desc Description
  239. *
  240. * This object advertises dmabuf parameters feedback. This includes the
  241. * preferred devices and the supported formats/modifiers.
  242. *
  243. * The parameters are sent once when this object is created and whenever they
  244. * change. The done event is always sent once after all parameters have been
  245. * sent. When a single parameter changes, all parameters are re-sent by the
  246. * compositor.
  247. *
  248. * Compositors can re-send the parameters when the current client buffer
  249. * allocations are sub-optimal. Compositors should not re-send the
  250. * parameters if re-allocating the buffers would not result in a more optimal
  251. * configuration. In particular, compositors should avoid sending the exact
  252. * same parameters multiple times in a row.
  253. *
  254. * The tranche_target_device and tranche_formats events are grouped by
  255. * tranches of preference. For each tranche, a tranche_target_device, one
  256. * tranche_flags and one or more tranche_formats events are sent, followed
  257. * by a tranche_done event finishing the list. The tranches are sent in
  258. * descending order of preference. All formats and modifiers in the same
  259. * tranche have the same preference.
  260. *
  261. * To send parameters, the compositor sends one main_device event (unless
  262. * the client bound version 6 or above), tranches (each consisting of one
  263. * tranche_target_device event, one tranche_flags event, tranche_formats
  264. * events and then a tranche_done event), then one done event.
  265. *
  266. * With version 6 and above, the compositor must always advertise at least
  267. * one tranche with the sampling flag set.
  268. *
  269. * The compositor sends a format_table event at least once for each dmabuf
  270. * parameters feedback object, before any tranche events. Unless the format
  271. * table contents change later, the compositor is free not to send another
  272. * format_table event for the same dmabuf parameters feedback object.
  273. * @section page_iface_zwp_linux_dmabuf_feedback_v1_api API
  274. * See @ref iface_zwp_linux_dmabuf_feedback_v1.
  275. */
  276. /**
  277. * @defgroup iface_zwp_linux_dmabuf_feedback_v1 The zwp_linux_dmabuf_feedback_v1 interface
  278. *
  279. * This object advertises dmabuf parameters feedback. This includes the
  280. * preferred devices and the supported formats/modifiers.
  281. *
  282. * The parameters are sent once when this object is created and whenever they
  283. * change. The done event is always sent once after all parameters have been
  284. * sent. When a single parameter changes, all parameters are re-sent by the
  285. * compositor.
  286. *
  287. * Compositors can re-send the parameters when the current client buffer
  288. * allocations are sub-optimal. Compositors should not re-send the
  289. * parameters if re-allocating the buffers would not result in a more optimal
  290. * configuration. In particular, compositors should avoid sending the exact
  291. * same parameters multiple times in a row.
  292. *
  293. * The tranche_target_device and tranche_formats events are grouped by
  294. * tranches of preference. For each tranche, a tranche_target_device, one
  295. * tranche_flags and one or more tranche_formats events are sent, followed
  296. * by a tranche_done event finishing the list. The tranches are sent in
  297. * descending order of preference. All formats and modifiers in the same
  298. * tranche have the same preference.
  299. *
  300. * To send parameters, the compositor sends one main_device event (unless
  301. * the client bound version 6 or above), tranches (each consisting of one
  302. * tranche_target_device event, one tranche_flags event, tranche_formats
  303. * events and then a tranche_done event), then one done event.
  304. *
  305. * With version 6 and above, the compositor must always advertise at least
  306. * one tranche with the sampling flag set.
  307. *
  308. * The compositor sends a format_table event at least once for each dmabuf
  309. * parameters feedback object, before any tranche events. Unless the format
  310. * table contents change later, the compositor is free not to send another
  311. * format_table event for the same dmabuf parameters feedback object.
  312. */
  313. extern const struct wl_interface zwp_linux_dmabuf_feedback_v1_interface;
  314. #endif
  315. /**
  316. * @ingroup iface_zwp_linux_dmabuf_v1
  317. * @struct zwp_linux_dmabuf_v1_interface
  318. */
  319. struct zwp_linux_dmabuf_v1_interface {
  320. /**
  321. * unbind the factory
  322. *
  323. * Objects created through this interface, especially wl_buffers,
  324. * will remain valid.
  325. */
  326. void (*destroy)(struct wl_client *client,
  327. struct wl_resource *resource);
  328. /**
  329. * create a temporary object for buffer parameters
  330. *
  331. * This temporary object is used to collect multiple dmabuf
  332. * handles into a single batch to create a wl_buffer. It can only
  333. * be used once and should be destroyed after a 'created' or
  334. * 'failed' event has been received.
  335. * @param params_id id for the newly created zwp_linux_buffer_params_v1
  336. */
  337. void (*create_params)(struct wl_client *client,
  338. struct wl_resource *resource,
  339. uint32_t params_id);
  340. /**
  341. * get default feedback
  342. *
  343. * This request creates a new zwp_linux_dmabuf_feedback_v1 object
  344. * not bound to a particular surface. This object will deliver
  345. * feedback about dmabuf parameters to use if the client doesn't
  346. * support per-surface feedback (see get_surface_feedback).
  347. * @since 4
  348. */
  349. void (*get_default_feedback)(struct wl_client *client,
  350. struct wl_resource *resource,
  351. uint32_t id);
  352. /**
  353. * get feedback for a surface
  354. *
  355. * This request creates a new zwp_linux_dmabuf_feedback_v1 object
  356. * for the specified wl_surface. This object will deliver feedback
  357. * about dmabuf parameters to use for buffers attached to this
  358. * surface.
  359. *
  360. * If the surface is destroyed before the
  361. * zwp_linux_dmabuf_feedback_v1 object, the feedback object becomes
  362. * inert.
  363. * @since 4
  364. */
  365. void (*get_surface_feedback)(struct wl_client *client,
  366. struct wl_resource *resource,
  367. uint32_t id,
  368. struct wl_resource *surface);
  369. };
  370. #define ZWP_LINUX_DMABUF_V1_FORMAT 0
  371. #define ZWP_LINUX_DMABUF_V1_MODIFIER 1
  372. /**
  373. * @ingroup iface_zwp_linux_dmabuf_v1
  374. */
  375. #define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1
  376. /**
  377. * @ingroup iface_zwp_linux_dmabuf_v1
  378. */
  379. #define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION 3
  380. /**
  381. * @ingroup iface_zwp_linux_dmabuf_v1
  382. */
  383. #define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1
  384. /**
  385. * @ingroup iface_zwp_linux_dmabuf_v1
  386. */
  387. #define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1
  388. /**
  389. * @ingroup iface_zwp_linux_dmabuf_v1
  390. */
  391. #define ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION 4
  392. /**
  393. * @ingroup iface_zwp_linux_dmabuf_v1
  394. */
  395. #define ZWP_LINUX_DMABUF_V1_GET_SURFACE_FEEDBACK_SINCE_VERSION 4
  396. /**
  397. * @ingroup iface_zwp_linux_dmabuf_v1
  398. * Sends an format event to the client owning the resource.
  399. * @param resource_ The client's resource
  400. * @param format DRM_FORMAT code
  401. */
  402. static inline void
  403. zwp_linux_dmabuf_v1_send_format(struct wl_resource *resource_, uint32_t format)
  404. {
  405. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_FORMAT, format);
  406. }
  407. /**
  408. * @ingroup iface_zwp_linux_dmabuf_v1
  409. * Sends an modifier event to the client owning the resource.
  410. * @param resource_ The client's resource
  411. * @param format DRM_FORMAT code
  412. * @param modifier_hi high 32 bits of layout modifier
  413. * @param modifier_lo low 32 bits of layout modifier
  414. */
  415. static inline void
  416. zwp_linux_dmabuf_v1_send_modifier(struct wl_resource *resource_, uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo)
  417. {
  418. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_MODIFIER, format, modifier_hi, modifier_lo);
  419. }
  420. #ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
  421. #define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
  422. enum zwp_linux_buffer_params_v1_error {
  423. /**
  424. * the zwp_linux_buffer_params_v1 object has already been used to create a wl_buffer
  425. */
  426. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED = 0,
  427. /**
  428. * plane index out of bounds
  429. */
  430. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX = 1,
  431. /**
  432. * the plane index was already set
  433. */
  434. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET = 2,
  435. /**
  436. * missing or too many planes to create a buffer
  437. */
  438. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE = 3,
  439. /**
  440. * format not supported
  441. */
  442. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT = 4,
  443. /**
  444. * invalid width or height
  445. */
  446. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS = 5,
  447. /**
  448. * offset + stride * height goes out of dmabuf bounds
  449. */
  450. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6,
  451. /**
  452. * invalid wl_buffer resulted from importing dmabufs via the create_immed request on given buffer_params
  453. */
  454. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER = 7,
  455. /**
  456. * an array with mismatching size for a dev_t was used
  457. */
  458. ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DEV_T_SIZE = 8,
  459. };
  460. #endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */
  461. #ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM_IS_VALID
  462. #define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM_IS_VALID
  463. /**
  464. * @ingroup iface_zwp_linux_buffer_params_v1
  465. * Validate a zwp_linux_buffer_params_v1 error value.
  466. *
  467. * @return true on success, false on error.
  468. * @ref zwp_linux_buffer_params_v1_error
  469. */
  470. static inline bool
  471. zwp_linux_buffer_params_v1_error_is_valid(uint32_t value, uint32_t version) {
  472. switch (value) {
  473. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED:
  474. return version >= 1;
  475. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX:
  476. return version >= 1;
  477. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET:
  478. return version >= 1;
  479. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE:
  480. return version >= 1;
  481. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT:
  482. return version >= 1;
  483. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS:
  484. return version >= 1;
  485. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS:
  486. return version >= 1;
  487. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER:
  488. return version >= 1;
  489. case ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DEV_T_SIZE:
  490. return version >= 1;
  491. default:
  492. return false;
  493. }
  494. }
  495. #endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM_IS_VALID */
  496. #ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
  497. #define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
  498. enum zwp_linux_buffer_params_v1_flags {
  499. /**
  500. * contents are y-inverted
  501. */
  502. ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT = 1,
  503. /**
  504. * content is interlaced
  505. */
  506. ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED = 2,
  507. /**
  508. * bottom field first
  509. */
  510. ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST = 4,
  511. };
  512. #endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM */
  513. #ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM_IS_VALID
  514. #define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM_IS_VALID
  515. /**
  516. * @ingroup iface_zwp_linux_buffer_params_v1
  517. * Validate a zwp_linux_buffer_params_v1 flags value.
  518. *
  519. * @return true on success, false on error.
  520. * @ref zwp_linux_buffer_params_v1_flags
  521. */
  522. static inline bool
  523. zwp_linux_buffer_params_v1_flags_is_valid(uint32_t value, uint32_t version) {
  524. uint32_t valid = 0;
  525. if (version >= 1)
  526. valid |= ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT;
  527. if (version >= 1)
  528. valid |= ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED;
  529. if (version >= 1)
  530. valid |= ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST;
  531. return (value & ~valid) == 0;
  532. }
  533. #endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM_IS_VALID */
  534. /**
  535. * @ingroup iface_zwp_linux_buffer_params_v1
  536. * @struct zwp_linux_buffer_params_v1_interface
  537. */
  538. struct zwp_linux_buffer_params_v1_interface {
  539. /**
  540. * delete this object, used or not
  541. *
  542. * Cleans up the temporary data sent to the server for
  543. * dmabuf-based wl_buffer creation.
  544. */
  545. void (*destroy)(struct wl_client *client,
  546. struct wl_resource *resource);
  547. /**
  548. * add a dmabuf to the temporary set
  549. *
  550. * This request adds one dmabuf to the set in this
  551. * zwp_linux_buffer_params_v1.
  552. *
  553. * The 64-bit unsigned value combined from modifier_hi and
  554. * modifier_lo is the dmabuf layout modifier. DRM AddFB2 ioctl
  555. * calls this the fb modifier, which is defined in drm_mode.h of
  556. * Linux UAPI. This is an opaque token. Drivers use this token to
  557. * express tiling, compression, etc. driver-specific modifications
  558. * to the base format defined by the DRM fourcc code.
  559. *
  560. * Starting from version 4, the invalid_format protocol error is
  561. * sent if the format + modifier pair was not advertised as
  562. * supported.
  563. *
  564. * Starting from version 5, the invalid_format protocol error is
  565. * sent if all planes don't use the same modifier.
  566. *
  567. * This request raises the PLANE_IDX error if plane_idx is too
  568. * large. The error PLANE_SET is raised if attempting to set a
  569. * plane that was already set.
  570. * @param fd dmabuf fd
  571. * @param plane_idx plane index
  572. * @param offset offset in bytes
  573. * @param stride stride in bytes
  574. * @param modifier_hi high 32 bits of layout modifier
  575. * @param modifier_lo low 32 bits of layout modifier
  576. */
  577. void (*add)(struct wl_client *client,
  578. struct wl_resource *resource,
  579. int32_t fd,
  580. uint32_t plane_idx,
  581. uint32_t offset,
  582. uint32_t stride,
  583. uint32_t modifier_hi,
  584. uint32_t modifier_lo);
  585. /**
  586. * create a wl_buffer from the given dmabufs
  587. *
  588. * This asks for creation of a wl_buffer from the added dmabuf
  589. * buffers. The wl_buffer is not created immediately but returned
  590. * via the 'created' event if the dmabuf sharing succeeds. The
  591. * sharing may fail at runtime for reasons a client cannot predict,
  592. * in which case the 'failed' event is triggered.
  593. *
  594. * The 'format' argument is a DRM_FORMAT code, as defined by the
  595. * libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the
  596. * authoritative source on how the format codes should work.
  597. *
  598. * The 'flags' is a bitfield of the flags defined in enum "flags".
  599. * 'y_invert' means that the image needs to be y-flipped.
  600. *
  601. * Flag 'interlaced' means that the frame in the buffer is not
  602. * progressive as usual, but interlaced. An interlaced buffer as
  603. * supported here must always contain both top and bottom fields.
  604. * The top field always begins on the first pixel row. The temporal
  605. * ordering between the two fields is top field first, unless
  606. * 'bottom_first' is specified. It is undefined whether
  607. * 'bottom_first' is ignored if 'interlaced' is not set.
  608. *
  609. * This protocol does not convey any information about field rate,
  610. * duration, or timing, other than the relative ordering between
  611. * the two fields in one buffer. A compositor may have to estimate
  612. * the intended field rate from the incoming buffer rate. It is
  613. * undefined whether the time of receiving wl_surface.commit with a
  614. * new buffer attached, applying the wl_surface state,
  615. * wl_surface.frame callback trigger, presentation, or any other
  616. * point in the compositor cycle is used to measure the frame or
  617. * field times. There is no support for detecting missed or late
  618. * frames/fields/buffers either, and there is no support whatsoever
  619. * for cooperating with interlaced compositor output.
  620. *
  621. * The composited image quality resulting from the use of
  622. * interlaced buffers is explicitly undefined. A compositor may use
  623. * elaborate hardware features or software to deinterlace and
  624. * create progressive output frames from a sequence of interlaced
  625. * input buffers, or it may produce substandard image quality.
  626. * However, compositors that cannot guarantee reasonable image
  627. * quality in all cases are recommended to just reject all
  628. * interlaced buffers.
  629. *
  630. * Any argument errors, including non-positive width or height,
  631. * mismatch between the number of planes and the format, bad
  632. * format, bad offset or stride, may be indicated by fatal protocol
  633. * errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,
  634. * OUT_OF_BOUNDS.
  635. *
  636. * Dmabuf import errors in the server that are not obvious client
  637. * bugs are returned via the 'failed' event as non-fatal. This
  638. * allows attempting dmabuf sharing and falling back in the client
  639. * if it fails.
  640. *
  641. * This request can be sent only once in the object's lifetime,
  642. * after which the only legal request is destroy. This object
  643. * should be destroyed after issuing a 'create' request. Attempting
  644. * to use this object after issuing 'create' raises the
  645. * ALREADY_USED protocol error.
  646. *
  647. * It is not mandatory to issue 'create'. If a client wants to
  648. * cancel the buffer creation, it can just destroy this object.
  649. * @param width base plane width in pixels
  650. * @param height base plane height in pixels
  651. * @param format DRM_FORMAT code
  652. * @param flags see enum flags
  653. */
  654. void (*create)(struct wl_client *client,
  655. struct wl_resource *resource,
  656. int32_t width,
  657. int32_t height,
  658. uint32_t format,
  659. uint32_t flags);
  660. /**
  661. * immediately create a wl_buffer from the given dmabufs
  662. *
  663. * This asks for immediate creation of a wl_buffer by importing
  664. * the added dmabufs.
  665. *
  666. * In case of import success, no event is sent from the server, and
  667. * the wl_buffer is ready to be used by the client.
  668. *
  669. * Upon import failure, either of the following may happen, as seen
  670. * fit by the implementation: - the client is terminated with one
  671. * of the following fatal protocol errors: - INCOMPLETE,
  672. * INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS, in case of
  673. * argument errors such as mismatch between the number of planes
  674. * and the format, bad format, non-positive width or height, or bad
  675. * offset or stride. - INVALID_WL_BUFFER, in case the cause for
  676. * failure is unknown or platform specific. - the server creates an
  677. * invalid wl_buffer, marks it as failed and sends a 'failed' event
  678. * to the client. The result of using this invalid wl_buffer as an
  679. * argument in any request by the client is defined by the
  680. * compositor implementation.
  681. *
  682. * This takes the same arguments as a 'create' request, and obeys
  683. * the same restrictions.
  684. * @param buffer_id id for the newly created wl_buffer
  685. * @param width base plane width in pixels
  686. * @param height base plane height in pixels
  687. * @param format DRM_FORMAT code
  688. * @param flags see enum flags
  689. * @since 2
  690. */
  691. void (*create_immed)(struct wl_client *client,
  692. struct wl_resource *resource,
  693. uint32_t buffer_id,
  694. int32_t width,
  695. int32_t height,
  696. uint32_t format,
  697. uint32_t flags);
  698. /**
  699. * set the target device of the wl_buffer
  700. *
  701. * Set the device the compositor should import the dmabufs to for
  702. * sampling in the next create or create_immed request.
  703. *
  704. * To avoid race conditions when the compositor removes a device
  705. * from the tranches, it is not a protocol error if the device
  706. * hasn't been advertised by the compositor in a tranche with the
  707. * sampling flag, but the import is likely to fail in that case.
  708. *
  709. * If the client doesn't know a suitable target device, it
  710. * shouldn't set one, and the compositor should attempt import on
  711. * all devices it supports.
  712. *
  713. * If the array is too small to contain a dev_t or larger than
  714. * required, the invalid_dev_t_size error will be emitted.
  715. * @param device device dev_t value
  716. * @since 6
  717. */
  718. void (*set_sampling_device)(struct wl_client *client,
  719. struct wl_resource *resource,
  720. struct wl_array *device);
  721. };
  722. #define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED 0
  723. #define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED 1
  724. /**
  725. * @ingroup iface_zwp_linux_buffer_params_v1
  726. */
  727. #define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1
  728. /**
  729. * @ingroup iface_zwp_linux_buffer_params_v1
  730. */
  731. #define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1
  732. /**
  733. * @ingroup iface_zwp_linux_buffer_params_v1
  734. */
  735. #define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1
  736. /**
  737. * @ingroup iface_zwp_linux_buffer_params_v1
  738. */
  739. #define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1
  740. /**
  741. * @ingroup iface_zwp_linux_buffer_params_v1
  742. */
  743. #define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1
  744. /**
  745. * @ingroup iface_zwp_linux_buffer_params_v1
  746. */
  747. #define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED_SINCE_VERSION 2
  748. /**
  749. * @ingroup iface_zwp_linux_buffer_params_v1
  750. */
  751. #define ZWP_LINUX_BUFFER_PARAMS_V1_SET_SAMPLING_DEVICE_SINCE_VERSION 6
  752. /**
  753. * @ingroup iface_zwp_linux_buffer_params_v1
  754. * Sends an created event to the client owning the resource.
  755. * @param resource_ The client's resource
  756. * @param buffer id for the the newly created wl_buffer
  757. */
  758. static inline void
  759. zwp_linux_buffer_params_v1_send_created(struct wl_resource *resource_, struct wl_resource *buffer)
  760. {
  761. wl_resource_post_event(resource_, ZWP_LINUX_BUFFER_PARAMS_V1_CREATED, buffer);
  762. }
  763. /**
  764. * @ingroup iface_zwp_linux_buffer_params_v1
  765. * Sends an failed event to the client owning the resource.
  766. * @param resource_ The client's resource
  767. */
  768. static inline void
  769. zwp_linux_buffer_params_v1_send_failed(struct wl_resource *resource_)
  770. {
  771. wl_resource_post_event(resource_, ZWP_LINUX_BUFFER_PARAMS_V1_FAILED);
  772. }
  773. #ifndef ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM
  774. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM
  775. enum zwp_linux_dmabuf_feedback_v1_tranche_flags {
  776. /**
  777. * direct scan-out tranche
  778. *
  779. * The scanout flag is a hint that direct scan-out may be
  780. * attempted by the compositor on the target device if the client
  781. * appropriately allocates a buffer. How to allocate a buffer that
  782. * can be scanned out on the target device is
  783. * implementation-defined.
  784. * @since 4
  785. */
  786. ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT = 1,
  787. /**
  788. * sampling tranche
  789. *
  790. * The sampling flag describes that the compositor is able to
  791. * efficiently sample from buffers imported to the target device if
  792. * the client appropriately allocates a buffer. How to allocate a
  793. * buffer that can be efficiently sampled on the target device is
  794. * implementation defined.
  795. * @since 6
  796. */
  797. ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SAMPLING = 2,
  798. };
  799. /**
  800. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  801. */
  802. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT_SINCE_VERSION 4
  803. /**
  804. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  805. */
  806. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SAMPLING_SINCE_VERSION 6
  807. #endif /* ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM */
  808. #ifndef ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM_IS_VALID
  809. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM_IS_VALID
  810. /**
  811. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  812. * Validate a zwp_linux_dmabuf_feedback_v1 tranche_flags value.
  813. *
  814. * @return true on success, false on error.
  815. * @ref zwp_linux_dmabuf_feedback_v1_tranche_flags
  816. */
  817. static inline bool
  818. zwp_linux_dmabuf_feedback_v1_tranche_flags_is_valid(uint32_t value, uint32_t version) {
  819. uint32_t valid = 0;
  820. if (version >= 4)
  821. valid |= ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT;
  822. if (version >= 6)
  823. valid |= ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SAMPLING;
  824. return (value & ~valid) == 0;
  825. }
  826. #endif /* ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM_IS_VALID */
  827. /**
  828. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  829. * @struct zwp_linux_dmabuf_feedback_v1_interface
  830. */
  831. struct zwp_linux_dmabuf_feedback_v1_interface {
  832. /**
  833. * destroy the feedback object
  834. *
  835. * Using this request a client can tell the server that it is not
  836. * going to use the zwp_linux_dmabuf_feedback_v1 object anymore.
  837. */
  838. void (*destroy)(struct wl_client *client,
  839. struct wl_resource *resource);
  840. };
  841. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_DONE 0
  842. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_FORMAT_TABLE 1
  843. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_MAIN_DEVICE 2
  844. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_DONE 3
  845. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_TARGET_DEVICE 4
  846. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FORMATS 5
  847. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS 6
  848. /**
  849. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  850. */
  851. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_DONE_SINCE_VERSION 1
  852. /**
  853. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  854. */
  855. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_FORMAT_TABLE_SINCE_VERSION 1
  856. /**
  857. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  858. */
  859. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_MAIN_DEVICE_SINCE_VERSION 1
  860. /**
  861. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  862. */
  863. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_DONE_SINCE_VERSION 1
  864. /**
  865. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  866. */
  867. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_TARGET_DEVICE_SINCE_VERSION 1
  868. /**
  869. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  870. */
  871. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FORMATS_SINCE_VERSION 1
  872. /**
  873. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  874. */
  875. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SINCE_VERSION 1
  876. /**
  877. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  878. */
  879. #define ZWP_LINUX_DMABUF_FEEDBACK_V1_DESTROY_SINCE_VERSION 1
  880. /**
  881. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  882. * Sends an done event to the client owning the resource.
  883. * @param resource_ The client's resource
  884. */
  885. static inline void
  886. zwp_linux_dmabuf_feedback_v1_send_done(struct wl_resource *resource_)
  887. {
  888. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_DONE);
  889. }
  890. /**
  891. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  892. * Sends an format_table event to the client owning the resource.
  893. * @param resource_ The client's resource
  894. * @param fd table file descriptor
  895. * @param size table size, in bytes
  896. */
  897. static inline void
  898. zwp_linux_dmabuf_feedback_v1_send_format_table(struct wl_resource *resource_, int32_t fd, uint32_t size)
  899. {
  900. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_FORMAT_TABLE, fd, size);
  901. }
  902. /**
  903. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  904. * Sends an main_device event to the client owning the resource.
  905. * @param resource_ The client's resource
  906. * @param device device dev_t value
  907. */
  908. static inline void
  909. zwp_linux_dmabuf_feedback_v1_send_main_device(struct wl_resource *resource_, struct wl_array *device)
  910. {
  911. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_MAIN_DEVICE, device);
  912. }
  913. /**
  914. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  915. * Sends an tranche_done event to the client owning the resource.
  916. * @param resource_ The client's resource
  917. */
  918. static inline void
  919. zwp_linux_dmabuf_feedback_v1_send_tranche_done(struct wl_resource *resource_)
  920. {
  921. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_DONE);
  922. }
  923. /**
  924. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  925. * Sends an tranche_target_device event to the client owning the resource.
  926. * @param resource_ The client's resource
  927. * @param device device dev_t value
  928. */
  929. static inline void
  930. zwp_linux_dmabuf_feedback_v1_send_tranche_target_device(struct wl_resource *resource_, struct wl_array *device)
  931. {
  932. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_TARGET_DEVICE, device);
  933. }
  934. /**
  935. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  936. * Sends an tranche_formats event to the client owning the resource.
  937. * @param resource_ The client's resource
  938. * @param indices array of 16-bit indexes
  939. */
  940. static inline void
  941. zwp_linux_dmabuf_feedback_v1_send_tranche_formats(struct wl_resource *resource_, struct wl_array *indices)
  942. {
  943. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FORMATS, indices);
  944. }
  945. /**
  946. * @ingroup iface_zwp_linux_dmabuf_feedback_v1
  947. * Sends an tranche_flags event to the client owning the resource.
  948. * @param resource_ The client's resource
  949. * @param flags tranche flags
  950. */
  951. static inline void
  952. zwp_linux_dmabuf_feedback_v1_send_tranche_flags(struct wl_resource *resource_, uint32_t flags)
  953. {
  954. wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS, flags);
  955. }
  956. #ifdef __cplusplus
  957. }
  958. #endif
  959. #endif