| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <protocol name="commit_timing_v1"> |
| 3 | |
| 4 | <copyright> |
| 5 | Copyright © 2023 Valve Corporation |
| 6 | |
| 7 | Permission is hereby granted, free of charge, to any person obtaining a |
| 8 | copy of this software and associated documentation files (the "Software"), |
| 9 | to deal in the Software without restriction, including without limitation |
| 10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 11 | and/or sell copies of the Software, and to permit persons to whom the |
| 12 | Software is furnished to do so, subject to the following conditions: |
| 13 | |
| 14 | The above copyright notice and this permission notice (including the next |
| 15 | paragraph) shall be included in all copies or substantial portions of the |
| 16 | Software. |
| 17 | |
| 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 21 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 24 | DEALINGS IN THE SOFTWARE. |
| 25 | </copyright> |
| 26 | |
| 27 | <interface name="wp_commit_timing_manager_v1" version="1"> |
| 28 | <description summary="commit timing"> |
| 29 | When a compositor latches on to new content updates it will check for |
| 30 | any number of requirements of the available content updates (such as |
| 31 | fences of all buffers being signalled) to consider the update ready. |
| 32 | |
| 33 | This protocol provides a method for adding a time constraint to surface |
| 34 | content. This constraint indicates to the compositor that a content |
| 35 | update should be presented as closely as possible to, but not before, |
| 36 | a specified time. |
| 37 | |
| 38 | This protocol does not change the Wayland property that content |
| 39 | updates are applied in the order they are received, even when some |
| 40 | content updates contain timestamps and others do not. |
| 41 | |
| 42 | To provide timestamps, this global factory interface must be used to |
| 43 | acquire a wp_commit_timing_v1 object for a surface, which may then be |
| 44 | used to provide timestamp information for commits. |
| 45 | |
| 46 | Warning! The protocol described in this file is currently in the testing |
| 47 | phase. Backward compatible changes may be added together with the |
| 48 | corresponding interface version bump. Backward incompatible changes can |
| 49 | only be done by creating a new major version of the extension. |
| 50 | </description> |
| 51 | <enum name="error"> |
| 52 | <entry name="commit_timer_exists" value="0" |
| 53 | summary="commit timer already exists for surface"/> |
| 54 | </enum> |
| 55 | |
| 56 | <request name="destroy" type="destructor"> |
| 57 | <description summary="unbind from the commit timing interface"> |
| 58 | Informs the server that the client will no longer be using |
| 59 | this protocol object. Existing objects created by this object |
| 60 | are not affected. |
| 61 | </description> |
| 62 | </request> |
| 63 | |
| 64 | <request name="get_timer"> |
| 65 | <description summary="request commit timer interface for surface"> |
| 66 | Establish a timing controller for a surface. |
| 67 | |
| 68 | Only one commit timer can be created for a surface, or a |
| 69 | commit_timer_exists protocol error will be generated. |
| 70 | </description> |
| 71 | <arg name="id" type="new_id" interface="wp_commit_timer_v1"/> |
| 72 | <arg name="surface" type="object" interface="wl_surface"/> |
| 73 | </request> |
| 74 | </interface> |
| 75 | |
| 76 | <interface name="wp_commit_timer_v1" version="1"> |
| 77 | <description summary="Surface commit timer"> |
| 78 | An object to set a time constraint for a content update on a surface. |
| 79 | </description> |
| 80 | |
| 81 | <enum name="error"> |
| 82 | <entry name="invalid_timestamp" value="0" |
| 83 | summary="timestamp contains an invalid value"/> |
| 84 | <entry name="timestamp_exists" value="1" |
| 85 | summary="timestamp exists"/> |
| 86 | <entry name="surface_destroyed" value="2" |
| 87 | summary="the associated surface no longer exists"/> |
| 88 | </enum> |
| 89 | |
| 90 | <request name="set_timestamp"> |
| 91 | <description summary="Specify time the following commit takes effect"> |
| 92 | Provide a timing constraint for a surface content update. |
| 93 | |
| 94 | A set_timestamp request may be made before a wl_surface.commit to |
| 95 | tell the compositor that the content is intended to be presented |
| 96 | as closely as possible to, but not before, the specified time. |
| 97 | The time is in the domain of the compositor's presentation clock. |
| 98 | |
| 99 | An invalid_timestamp error will be generated for invalid tv_nsec. |
| 100 | |
| 101 | If a timestamp already exists on the surface, a timestamp_exists |
| 102 | error is generated. |
| 103 | |
| 104 | Requesting set_timestamp after the commit_timer object's surface is |
| 105 | destroyed will generate a "surface_destroyed" error. |
| 106 | </description> |
| 107 | <arg name="tv_sec_hi" type="uint" |
| 108 | summary="high 32 bits of the seconds part of target time"/> |
| 109 | <arg name="tv_sec_lo" type="uint" |
| 110 | summary="low 32 bits of the seconds part of target time"/> |
| 111 | <arg name="tv_nsec" type="uint" |
| 112 | summary="nanoseconds part of target time"/> |
| 113 | </request> |
| 114 | |
| 115 | <request name="destroy" type="destructor"> |
| 116 | <description summary="Destroy the timer"> |
| 117 | Informs the server that the client will no longer be using |
| 118 | this protocol object. |
| 119 | |
| 120 | Existing timing constraints are not affected by the destruction. |
| 121 | </description> |
| 122 | </request> |
| 123 | </interface> |
| 124 | </protocol> |