| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <protocol name="tearing_control_v1"> |
| 3 | <copyright> |
| 4 | Copyright © 2021 Xaver Hugl |
| 5 | |
| 6 | Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | copy of this software and associated documentation files (the "Software"), |
| 8 | to deal in the Software without restriction, including without limitation |
| 9 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | and/or sell copies of the Software, and to permit persons to whom the |
| 11 | Software is furnished to do so, subject to the following conditions: |
| 12 | |
| 13 | The above copyright notice and this permission notice (including the next |
| 14 | paragraph) shall be included in all copies or substantial portions of the |
| 15 | Software. |
| 16 | |
| 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 23 | DEALINGS IN THE SOFTWARE. |
| 24 | </copyright> |
| 25 | |
| 26 | <interface name="wp_tearing_control_manager_v1" version="1"> |
| 27 | <description summary="protocol for tearing control"> |
| 28 | For some use cases like games or drawing tablets it can make sense to |
| 29 | reduce latency by accepting tearing with the use of asynchronous page |
| 30 | flips. This global is a factory interface, allowing clients to inform |
| 31 | which type of presentation the content of their surfaces is suitable for. |
| 32 | |
| 33 | Graphics APIs like EGL or Vulkan, that manage the buffer queue and commits |
| 34 | of a wl_surface themselves, are likely to be using this extension |
| 35 | internally. If a client is using such an API for a wl_surface, it should |
| 36 | not directly use this extension on that surface, to avoid raising a |
| 37 | tearing_control_exists protocol error. |
| 38 | |
| 39 | Warning! The protocol described in this file is currently in the testing |
| 40 | phase. Backward compatible changes may be added together with the |
| 41 | corresponding interface version bump. Backward incompatible changes can |
| 42 | only be done by creating a new major version of the extension. |
| 43 | </description> |
| 44 | |
| 45 | <request name="destroy" type="destructor"> |
| 46 | <description summary="destroy tearing control factory object"> |
| 47 | Destroy this tearing control factory object. Other objects, including |
| 48 | wp_tearing_control_v1 objects created by this factory, are not affected |
| 49 | by this request. |
| 50 | </description> |
| 51 | </request> |
| 52 | |
| 53 | <enum name="error"> |
| 54 | <entry name="tearing_control_exists" value="0" |
| 55 | summary="the surface already has a tearing object associated"/> |
| 56 | </enum> |
| 57 | |
| 58 | <request name="get_tearing_control"> |
| 59 | <description summary="extend surface interface for tearing control"> |
| 60 | Instantiate an interface extension for the given wl_surface to request |
| 61 | asynchronous page flips for presentation. |
| 62 | |
| 63 | If the given wl_surface already has a wp_tearing_control_v1 object |
| 64 | associated, the tearing_control_exists protocol error is raised. |
| 65 | </description> |
| 66 | <arg name="id" type="new_id" interface="wp_tearing_control_v1"/> |
| 67 | <arg name="surface" type="object" interface="wl_surface"/> |
| 68 | </request> |
| 69 | </interface> |
| 70 | |
| 71 | <interface name="wp_tearing_control_v1" version="1"> |
| 72 | <description summary="per-surface tearing control interface"> |
| 73 | An additional interface to a wl_surface object, which allows the client |
| 74 | to hint to the compositor if the content on the surface is suitable for |
| 75 | presentation with tearing. |
| 76 | The default presentation hint is vsync. See presentation_hint for more |
| 77 | details. |
| 78 | |
| 79 | If the associated wl_surface is destroyed, this object becomes inert and |
| 80 | should be destroyed. |
| 81 | </description> |
| 82 | |
| 83 | <enum name="presentation_hint"> |
| 84 | <description summary="presentation hint values"> |
| 85 | This enum provides information for if submitted frames from the client |
| 86 | may be presented with tearing. |
| 87 | </description> |
| 88 | <entry name="vsync" value="0"> |
| 89 | <description summary="tearing-free presentation"> |
| 90 | The content of this surface is meant to be synchronized to the |
| 91 | vertical blanking period. This should not result in visible tearing |
| 92 | and may result in a delay before a surface commit is presented. |
| 93 | </description> |
| 94 | </entry> |
| 95 | <entry name="async" value="1"> |
| 96 | <description summary="asynchronous presentation"> |
| 97 | The content of this surface is meant to be presented with minimal |
| 98 | latency and tearing is acceptable. |
| 99 | </description> |
| 100 | </entry> |
| 101 | </enum> |
| 102 | |
| 103 | <request name="set_presentation_hint"> |
| 104 | <description summary="set presentation hint"> |
| 105 | Set the presentation hint for the associated wl_surface. This state is |
| 106 | double-buffered, see wl_surface.commit. |
| 107 | |
| 108 | The compositor is free to dynamically respect or ignore this hint based |
| 109 | on various conditions like hardware capabilities, surface state and |
| 110 | user preferences. |
| 111 | </description> |
| 112 | <arg name="hint" type="uint" enum="presentation_hint"/> |
| 113 | </request> |
| 114 | |
| 115 | <request name="destroy" type="destructor"> |
| 116 | <description summary="destroy tearing control object"> |
| 117 | Destroy this surface tearing object and revert the presentation hint to |
| 118 | vsync. The change will be applied on the next wl_surface.commit. |
| 119 | </description> |
| 120 | </request> |
| 121 | </interface> |
| 122 | |
| 123 | </protocol> |