1<?xml version="1.0" encoding="UTF-8"?>
2<protocol name="drm">
3
4  <copyright>
5    Copyright © 2008-2011 Kristian Høgsberg
6    Copyright © 2010-2011 Intel Corporation
7
8    Permission to use, copy, modify, distribute, and sell this
9    software and its documentation for any purpose is hereby granted
10    without fee, provided that\n the above copyright notice appear in
11    all copies and that both that copyright notice and this permission
12    notice appear in supporting documentation, and that the name of
13    the copyright holders not be used in advertising or publicity
14    pertaining to distribution of the software without specific,
15    written prior permission.  The copyright holders make no
16    representations about the suitability of this software for any
17    purpose.  It is provided "as is" without express or implied
18    warranty.
19
20    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
21    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
22    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
23    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
24    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
25    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
27    THIS SOFTWARE.
28  </copyright>
29
30  <!-- drm support. This object is created by the server and published
31       using the display's global event. -->
32  <interface name="wl_drm" version="2">
33    <enum name="error">
34      <entry name="authenticate_fail" value="0"/>
35      <entry name="invalid_format" value="1"/>
36      <entry name="invalid_name" value="2"/>
37    </enum>
38
39    <enum name="format">
40      <!-- The drm format codes match the #defines in drm_fourcc.h.
41           The formats actually supported by the compositor will be
42           reported by the format event. New codes must not be added,
43           unless directly taken from drm_fourcc.h. -->
44      <entry name="c8" value="0x20203843"/>
45      <entry name="rgb332" value="0x38424752"/>
46      <entry name="bgr233" value="0x38524742"/>
47      <entry name="xrgb4444" value="0x32315258"/>
48      <entry name="xbgr4444" value="0x32314258"/>
49      <entry name="rgbx4444" value="0x32315852"/>
50      <entry name="bgrx4444" value="0x32315842"/>
51      <entry name="argb4444" value="0x32315241"/>
52      <entry name="abgr4444" value="0x32314241"/>
53      <entry name="rgba4444" value="0x32314152"/>
54      <entry name="bgra4444" value="0x32314142"/>
55      <entry name="xrgb1555" value="0x35315258"/>
56      <entry name="xbgr1555" value="0x35314258"/>
57      <entry name="rgbx5551" value="0x35315852"/>
58      <entry name="bgrx5551" value="0x35315842"/>
59      <entry name="argb1555" value="0x35315241"/>
60      <entry name="abgr1555" value="0x35314241"/>
61      <entry name="rgba5551" value="0x35314152"/>
62      <entry name="bgra5551" value="0x35314142"/>
63      <entry name="rgb565" value="0x36314752"/>
64      <entry name="bgr565" value="0x36314742"/>
65      <entry name="rgb888" value="0x34324752"/>
66      <entry name="bgr888" value="0x34324742"/>
67      <entry name="xrgb8888" value="0x34325258"/>
68      <entry name="xbgr8888" value="0x34324258"/>
69      <entry name="rgbx8888" value="0x34325852"/>
70      <entry name="bgrx8888" value="0x34325842"/>
71      <entry name="argb8888" value="0x34325241"/>
72      <entry name="abgr8888" value="0x34324241"/>
73      <entry name="rgba8888" value="0x34324152"/>
74      <entry name="bgra8888" value="0x34324142"/>
75      <entry name="xrgb2101010" value="0x30335258"/>
76      <entry name="xbgr2101010" value="0x30334258"/>
77      <entry name="rgbx1010102" value="0x30335852"/>
78      <entry name="bgrx1010102" value="0x30335842"/>
79      <entry name="argb2101010" value="0x30335241"/>
80      <entry name="abgr2101010" value="0x30334241"/>
81      <entry name="rgba1010102" value="0x30334152"/>
82      <entry name="bgra1010102" value="0x30334142"/>
83      <entry name="yuyv" value="0x56595559"/>
84      <entry name="yvyu" value="0x55595659"/>
85      <entry name="uyvy" value="0x59565955"/>
86      <entry name="vyuy" value="0x59555956"/>
87      <entry name="ayuv" value="0x56555941"/>
88      <entry name="xyuv8888" value="0x56555958"/>
89      <entry name="nv12" value="0x3231564e"/>
90      <entry name="nv21" value="0x3132564e"/>
91      <entry name="nv16" value="0x3631564e"/>
92      <entry name="nv61" value="0x3136564e"/>
93      <entry name="yuv410" value="0x39565559"/>
94      <entry name="yvu410" value="0x39555659"/>
95      <entry name="yuv411" value="0x31315559"/>
96      <entry name="yvu411" value="0x31315659"/>
97      <entry name="yuv420" value="0x32315559"/>
98      <entry name="yvu420" value="0x32315659"/>
99      <entry name="yuv422" value="0x36315559"/>
100      <entry name="yvu422" value="0x36315659"/>
101      <entry name="yuv444" value="0x34325559"/>
102      <entry name="yvu444" value="0x34325659"/>
103      <entry name="abgr16f" value="0x48344241"/>
104      <entry name="xbgr16f" value="0x48344258"/>
105    </enum>
106
107    <!-- Call this request with the magic received from drmGetMagic().
108         It will be passed on to the drmAuthMagic() or
109         DRIAuthConnection() call.  This authentication must be
110         completed before create_buffer could be used. -->
111    <request name="authenticate">
112      <arg name="id" type="uint"/>
113    </request>
114
115    <!-- Create a wayland buffer for the named DRM buffer.  The DRM
116         surface must have a name using the flink ioctl -->
117    <request name="create_buffer">
118      <arg name="id" type="new_id" interface="wl_buffer"/>
119      <arg name="name" type="uint"/>
120      <arg name="width" type="int"/>
121      <arg name="height" type="int"/>
122      <arg name="stride" type="uint"/>
123      <arg name="format" type="uint"/>
124    </request>
125
126    <!-- Create a wayland buffer for the named DRM buffer.  The DRM
127         surface must have a name using the flink ioctl -->
128    <request name="create_planar_buffer">
129      <arg name="id" type="new_id" interface="wl_buffer"/>
130      <arg name="name" type="uint"/>
131      <arg name="width" type="int"/>
132      <arg name="height" type="int"/>
133      <arg name="format" type="uint"/>
134      <arg name="offset0" type="int"/>
135      <arg name="stride0" type="int"/>
136      <arg name="offset1" type="int"/>
137      <arg name="stride1" type="int"/>
138      <arg name="offset2" type="int"/>
139      <arg name="stride2" type="int"/>
140    </request>
141
142    <!-- Notification of the path of the drm device which is used by
143         the server.  The client should use this device for creating
144         local buffers.  Only buffers created from this device should
145         be be passed to the server using this drm object's
146         create_buffer request. -->
147    <event name="device">
148      <arg name="name" type="string"/>
149    </event>
150
151    <event name="format">
152      <arg name="format" type="uint"/>
153    </event>
154
155    <!-- Raised if the authenticate request succeeded -->
156    <event name="authenticated"/>
157
158    <enum name="capability" since="2">
159      <description summary="wl_drm capability bitmask">
160        Bitmask of capabilities.
161      </description>
162      <entry name="prime" value="1" summary="wl_drm prime available"/>
163    </enum>
164
165    <event name="capabilities">
166      <arg name="value" type="uint"/>
167    </event>
168
169    <!-- Version 2 additions -->
170
171    <!-- Create a wayland buffer for the prime fd.  Use for regular and planar
172         buffers.  Pass 0 for offset and stride for unused planes. -->
173    <request name="create_prime_buffer" since="2">
174      <arg name="id" type="new_id" interface="wl_buffer"/>
175      <arg name="name" type="fd"/>
176      <arg name="width" type="int"/>
177      <arg name="height" type="int"/>
178      <arg name="format" type="uint"/>
179      <arg name="offset0" type="int"/>
180      <arg name="stride0" type="int"/>
181      <arg name="offset1" type="int"/>
182      <arg name="stride1" type="int"/>
183      <arg name="offset2" type="int"/>
184      <arg name="stride2" type="int"/>
185    </request>
186
187  </interface>
188
189</protocol>
190