summaryrefslogtreecommitdiff
path: root/src/dri2.xml
blob: 3b4c12e9b97e8eb47ad5b863f3250d4c976d3e5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2005 Jeremy Kolb.
Copyright © 2009 Intel Corporation
All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the names of the authors or their
institutions shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization from the authors.
-->

<xcb header="dri2" extension-xname="DRI2" extension-name="DRI2"
  major-version="1" minor-version="4">
  <import>xproto</import>

  <enum name="Attachment">
    <item name="BufferFrontLeft">      <value>0</value> </item>
    <item name="BufferBackLeft">       <value>1</value> </item>
    <item name="BufferFrontRight">     <value>2</value> </item>
    <item name="BufferBackRight">      <value>3</value> </item>
    <item name="BufferDepth">          <value>4</value> </item>
    <item name="BufferStencil">        <value>5</value> </item>
    <item name="BufferAccum">          <value>6</value> </item>
    <item name="BufferFakeFrontLeft">  <value>7</value> </item>
    <item name="BufferFakeFrontRight"> <value>8</value> </item>
    <item name="BufferDepthStencil">   <value>9</value> </item>
    <item name="BufferHiz">            <value>10</value> </item>
  </enum>

  <enum name="DriverType">
    <item name="DRI">   <value>0</value> </item>
    <item name="VDPAU"> <value>1</value> </item>
  </enum>

  <enum name="EventType">
    <item name="ExchangeComplete"><value>1</value></item>
    <item name="BlitComplete">    <value>2</value></item>
    <item name="FlipComplete">    <value>3</value></item>
  </enum>

  <!-- Types -->

  <struct name="DRI2Buffer">
    <field type="CARD32" name="attachment" enum="Attachment" />
    <field type="CARD32" name="name" />
    <field type="CARD32" name="pitch" />
    <field type="CARD32" name="cpp" />
    <field type="CARD32" name="flags" />
  </struct>

  <struct name="AttachFormat">
    <field type="CARD32" name="attachment" enum="Attachment" />
    <field type="CARD32" name="format" />
  </struct>

  <!-- Requests -->
  <request name="QueryVersion" opcode="0">
    <field type="CARD32" name="major_version" />
    <field type="CARD32" name="minor_version" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="major_version" />
      <field type="CARD32" name="minor_version" />
    </reply>
  </request>

  <request name="Connect" opcode="1">
    <field type="WINDOW" name="window" />
    <field type="CARD32" name="driver_type" enum="DriverType" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="driver_name_length" />
      <field type="CARD32" name="device_name_length" />
      <pad bytes="16" />
      <list type="char" name="driver_name">
        <fieldref>driver_name_length</fieldref>
      </list>
      <list type="void" name="alignment_pad">
	  <op op="-">
	      <op op="&amp;">
		  <op op="+">
		      <fieldref>driver_name_length</fieldref>
		      <value>3</value>
		  </op>
		  <unop op="~">
		      <value>3</value>
		  </unop>
	      </op>
	      <fieldref>driver_name_length</fieldref>
	  </op>
      </list>
      <list type="char" name="device_name">
        <fieldref>device_name_length</fieldref>
      </list>
    </reply>
  </request>

  <request name="Authenticate" opcode="2">
    <field type="WINDOW" name="window" />
    <field type="CARD32" name="magic" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="authenticated" />
    </reply>
  </request>

  <request name="CreateDrawable" opcode="3">
    <field type="DRAWABLE" name="drawable" />
  </request>

  <request name="DestroyDrawable" opcode="4">
    <field type="DRAWABLE" name="drawable" />
  </request>

  <request name="GetBuffers" opcode="5">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="count" />
    <list type="CARD32" name="attachments">
    <!-- The length field should be linked but we can't correct it without breaking API -->
    <!-- <fieldref>count</fieldref> -->
    </list>
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="width" />
      <field type="CARD32" name="height" />
      <field type="CARD32" name="count" />
      <pad bytes="12" />
      <list type="DRI2Buffer" name="buffers">
        <fieldref>count</fieldref>
      </list>
    </reply>
  </request>

  <request name="CopyRegion" opcode="6">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="region" />
    <field type="CARD32" name="dest" />
    <field type="CARD32" name="src" />
    <reply>
      <pad bytes="1" />
    </reply>
  </request>

  <request name="GetBuffersWithFormat" opcode="7">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="count" />
    <list type="AttachFormat" name="attachments">
    <!-- The length field should be linked but we can't correct it without breaking API -->
    <!-- <fieldref>count</fieldref> -->
    </list>
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="width" />
      <field type="CARD32" name="height" />
      <field type="CARD32" name="count" />
      <pad bytes="12" />
      <list type="DRI2Buffer" name="buffers">
        <fieldref>count</fieldref>
      </list>
    </reply>
  </request>

  <!-- Version 1.2 -->

  <request name="SwapBuffers" opcode="8">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="target_msc_hi" />
    <field type="CARD32" name="target_msc_lo" />
    <field type="CARD32" name="divisor_hi" />
    <field type="CARD32" name="divisor_lo" />
    <field type="CARD32" name="remainder_hi" />
    <field type="CARD32" name="remainder_lo" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="swap_hi" />
      <field type="CARD32" name="swap_lo" />
    </reply>
  </request>

  <request name="GetMSC" opcode="9">
    <field type="DRAWABLE" name="drawable" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="ust_hi" />
      <field type="CARD32" name="ust_lo" />
      <field type="CARD32" name="msc_hi" />
      <field type="CARD32" name="msc_lo" />
      <field type="CARD32" name="sbc_hi" />
      <field type="CARD32" name="sbc_lo" />
    </reply>
  </request>

  <request name="WaitMSC" opcode="10">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="target_msc_hi" />
    <field type="CARD32" name="target_msc_lo" />
    <field type="CARD32" name="divisor_hi" />
    <field type="CARD32" name="divisor_lo" />
    <field type="CARD32" name="remainder_hi" />
    <field type="CARD32" name="remainder_lo" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="ust_hi" />
      <field type="CARD32" name="ust_lo" />
      <field type="CARD32" name="msc_hi" />
      <field type="CARD32" name="msc_lo" />
      <field type="CARD32" name="sbc_hi" />
      <field type="CARD32" name="sbc_lo" />
    </reply>
  </request>

  <request name="WaitSBC" opcode="11">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="target_sbc_hi" />
    <field type="CARD32" name="target_sbc_lo" />
    <reply>
      <pad bytes="1" />
      <field type="CARD32" name="ust_hi" />
      <field type="CARD32" name="ust_lo" />
      <field type="CARD32" name="msc_hi" />
      <field type="CARD32" name="msc_lo" />
      <field type="CARD32" name="sbc_hi" />
      <field type="CARD32" name="sbc_lo" />
    </reply>
  </request>

  <request name="SwapInterval" opcode="12">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="interval" />
  </request>

  <!-- Version 1.4 -->

  <request name="GetParam" opcode="13">
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="param" />
    <reply>
      <field type="BOOL" name="is_param_recognized" />
      <field type="CARD32" name="value_hi" />
      <field type="CARD32" name="value_lo" />
    </reply>
  </request>

  <!-- Events -->

  <event name="BufferSwapComplete" number="0">
    <pad bytes="1" />
    <field type="CARD16" name="event_type" enum="EventType" />
    <pad bytes="2" />
    <field type="DRAWABLE" name="drawable" />
    <field type="CARD32" name="ust_hi" />
    <field type="CARD32" name="ust_lo" />
    <field type="CARD32" name="msc_hi" />
    <field type="CARD32" name="msc_lo" />
    <field type="CARD32" name="sbc" />
  </event>

  <!-- Version 1.3 -->

  <event name="InvalidateBuffers" number="1">
    <pad bytes="1" />
    <field type="DRAWABLE" name="drawable" />
  </event>
</xcb>