Add DRI2 protocol, based off of dri2proto.h and the server code. (v2)
[free-sw/xcb/proto] / src / dri2.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 Copyright (C) 2005 Jeremy Kolb.
4 Copyright © 2009 Intel Corporation
5 All Rights Reserved.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the 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 THE
20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the names of the authors or their
25 institutions shall not be used in advertising or otherwise to promote the
26 sale, use or other dealings in this Software without prior written
27 authorization from the authors.
28 -->
29
30 <xcb header="dri2" extension-xname="DRI2" extension-name="DRI2"
31   major-version="1" minor-version="1">
32   <import>xproto</import>
33
34   <enum name="Attachment">
35     <item name="BufferFrontLeft" />
36     <item name="BufferBackLeft" />
37     <item name="BufferFrontRight" />
38     <item name="BufferBackRight" />
39     <item name="BufferDepth" />
40     <item name="BufferStencil" />
41     <item name="BufferAccum" />
42     <item name="BufferFakeFrontLeft" />
43     <item name="BufferFakeFrontRight" />
44     <item name="BufferDepthStencil" />
45   </enum>
46
47   <enum name="DriverType">
48     <item name="DRI" />
49   </enum>
50
51   <!-- Types -->
52
53   <struct name="DRI2Buffer">
54     <field type="CARD32" name="attachment" enum="Attachment" />
55     <field type="CARD32" name="name" />
56     <field type="CARD32" name="pitch" />
57     <field type="CARD32" name="cpp" />
58     <field type="CARD32" name="flags" />
59   </struct>
60
61   <struct name="AttachFormat">
62     <field type="CARD32" name="attachment" enum="Attachment" />
63     <field type="CARD32" name="format" />
64   </struct>
65
66   <!-- Requests -->
67   <request name="QueryVersion" opcode="0">
68     <field type="CARD32" name="major_version" />
69     <field type="CARD32" name="minor_version" />
70     <reply>
71       <pad bytes="1" />
72       <field type="CARD32" name="major_version" />
73       <field type="CARD32" name="minor_version" />
74     </reply>
75   </request>
76
77   <request name="Connect" opcode="1">
78     <field type="WINDOW" name="window" />
79     <field type="CARD32" name="driver_type" enum="DriverType" />
80     <reply>
81       <pad bytes="1" />
82       <field type="CARD32" name="driver_name_length" />
83       <field type="CARD32" name="device_name_length" />
84       <pad bytes="16" />
85       <list type="char" name="driver_name">
86         <fieldref>driver_name_length</fieldref>
87       </list>
88       <list type="char" name="device_name">
89         <fieldref>device_name_length</fieldref>
90       </list>
91     </reply>
92   </request>
93
94   <request name="Authenticate" opcode="2">
95     <field type="WINDOW" name="window" />
96     <field type="CARD32" name="magic" />
97     <reply>
98       <pad bytes="1" />
99       <field type="CARD32" name="authenticated" />
100     </reply>
101   </request>
102
103   <request name="CreateDrawable" opcode="3">
104     <field type="DRAWABLE" name="drawable" />
105   </request>
106
107   <request name="DestroyDrawable" opcode="4">
108     <field type="DRAWABLE" name="drawable" />
109   </request>
110
111   <request name="GetBuffers" opcode="5">
112     <field type="DRAWABLE" name="drawable" />
113     <field type="CARD32" name="count" />
114     <list type="CARD32" name="attachments" />
115     <reply>
116       <pad bytes="1" />
117       <field type="CARD32" name="width" />
118       <field type="CARD32" name="height" />
119       <field type="CARD32" name="count" />
120       <pad bytes="12" />
121       <list type="DRI2Buffer" name="buffers">
122         <fieldref>count</fieldref>
123       </list>
124     </reply>
125   </request>
126
127   <request name="CopyRegion" opcode="6">
128     <field type="DRAWABLE" name="drawable" />
129     <field type="CARD32" name="region" />
130     <field type="CARD32" name="dest" />
131     <field type="CARD32" name="src" />
132     <reply>
133       <pad bytes="1" />
134     </reply>
135   </request>
136
137   <request name="GetBuffersWithFormat" opcode="7">
138     <field type="DRAWABLE" name="drawable" />
139     <field type="CARD32" name="count" />
140     <list type="AttachFormat" name="attachments" />
141     <reply>
142       <pad bytes="1" />
143       <field type="CARD32" name="width" />
144       <field type="CARD32" name="height" />
145       <field type="CARD32" name="count" />
146       <pad bytes="12" />
147       <list type="DRI2Buffer" name="buffers">
148         <fieldref>count</fieldref>
149       </list>
150     </reply>
151   </request>
152 </xcb>