meego-device-adaptation import version
[sgx.git] / pvr / pvr_bridge.h
1 /**********************************************************************
2  *
3  * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful but, except
10  * as otherwise stated in writing, without any warranty; without even the
11  * implied warranty of merchantability or fitness for a particular purpose.
12  * See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * The full GNU General Public License is included in this distribution in
19  * the file called "COPYING".
20  *
21  * Contact Information:
22  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23  * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
24  *
25  ******************************************************************************/
26
27 #ifndef __PVR_BRIDGE_H__
28 #define __PVR_BRIDGE_H__
29
30
31 #include "servicesint.h"
32
33
34 #include <linux/ioctl.h>
35
36 #define PVRSRV_IOC_GID      'g'
37 #define PVRSRV_IO(INDEX) \
38         _IO(PVRSRV_IOC_GID, INDEX, struct PVRSRV_BRIDGE_PACKAGE)
39 #define PVRSRV_IOW(INDEX) \
40         _IOW(PVRSRV_IOC_GID, INDEX, struct PVRSRV_BRIDGE_PACKAGE)
41 #define PVRSRV_IOR(INDEX) \
42         _IOR(PVRSRV_IOC_GID, INDEX, struct PVRSRV_BRIDGE_PACKAGE)
43 #define PVRSRV_IOWR(INDEX) \
44         _IOWR(PVRSRV_IOC_GID, INDEX, struct PVRSRV_BRIDGE_PACKAGE)
45
46
47 #define PVRSRV_BRIDGE_CORE_CMD_FIRST                            0
48 #define PVRSRV_BRIDGE_ENUM_DEVICES                              \
49                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+0)
50 #define PVRSRV_BRIDGE_ACQUIRE_DEVICEINFO                        \
51                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+1)
52 #define PVRSRV_BRIDGE_RELEASE_DEVICEINFO                        \
53                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+2)
54 #define PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT                      \
55                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+3)
56 #define PVRSRV_BRIDGE_DESTROY_DEVMEMCONTEXT                     \
57                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+4)
58 #define PVRSRV_BRIDGE_GET_DEVMEM_HEAPINFO                       \
59                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+5)
60 #define PVRSRV_BRIDGE_ALLOC_DEVICEMEM                           \
61                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+6)
62 #define PVRSRV_BRIDGE_FREE_DEVICEMEM                            \
63                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+7)
64 #define PVRSRV_BRIDGE_GETFREE_DEVICEMEM                         \
65                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+8)
66 #define PVRSRV_BRIDGE_CREATE_COMMANDQUEUE                       \
67                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+9)
68 #define PVRSRV_BRIDGE_DESTROY_COMMANDQUEUE                      \
69                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+10)
70 #define PVRSRV_BRIDGE_MHANDLE_TO_MMAP_DATA                      \
71                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+11)
72 #define PVRSRV_BRIDGE_CONNECT_SERVICES                          \
73                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+12)
74 #define PVRSRV_BRIDGE_DISCONNECT_SERVICES                       \
75                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+13)
76 #define PVRSRV_BRIDGE_WRAP_DEVICE_MEM                           \
77                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+14)
78 #define PVRSRV_BRIDGE_GET_DEVICEMEMINFO                         \
79                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+15)
80 #define PVRSRV_BRIDGE_RESERVE_DEV_VIRTMEM                       \
81                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+16)
82 #define PVRSRV_BRIDGE_FREE_DEV_VIRTMEM                          \
83                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+17)
84 #define PVRSRV_BRIDGE_MAP_EXT_MEMORY                            \
85                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+18)
86 #define PVRSRV_BRIDGE_UNMAP_EXT_MEMORY                          \
87                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+19)
88 #define PVRSRV_BRIDGE_MAP_DEV_MEMORY                            \
89                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+20)
90 #define PVRSRV_BRIDGE_UNMAP_DEV_MEMORY                          \
91                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+21)
92 #define PVRSRV_BRIDGE_MAP_DEVICECLASS_MEMORY                    \
93                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+22)
94 #define PVRSRV_BRIDGE_UNMAP_DEVICECLASS_MEMORY                  \
95                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+23)
96 #define PVRSRV_BRIDGE_MAP_MEM_INFO_TO_USER                      \
97                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+24)
98 #define PVRSRV_BRIDGE_UNMAP_MEM_INFO_FROM_USER                  \
99                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+25)
100 #define PVRSRV_BRIDGE_EXPORT_DEVICEMEM                          \
101                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+26)
102 #define PVRSRV_BRIDGE_RELEASE_MMAP_DATA                         \
103                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+27)
104 #define PVRSRV_BRIDGE_CACHE_FLUSH_DRM                           \
105                 PVRSRV_IOWR(PVRSRV_BRIDGE_CORE_CMD_FIRST+28)
106 #define PVRSRV_BRIDGE_CORE_CMD_LAST                             \
107                 (PVRSRV_BRIDGE_CORE_CMD_FIRST+28)
108
109 #define PVRSRV_BRIDGE_SIM_CMD_FIRST                             \
110                 (PVRSRV_BRIDGE_CORE_CMD_LAST+1)
111 #define PVRSRV_BRIDGE_PROCESS_SIMISR_EVENT                      \
112                 PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+0)
113 #define PVRSRV_BRIDGE_REGISTER_SIM_PROCESS                      \
114                 PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+1)
115 #define PVRSRV_BRIDGE_UNREGISTER_SIM_PROCESS                    \
116                 PVRSRV_IOWR(PVRSRV_BRIDGE_SIM_CMD_FIRST+2)
117 #define PVRSRV_BRIDGE_SIM_CMD_LAST                              \
118                 (PVRSRV_BRIDGE_SIM_CMD_FIRST+2)
119
120 #define PVRSRV_BRIDGE_MAPPING_CMD_FIRST                         \
121                 (PVRSRV_BRIDGE_SIM_CMD_LAST+1)
122 #define PVRSRV_BRIDGE_MAPPHYSTOUSERSPACE                        \
123                 PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+0)
124 #define PVRSRV_BRIDGE_UNMAPPHYSTOUSERSPACE                      \
125                 PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+1)
126 #define PVRSRV_BRIDGE_GETPHYSTOUSERSPACEMAP                     \
127                 PVRSRV_IOWR(PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)
128 #define PVRSRV_BRIDGE_MAPPING_CMD_LAST                          \
129                 (PVRSRV_BRIDGE_MAPPING_CMD_FIRST+2)
130
131 #define PVRSRV_BRIDGE_STATS_CMD_FIRST                           \
132                 (PVRSRV_BRIDGE_MAPPING_CMD_LAST+1)
133 #define PVRSRV_BRIDGE_GET_FB_STATS                              \
134                 PVRSRV_IOWR(PVRSRV_BRIDGE_STATS_CMD_FIRST+0)
135 #define PVRSRV_BRIDGE_STATS_CMD_LAST                            \
136                 (PVRSRV_BRIDGE_STATS_CMD_FIRST+0)
137
138 #define PVRSRV_BRIDGE_MISC_CMD_FIRST                            \
139                 (PVRSRV_BRIDGE_STATS_CMD_LAST+1)
140 #define PVRSRV_BRIDGE_GET_MISC_INFO                             \
141                 PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+0)
142 #define PVRSRV_BRIDGE_RELEASE_MISC_INFO                         \
143                 PVRSRV_IOWR(PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
144 #define PVRSRV_BRIDGE_MISC_CMD_LAST                             \
145                 (PVRSRV_BRIDGE_MISC_CMD_FIRST+1)
146
147 #define PVRSRV_BRIDGE_OVERLAY_CMD_FIRST                         \
148                 (PVRSRV_BRIDGE_MISC_CMD_LAST+1)
149 #define PVRSRV_BRIDGE_OVERLAY_CMD_LAST                          \
150                 (PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
151
152 #if defined(PDUMP)
153 #define PVRSRV_BRIDGE_PDUMP_CMD_FIRST                           \
154                 (PVRSRV_BRIDGE_OVERLAY_CMD_FIRST+1)
155 #define PVRSRV_BRIDGE_PDUMP_INIT                                \
156                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0)
157 #define PVRSRV_BRIDGE_PDUMP_MEMPOL                              \
158                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1)
159 #define PVRSRV_BRIDGE_PDUMP_DUMPMEM                             \
160                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2)
161 #define PVRSRV_BRIDGE_PDUMP_REG                                 \
162                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+3)
163 #define PVRSRV_BRIDGE_PDUMP_REGPOL                              \
164                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+4)
165 #define PVRSRV_BRIDGE_PDUMP_COMMENT                             \
166                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+5)
167 #define PVRSRV_BRIDGE_PDUMP_SETFRAME                            \
168                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+6)
169 #define PVRSRV_BRIDGE_PDUMP_ISCAPTURING                         \
170                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7)
171 #define PVRSRV_BRIDGE_PDUMP_DUMPBITMAP                          \
172                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+8)
173 #define PVRSRV_BRIDGE_PDUMP_DUMPREADREG                         \
174                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+9)
175 #define PVRSRV_BRIDGE_PDUMP_SYNCPOL                             \
176                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+10)
177 #define PVRSRV_BRIDGE_PDUMP_DUMPSYNC                            \
178                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+11)
179 #define PVRSRV_BRIDGE_PDUMP_MEMPAGES                            \
180                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+12)
181 #define PVRSRV_BRIDGE_PDUMP_DRIVERINFO                          \
182                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+13)
183 #define PVRSRV_BRIDGE_PDUMP_PDREG                               \
184                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+14)
185 #define PVRSRV_BRIDGE_PDUMP_DUMPPDDEVPADDR                      \
186                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+15)
187 #define PVRSRV_BRIDGE_PDUMP_CYCLE_COUNT_REG_READ                \
188                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+16)
189 #define PVRSRV_BRIDGE_PDUMP_STARTINITPHASE                      \
190                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+17)
191 #define PVRSRV_BRIDGE_PDUMP_STOPINITPHASE                       \
192                 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+18)
193 #define PVRSRV_BRIDGE_PDUMP_CMD_LAST                            \
194                 (PVRSRV_BRIDGE_PDUMP_CMD_FIRST+18)
195 #else
196 #define PVRSRV_BRIDGE_PDUMP_CMD_LAST    PVRSRV_BRIDGE_OVERLAY_CMD_LAST
197 #endif
198
199 #define PVRSRV_BRIDGE_OEM_CMD_FIRST                             \
200                 (PVRSRV_BRIDGE_PDUMP_CMD_LAST+1)
201 #define PVRSRV_BRIDGE_GET_OEMJTABLE                             \
202                 PVRSRV_IOWR(PVRSRV_BRIDGE_OEM_CMD_FIRST+0)
203 #define PVRSRV_BRIDGE_OEM_CMD_LAST                              \
204                 (PVRSRV_BRIDGE_OEM_CMD_FIRST+0)
205
206 #define PVRSRV_BRIDGE_DEVCLASS_CMD_FIRST                        \
207                 (PVRSRV_BRIDGE_OEM_CMD_LAST+1)
208 #define PVRSRV_BRIDGE_ENUM_CLASS                                \
209                 PVRSRV_IOWR(PVRSRV_BRIDGE_DEVCLASS_CMD_FIRST+0)
210 #define PVRSRV_BRIDGE_DEVCLASS_CMD_LAST                         \
211                 (PVRSRV_BRIDGE_DEVCLASS_CMD_FIRST+0)
212
213 #define PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST                       \
214                 (PVRSRV_BRIDGE_DEVCLASS_CMD_LAST+1)
215 #define PVRSRV_BRIDGE_OPEN_DISPCLASS_DEVICE                     \
216                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+0)
217 #define PVRSRV_BRIDGE_CLOSE_DISPCLASS_DEVICE                    \
218                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+1)
219 #define PVRSRV_BRIDGE_ENUM_DISPCLASS_FORMATS                    \
220                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+2)
221 #define PVRSRV_BRIDGE_ENUM_DISPCLASS_DIMS                       \
222                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+3)
223 #define PVRSRV_BRIDGE_GET_DISPCLASS_SYSBUFFER                   \
224                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+4)
225 #define PVRSRV_BRIDGE_GET_DISPCLASS_INFO                        \
226                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+5)
227 #define PVRSRV_BRIDGE_CREATE_DISPCLASS_SWAPCHAIN                \
228                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+6)
229 #define PVRSRV_BRIDGE_DESTROY_DISPCLASS_SWAPCHAIN               \
230                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+7)
231 #define PVRSRV_BRIDGE_SET_DISPCLASS_DSTRECT                     \
232                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+8)
233 #define PVRSRV_BRIDGE_SET_DISPCLASS_SRCRECT                     \
234                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+9)
235 #define PVRSRV_BRIDGE_SET_DISPCLASS_DSTCOLOURKEY                \
236                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+10)
237 #define PVRSRV_BRIDGE_SET_DISPCLASS_SRCCOLOURKEY                \
238                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+11)
239 #define PVRSRV_BRIDGE_GET_DISPCLASS_BUFFERS                     \
240                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+12)
241 #define PVRSRV_BRIDGE_SWAP_DISPCLASS_TO_BUFFER                  \
242                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+13)
243 #define PVRSRV_BRIDGE_SWAP_DISPCLASS_TO_SYSTEM                  \
244                 PVRSRV_IOWR(PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+14)
245 #define PVRSRV_BRIDGE_DISPCLASS_CMD_LAST                        \
246                 (PVRSRV_BRIDGE_DISPCLASS_CMD_FIRST+14)
247
248 #define PVRSRV_BRIDGE_BUFCLASS_CMD_FIRST                        \
249                 (PVRSRV_BRIDGE_DISPCLASS_CMD_LAST+1)
250 #define PVRSRV_BRIDGE_OPEN_BUFFERCLASS_DEVICE                   \
251                 PVRSRV_IOWR(PVRSRV_BRIDGE_BUFCLASS_CMD_FIRST+0)
252 #define PVRSRV_BRIDGE_CLOSE_BUFFERCLASS_DEVICE                  \
253                 PVRSRV_IOWR(PVRSRV_BRIDGE_BUFCLASS_CMD_FIRST+1)
254 #define PVRSRV_BRIDGE_GET_BUFFERCLASS_INFO                      \
255                 PVRSRV_IOWR(PVRSRV_BRIDGE_BUFCLASS_CMD_FIRST+2)
256 #define PVRSRV_BRIDGE_GET_BUFFERCLASS_BUFFER                    \
257                 PVRSRV_IOWR(PVRSRV_BRIDGE_BUFCLASS_CMD_FIRST+3)
258 #define PVRSRV_BRIDGE_BUFCLASS_CMD_LAST                         \
259                 (PVRSRV_BRIDGE_BUFCLASS_CMD_FIRST+3)
260
261 #define PVRSRV_BRIDGE_WRAP_CMD_FIRST                            \
262                 (PVRSRV_BRIDGE_BUFCLASS_CMD_LAST+1)
263 #define PVRSRV_BRIDGE_WRAP_EXT_MEMORY                           \
264                 PVRSRV_IOWR(PVRSRV_BRIDGE_WRAP_CMD_FIRST+0)
265 #define PVRSRV_BRIDGE_UNWRAP_EXT_MEMORY                         \
266                 PVRSRV_IOWR(PVRSRV_BRIDGE_WRAP_CMD_FIRST+1)
267 #define PVRSRV_BRIDGE_WRAP_CMD_LAST                             \
268                 (PVRSRV_BRIDGE_WRAP_CMD_FIRST+1)
269
270 #define PVRSRV_BRIDGE_SHAREDMEM_CMD_FIRST                       \
271                 (PVRSRV_BRIDGE_WRAP_CMD_LAST+1)
272 #define PVRSRV_BRIDGE_ALLOC_SHARED_SYS_MEM                      \
273                 PVRSRV_IOWR(PVRSRV_BRIDGE_SHAREDMEM_CMD_FIRST+0)
274 #define PVRSRV_BRIDGE_FREE_SHARED_SYS_MEM                       \
275                 PVRSRV_IOWR(PVRSRV_BRIDGE_SHAREDMEM_CMD_FIRST+1)
276 #define PVRSRV_BRIDGE_MAP_MEMINFO_MEM                           \
277                 PVRSRV_IOWR(PVRSRV_BRIDGE_SHAREDMEM_CMD_FIRST+2)
278 #define PVRSRV_BRIDGE_UNMAP_MEMINFO_MEM                         \
279                 PVRSRV_IOWR(PVRSRV_BRIDGE_SHAREDMEM_CMD_FIRST+3)
280 #define PVRSRV_BRIDGE_SHAREDMEM_CMD_LAST                        \
281                 (PVRSRV_BRIDGE_SHAREDMEM_CMD_FIRST+3)
282
283 #define PVRSRV_BRIDGE_SERVICES4_TMP_CMD_FIRST                   \
284                 (PVRSRV_BRIDGE_SHAREDMEM_CMD_LAST+1)
285 #define PVRSRV_BRIDGE_GETMMU_PD_DEVPADDR                        \
286                 PVRSRV_IOWR(PVRSRV_BRIDGE_SERVICES4_TMP_CMD_FIRST+0)
287 #define PVRSRV_BRIDGE_SERVICES4_TMP_CMD_LAST                    \
288                 (PVRSRV_BRIDGE_SERVICES4_TMP_CMD_FIRST+0)
289
290 #define PVRSRV_BRIDGE_INITSRV_CMD_FIRST                         \
291                 (PVRSRV_BRIDGE_SERVICES4_TMP_CMD_LAST+1)
292 #define PVRSRV_BRIDGE_INITSRV_CONNECT                           \
293                 PVRSRV_IOWR(PVRSRV_BRIDGE_INITSRV_CMD_FIRST+0)
294 #define PVRSRV_BRIDGE_INITSRV_DISCONNECT                        \
295                 PVRSRV_IOWR(PVRSRV_BRIDGE_INITSRV_CMD_FIRST+1)
296 #define PVRSRV_BRIDGE_INITSRV_CMD_LAST                          \
297                 (PVRSRV_BRIDGE_INITSRV_CMD_FIRST+1)
298
299 #define PVRSRV_BRIDGE_EVENT_OBJECT_CMD_FIRST                    \
300                 (PVRSRV_BRIDGE_INITSRV_CMD_LAST+1)
301 #define PVRSRV_BRIDGE_EVENT_OBJECT_WAIT                         \
302                 PVRSRV_IOWR(PVRSRV_BRIDGE_EVENT_OBJECT_CMD_FIRST+0)
303 #define PVRSRV_BRIDGE_EVENT_OBJECT_OPEN                         \
304                 PVRSRV_IOWR(PVRSRV_BRIDGE_EVENT_OBJECT_CMD_FIRST+1)
305 #define PVRSRV_BRIDGE_EVENT_OBJECT_CLOSE                        \
306                 PVRSRV_IOWR(PVRSRV_BRIDGE_EVENT_OBJECT_CMD_FIRST+2)
307 #define PVRSRV_BRIDGE_EVENT_OBJECT_CMD_LAST                     \
308                 (PVRSRV_BRIDGE_EVENT_OBJECT_CMD_FIRST+2)
309
310 #define PVRSRV_BRIDGE_SYNC_OPS_CMD_FIRST                        \
311                 (PVRSRV_BRIDGE_EVENT_OBJECT_CMD_LAST+1)
312 #define PVRSRV_BRIDGE_MODIFY_SYNC_OPS                           \
313                 PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_OPS_CMD_FIRST+0)
314 #define PVRSRV_BRIDGE_SYNC_OPS_CMD_LAST                         \
315                 (PVRSRV_BRIDGE_SYNC_OPS_CMD_FIRST+0)
316
317 #define PVRSRV_BRIDGE_LAST_NON_DEVICE_CMD                       \
318                 (PVRSRV_BRIDGE_SYNC_OPS_CMD_LAST+1)
319
320 #define PVRSRV_KERNEL_MODE_CLIENT                               1
321
322 struct PVRSRV_BRIDGE_RETURN {
323         enum PVRSRV_ERROR eError;
324         void *pvData;
325 };
326
327 struct PVRSRV_BRIDGE_PACKAGE {
328         u32 ui32BridgeID;
329         u32 ui32Size;
330         void __user *pvParamIn;
331         u32 ui32InBufferSize;
332         void __user *pvParamOut;
333         u32 ui32OutBufferSize;
334
335         void *hKernelServices;
336 };
337
338 struct PVRSRV_BRIDGE_IN_ACQUIRE_DEVICEINFO {
339         u32 ui32BridgeFlags;
340         u32 uiDevIndex;
341         enum PVRSRV_DEVICE_TYPE eDeviceType;
342 };
343
344 struct PVRSRV_BRIDGE_IN_ENUMCLASS {
345         u32 ui32BridgeFlags;
346         enum PVRSRV_DEVICE_CLASS sDeviceClass;
347 };
348
349 struct PVRSRV_BRIDGE_IN_CLOSE_DISPCLASS_DEVICE {
350         u32 ui32BridgeFlags;
351         void *hDeviceKM;
352 };
353
354 struct PVRSRV_BRIDGE_IN_ENUM_DISPCLASS_FORMATS {
355         u32 ui32BridgeFlags;
356         void *hDeviceKM;
357 };
358
359 struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_SYSBUFFER {
360         u32 ui32BridgeFlags;
361         void *hDeviceKM;
362 };
363
364 struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_INFO {
365         u32 ui32BridgeFlags;
366         void *hDeviceKM;
367 };
368
369 struct PVRSRV_BRIDGE_IN_CLOSE_BUFFERCLASS_DEVICE {
370         u32 ui32BridgeFlags;
371         void *hDeviceKM;
372 };
373
374 struct PVRSRV_BRIDGE_IN_GET_BUFFERCLASS_INFO {
375         u32 ui32BridgeFlags;
376         void *hDeviceKM;
377 };
378
379 struct PVRSRV_BRIDGE_IN_RELEASE_DEVICEINFO {
380         u32 ui32BridgeFlags;
381         void *hDevCookie;
382 };
383
384 struct PVRSRV_BRIDGE_IN_FREE_CLASSDEVICEINFO {
385         u32 ui32BridgeFlags;
386         enum PVRSRV_DEVICE_CLASS DeviceClass;
387         void *pvDevInfo;
388 };
389
390 struct PVRSRV_BRIDGE_IN_GET_DEVMEM_HEAPINFO {
391         u32 ui32BridgeFlags;
392         void *hDevCookie;
393         void *hDevMemContext;
394 };
395
396 struct PVRSRV_BRIDGE_IN_CREATE_DEVMEMCONTEXT {
397         u32 ui32BridgeFlags;
398         void *hDevCookie;
399 };
400
401 struct PVRSRV_BRIDGE_IN_DESTROY_DEVMEMCONTEXT {
402         u32 ui32BridgeFlags;
403         void *hDevCookie;
404         void *hDevMemContext;
405 };
406
407 struct PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM {
408         u32 ui32BridgeFlags;
409         void *hDevCookie;
410         void *hDevMemHeap;
411         u32 ui32Attribs;
412         u32 ui32Size;
413         u32 ui32Alignment;
414 };
415
416 struct PVRSRV_BRIDGE_IN_MAPMEMINFOTOUSER {
417         u32 ui32BridgeFlags;
418         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
419 };
420
421 struct PVRSRV_BRIDGE_IN_UNMAPMEMINFOFROMUSER {
422         u32 ui32BridgeFlags;
423         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
424         void *pvLinAddr;
425         void *hMappingInfo;
426 };
427
428 #define DRM_PVR2D_CFLUSH_FROM_GPU       1
429 #define DRM_PVR2D_CFLUSH_TO_GPU         2
430
431 struct PVRSRV_BRIDGE_IN_CACHEFLUSHDRMFROMUSER {
432         u32 ui32BridgeFlags;
433         void *hDevCookie;
434         u32 ui32Type;
435         u32 ui32Virt;
436         u32 ui32Length;
437 };
438
439 struct PVRSRV_BRIDGE_IN_FREEDEVICEMEM {
440         u32 ui32BridgeFlags;
441         void *hDevCookie;
442         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
443         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
444
445 };
446
447 struct PVRSRV_BRIDGE_IN_EXPORTDEVICEMEM {
448         u32 ui32BridgeFlags;
449         void *hDevCookie;
450         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
451
452 };
453
454 struct PVRSRV_BRIDGE_IN_GETFREEDEVICEMEM {
455         u32 ui32BridgeFlags;
456         u32 ui32Flags;
457 };
458
459 struct PVRSRV_BRIDGE_IN_CREATECOMMANDQUEUE {
460         u32 ui32BridgeFlags;
461         void *hDevCookie;
462         u32 ui32QueueSize;
463 };
464
465 struct PVRSRV_BRIDGE_IN_DESTROYCOMMANDQUEUE {
466         u32 ui32BridgeFlags;
467         void *hDevCookie;
468         struct PVRSRV_QUEUE_INFO *psQueueInfo;
469
470 };
471
472 struct PVRSRV_BRIDGE_IN_MHANDLE_TO_MMAP_DATA {
473         u32 ui32BridgeFlags;
474         void *hMHandle;
475 };
476
477 struct PVRSRV_BRIDGE_IN_RELEASE_MMAP_DATA {
478         u32 ui32BridgeFlags;
479         void *hMHandle;
480 };
481
482 struct PVRSRV_BRIDGE_IN_RESERVE_DEV_VIRTMEM {
483         u32 ui32BridgeFlags;
484         void *hDevMemHeap;
485         struct IMG_DEV_VIRTADDR *psDevVAddr;
486         u32 ui32Size;
487         u32 ui32Alignment;
488 };
489
490 struct PVRSRV_BRIDGE_OUT_CONNECT_SERVICES {
491         enum PVRSRV_ERROR eError;
492         void *hKernelServices;
493 };
494
495 struct PVRSRV_BRIDGE_OUT_RESERVE_DEV_VIRTMEM {
496         enum PVRSRV_ERROR eError;
497         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
498         struct PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfo;
499         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
500         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
501 };
502
503 struct PVRSRV_BRIDGE_IN_FREE_DEV_VIRTMEM {
504         u32 ui32BridgeFlags;
505         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
506         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
507         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
508 };
509
510 struct PVRSRV_BRIDGE_IN_MAP_DEV_MEMORY {
511         u32 ui32BridgeFlags;
512         void *hKernelMemInfo;
513         void *hDstDevMemHeap;
514 };
515
516 struct PVRSRV_BRIDGE_OUT_MAP_DEV_MEMORY {
517         enum PVRSRV_ERROR eError;
518         struct PVRSRV_KERNEL_MEM_INFO *psDstKernelMemInfo;
519         struct PVRSRV_KERNEL_SYNC_INFO *psDstKernelSyncInfo;
520         struct PVRSRV_CLIENT_MEM_INFO sDstClientMemInfo;
521         struct PVRSRV_CLIENT_SYNC_INFO sDstClientSyncInfo;
522 };
523
524 struct PVRSRV_BRIDGE_IN_UNMAP_DEV_MEMORY {
525         u32 ui32BridgeFlags;
526         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
527         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
528         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
529 };
530
531 struct PVRSRV_BRIDGE_IN_MAP_EXT_MEMORY {
532         u32 ui32BridgeFlags;
533         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
534         struct IMG_SYS_PHYADDR *psSysPAddr;
535         u32 ui32Flags;
536 };
537
538 struct PVRSRV_BRIDGE_IN_UNMAP_EXT_MEMORY {
539         u32 ui32BridgeFlags;
540         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
541         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
542         u32 ui32Flags;
543 };
544
545 struct PVRSRV_BRIDGE_IN_MAP_DEVICECLASS_MEMORY {
546         u32 ui32BridgeFlags;
547         void *hDeviceClassBuffer;
548         void *hDevMemContext;
549
550 };
551
552 struct PVRSRV_BRIDGE_OUT_MAP_DEVICECLASS_MEMORY {
553         enum PVRSRV_ERROR eError;
554         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
555         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
556         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
557         struct PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfo;
558         void *hMappingInfo;
559 };
560
561 struct PVRSRV_BRIDGE_IN_UNMAP_DEVICECLASS_MEMORY {
562         u32 ui32BridgeFlags;
563         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
564         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
565         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
566 };
567
568 struct PVRSRV_BRIDGE_IN_PDUMP_MEMPOL {
569         u32 ui32BridgeFlags;
570         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
571         u32 ui32Offset;
572         u32 ui32Value;
573         u32 ui32Mask;
574         IMG_BOOL bLastFrame;
575         IMG_BOOL bOverwrite;
576 };
577
578 struct PVRSRV_BRIDGE_IN_PDUMP_SYNCPOL {
579         u32 ui32BridgeFlags;
580         struct PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfo;
581         IMG_BOOL bIsRead;
582         u32 ui32Value;
583         u32 ui32Mask;
584 };
585
586 struct PVRSRV_BRIDGE_IN_PDUMP_DUMPMEM {
587         u32 ui32BridgeFlags;
588         void *pvLinAddr;
589         void *pvAltLinAddr;
590         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
591         u32 ui32Offset;
592         u32 ui32Bytes;
593         u32 ui32Flags;
594 };
595
596 struct PVRSRV_BRIDGE_IN_PDUMP_DUMPSYNC {
597         u32 ui32BridgeFlags;
598         void *pvAltLinAddr;
599         struct PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfo;
600         u32 ui32Offset;
601         u32 ui32Bytes;
602 };
603
604 struct PVRSRV_BRIDGE_IN_PDUMP_DUMPREG {
605         u32 ui32BridgeFlags;
606         struct PVRSRV_HWREG sHWReg;
607         u32 ui32Flags;
608 };
609
610 struct PVRSRV_BRIDGE_IN_PDUMP_REGPOL {
611         u32 ui32BridgeFlags;
612         struct PVRSRV_HWREG sHWReg;
613         u32 ui32Mask;
614         u32 ui32Flags;
615 };
616
617 struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDREG {
618         u32 ui32BridgeFlags;
619         struct PVRSRV_HWREG sHWReg;
620         u32 ui32Flags;
621 };
622
623 struct PVRSRV_BRIDGE_IN_PDUMP_MEMPAGES {
624         u32 ui32BridgeFlags;
625         void *hKernelMemInfo;
626         struct IMG_DEV_PHYADDR *pPages;
627         u32 ui32NumPages;
628         struct IMG_DEV_VIRTADDR sDevAddr;
629         u32 ui32Start;
630         u32 ui32Length;
631         IMG_BOOL bContinuous;
632 };
633
634 struct PVRSRV_BRIDGE_IN_PDUMP_COMMENT {
635         u32 ui32BridgeFlags;
636         char szComment[PVRSRV_PDUMP_MAX_COMMENT_SIZE];
637         u32 ui32Flags;
638 };
639
640 struct PVRSRV_BRIDGE_IN_PDUMP_SETFRAME {
641         u32 ui32BridgeFlags;
642         u32 ui32Frame;
643 };
644
645 struct PVRSRV_BRIDGE_IN_PDUMP_BITMAP {
646         u32 ui32BridgeFlags;
647         char szFileName[PVRSRV_PDUMP_MAX_FILENAME_SIZE];
648         u32 ui32FileOffset;
649         u32 ui32Width;
650         u32 ui32Height;
651         u32 ui32StrideInBytes;
652         struct IMG_DEV_VIRTADDR sDevBaseAddr;
653         u32 ui32Size;
654         enum PDUMP_PIXEL_FORMAT ePixelFormat;
655         enum PDUMP_MEM_FORMAT eMemFormat;
656         u32 ui32Flags;
657 };
658
659 struct PVRSRV_BRIDGE_IN_PDUMP_READREG {
660         u32 ui32BridgeFlags;
661         char szFileName[PVRSRV_PDUMP_MAX_FILENAME_SIZE];
662         u32 ui32FileOffset;
663         u32 ui32Address;
664         u32 ui32Size;
665         u32 ui32Flags;
666 };
667
668 struct PVRSRV_BRIDGE_IN_PDUMP_DRIVERINFO {
669         u32 ui32BridgeFlags;
670         char szString[PVRSRV_PDUMP_MAX_COMMENT_SIZE];
671         IMG_BOOL bContinuous;
672 };
673
674 struct PVRSRV_BRIDGE_IN_PDUMP_DUMPPDDEVPADDR {
675         u32 ui32BridgeFlags;
676         void *hKernelMemInfo;
677         u32 ui32Offset;
678         struct IMG_DEV_PHYADDR sPDDevPAddr;
679 };
680
681 struct PVRSRV_BRIDGE_IN_PDUMP_CYCLE_COUNT_REG_READ {
682         u32 ui32BridgeFlags;
683         u32 ui32RegOffset;
684         IMG_BOOL bLastFrame;
685 };
686
687 struct PVRSRV_BRIDGE_OUT_ENUMDEVICE {
688         enum PVRSRV_ERROR eError;
689         u32 ui32NumDevices;
690         struct PVRSRV_DEVICE_IDENTIFIER asDeviceIdentifier[PVRSRV_MAX_DEVICES];
691 };
692
693 struct PVRSRV_BRIDGE_OUT_ACQUIRE_DEVICEINFO {
694
695         enum PVRSRV_ERROR eError;
696         void *hDevCookie;
697 };
698
699 struct PVRSRV_BRIDGE_OUT_ENUMCLASS {
700         enum PVRSRV_ERROR eError;
701         u32 ui32NumDevices;
702         u32 ui32DevID[PVRSRV_MAX_DEVICES];
703 };
704
705 struct PVRSRV_BRIDGE_IN_OPEN_DISPCLASS_DEVICE {
706         u32 ui32BridgeFlags;
707         u32 ui32DeviceID;
708         void *hDevCookie;
709 };
710
711 struct PVRSRV_BRIDGE_OUT_OPEN_DISPCLASS_DEVICE {
712         enum PVRSRV_ERROR eError;
713         void *hDeviceKM;
714 };
715
716 struct PVRSRV_BRIDGE_IN_WRAP_EXT_MEMORY {
717         u32 ui32BridgeFlags;
718         void *hDevCookie;
719         void *hDevMemContext;
720         void *pvLinAddr;
721         u32 ui32ByteSize;
722         u32 ui32PageOffset;
723         IMG_BOOL bPhysContig;
724         u32 ui32NumPageTableEntries;
725         struct IMG_SYS_PHYADDR __user *psSysPAddr;
726 };
727
728 struct PVRSRV_BRIDGE_OUT_WRAP_EXT_MEMORY {
729         enum PVRSRV_ERROR eError;
730         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
731         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
732 };
733
734 struct PVRSRV_BRIDGE_IN_UNWRAP_EXT_MEMORY {
735         u32 ui32BridgeFlags;
736         void *hKernelMemInfo;
737         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
738         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
739
740 };
741
742 #define PVRSRV_MAX_DC_DISPLAY_FORMATS                   10
743 #define PVRSRV_MAX_DC_DISPLAY_DIMENSIONS                10
744 #define PVRSRV_MAX_DC_SWAPCHAIN_BUFFERS                 4
745 #define PVRSRV_MAX_DC_CLIP_RECTS                        32
746
747 struct PVRSRV_BRIDGE_OUT_ENUM_DISPCLASS_FORMATS {
748         enum PVRSRV_ERROR eError;
749         u32 ui32Count;
750         struct DISPLAY_FORMAT asFormat[PVRSRV_MAX_DC_DISPLAY_FORMATS];
751 };
752
753 struct PVRSRV_BRIDGE_IN_ENUM_DISPCLASS_DIMS {
754         u32 ui32BridgeFlags;
755         void *hDeviceKM;
756         struct DISPLAY_FORMAT sFormat;
757 };
758
759 struct PVRSRV_BRIDGE_OUT_ENUM_DISPCLASS_DIMS {
760         enum PVRSRV_ERROR eError;
761         u32 ui32Count;
762         struct DISPLAY_DIMS asDim[PVRSRV_MAX_DC_DISPLAY_DIMENSIONS];
763 };
764
765 struct PVRSRV_BRIDGE_OUT_GET_DISPCLASS_INFO {
766         enum PVRSRV_ERROR eError;
767         struct DISPLAY_INFO sDisplayInfo;
768 };
769
770 struct PVRSRV_BRIDGE_OUT_GET_DISPCLASS_SYSBUFFER {
771         enum PVRSRV_ERROR eError;
772         void *hBuffer;
773 };
774
775 struct PVRSRV_BRIDGE_IN_CREATE_DISPCLASS_SWAPCHAIN {
776         u32 ui32BridgeFlags;
777         void *hDeviceKM;
778         u32 ui32Flags;
779         struct DISPLAY_SURF_ATTRIBUTES sDstSurfAttrib;
780         struct DISPLAY_SURF_ATTRIBUTES sSrcSurfAttrib;
781         u32 ui32BufferCount;
782         u32 ui32OEMFlags;
783         u32 ui32SwapChainID;
784 };
785
786 struct PVRSRV_BRIDGE_OUT_CREATE_DISPCLASS_SWAPCHAIN {
787         enum PVRSRV_ERROR eError;
788         void *hSwapChain;
789         u32 ui32SwapChainID;
790 };
791
792 struct PVRSRV_BRIDGE_IN_DESTROY_DISPCLASS_SWAPCHAIN {
793         u32 ui32BridgeFlags;
794         void *hDeviceKM;
795         void *hSwapChain;
796 };
797
798 struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_RECT {
799         u32 ui32BridgeFlags;
800         void *hDeviceKM;
801         void *hSwapChain;
802         struct IMG_RECT sRect;
803 };
804
805 struct PVRSRV_BRIDGE_IN_SET_DISPCLASS_COLOURKEY {
806         u32 ui32BridgeFlags;
807         void *hDeviceKM;
808         void *hSwapChain;
809         u32 ui32CKColour;
810 };
811
812 struct PVRSRV_BRIDGE_IN_GET_DISPCLASS_BUFFERS {
813         u32 ui32BridgeFlags;
814         void *hDeviceKM;
815         void *hSwapChain;
816 };
817
818 struct PVRSRV_BRIDGE_OUT_GET_DISPCLASS_BUFFERS {
819         enum PVRSRV_ERROR eError;
820         u32 ui32BufferCount;
821         void *ahBuffer[PVRSRV_MAX_DC_SWAPCHAIN_BUFFERS];
822 };
823
824 struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_BUFFER {
825         u32 ui32BridgeFlags;
826         void *hDeviceKM;
827         void *hBuffer;
828         u32 ui32SwapInterval;
829         void *hPrivateTag;
830         u32 ui32ClipRectCount;
831         struct IMG_RECT sClipRect[PVRSRV_MAX_DC_CLIP_RECTS];
832 };
833
834 struct PVRSRV_BRIDGE_IN_SWAP_DISPCLASS_TO_SYSTEM {
835         u32 ui32BridgeFlags;
836         void *hDeviceKM;
837         void *hSwapChain;
838 };
839
840 struct PVRSRV_BRIDGE_IN_OPEN_BUFFERCLASS_DEVICE {
841         u32 ui32BridgeFlags;
842         u32 ui32DeviceID;
843         void *hDevCookie;
844 };
845
846 struct PVRSRV_BRIDGE_OUT_OPEN_BUFFERCLASS_DEVICE {
847         enum PVRSRV_ERROR eError;
848         void *hDeviceKM;
849 };
850
851 struct PVRSRV_BRIDGE_OUT_GET_BUFFERCLASS_INFO {
852         enum PVRSRV_ERROR eError;
853         struct BUFFER_INFO sBufferInfo;
854 };
855
856 struct PVRSRV_BRIDGE_IN_GET_BUFFERCLASS_BUFFER {
857         u32 ui32BridgeFlags;
858         void *hDeviceKM;
859         u32 ui32BufferIndex;
860 };
861
862 struct PVRSRV_BRIDGE_OUT_GET_BUFFERCLASS_BUFFER {
863         enum PVRSRV_ERROR eError;
864         void *hBuffer;
865 };
866
867 struct PVRSRV_BRIDGE_OUT_GET_DEVMEM_HEAPINFO {
868         enum PVRSRV_ERROR eError;
869         u32 ui32ClientHeapCount;
870         struct PVRSRV_HEAP_INFO sHeapInfo[PVRSRV_MAX_CLIENT_HEAPS];
871 };
872
873 struct PVRSRV_BRIDGE_OUT_CREATE_DEVMEMCONTEXT {
874         enum PVRSRV_ERROR eError;
875         void *hDevMemContext;
876         u32 ui32ClientHeapCount;
877         struct PVRSRV_HEAP_INFO sHeapInfo[PVRSRV_MAX_CLIENT_HEAPS];
878 };
879
880 struct PVRSRV_BRIDGE_OUT_CREATE_DEVMEMHEAP {
881         enum PVRSRV_ERROR eError;
882         void *hDevMemHeap;
883 };
884
885 struct PVRSRV_BRIDGE_OUT_ALLOCDEVICEMEM {
886         enum PVRSRV_ERROR eError;
887         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
888         struct PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfo;
889         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
890         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
891
892 };
893
894 struct PVRSRV_BRIDGE_OUT_EXPORTDEVICEMEM {
895         enum PVRSRV_ERROR eError;
896         void *hMemInfo;
897
898 };
899
900 struct PVRSRV_BRIDGE_OUT_MAPMEMINFOTOUSER {
901         enum PVRSRV_ERROR eError;
902         void *pvLinAddr;
903         void *hMappingInfo;
904 };
905
906 struct PVRSRV_BRIDGE_OUT_GETFREEDEVICEMEM {
907         enum PVRSRV_ERROR eError;
908         u32 ui32Total;
909         u32 ui32Free;
910         u32 ui32LargestBlock;
911 };
912
913 #include "pvrmmap.h"
914 struct PVRSRV_BRIDGE_OUT_MHANDLE_TO_MMAP_DATA {
915         enum PVRSRV_ERROR eError;
916         u32 ui32MMapOffset;
917         u32 ui32ByteOffset;
918         u32 ui32RealByteSize;
919         u32 ui32UserVAddr;
920 };
921
922 struct PVRSRV_BRIDGE_OUT_RELEASE_MMAP_DATA {
923         enum PVRSRV_ERROR eError;
924         IMG_BOOL bMUnmap;
925         u32 ui32UserVAddr;
926         u32 ui32RealByteSize;
927 };
928
929 struct PVRSRV_BRIDGE_IN_GET_MISC_INFO {
930         u32 ui32BridgeFlags;
931         struct PVRSRV_MISC_INFO sMiscInfo;
932 };
933
934 struct PVRSRV_BRIDGE_OUT_GET_MISC_INFO {
935         enum PVRSRV_ERROR eError;
936         struct PVRSRV_MISC_INFO sMiscInfo;
937 };
938
939 struct PVRSRV_BRIDGE_IN_RELEASE_MISC_INFO {
940         u32 ui32BridgeFlags;
941         struct PVRSRV_MISC_INFO sMiscInfo;
942 };
943
944 struct PVRSRV_BRIDGE_OUT_RELEASE_MISC_INFO {
945         enum PVRSRV_ERROR eError;
946         struct PVRSRV_MISC_INFO sMiscInfo;
947 };
948
949 struct PVRSRV_BRIDGE_OUT_PDUMP_ISCAPTURING {
950         enum PVRSRV_ERROR eError;
951         IMG_BOOL bIsCapturing;
952 };
953
954 struct PVRSRV_BRIDGE_IN_GET_FB_STATS {
955         u32 ui32BridgeFlags;
956         u32 ui32Total;
957         u32 ui32Available;
958 };
959
960 struct PVRSRV_BRIDGE_IN_MAPPHYSTOUSERSPACE {
961         u32 ui32BridgeFlags;
962         void *hDevCookie;
963         struct IMG_SYS_PHYADDR sSysPhysAddr;
964         u32 uiSizeInBytes;
965 };
966
967 struct PVRSRV_BRIDGE_OUT_MAPPHYSTOUSERSPACE {
968         void *pvUserAddr;
969         u32 uiActualSize;
970         void *pvProcess;
971 };
972
973 struct PVRSRV_BRIDGE_IN_UNMAPPHYSTOUSERSPACE {
974         u32 ui32BridgeFlags;
975         void *hDevCookie;
976         void *pvUserAddr;
977         void *pvProcess;
978 };
979
980 struct PVRSRV_BRIDGE_OUT_GETPHYSTOUSERSPACEMAP {
981         void **ppvTbl;
982         u32 uiTblSize;
983 };
984
985 struct PVRSRV_BRIDGE_IN_REGISTER_SIM_PROCESS {
986         u32 ui32BridgeFlags;
987         void *hDevCookie;
988         void *pvProcess;
989 };
990
991 struct PVRSRV_BRIDGE_OUT_REGISTER_SIM_PROCESS {
992         struct IMG_SYS_PHYADDR sRegsPhysBase;
993         void *pvRegsBase;
994         void *pvProcess;
995         u32 ulNoOfEntries;
996         void *pvTblLinAddr;
997 };
998
999 struct PVRSRV_BRIDGE_IN_UNREGISTER_SIM_PROCESS {
1000         u32 ui32BridgeFlags;
1001         void *hDevCookie;
1002         void *pvProcess;
1003         void *pvRegsBase;
1004 };
1005
1006 struct PVRSRV_BRIDGE_IN_PROCESS_SIMISR_EVENT {
1007         u32 ui32BridgeFlags;
1008         void *hDevCookie;
1009         u32 ui32StatusAndMask;
1010         enum PVRSRV_ERROR eError;
1011 };
1012
1013 struct PVRSRV_BRIDGE_IN_INITSRV_DISCONNECT {
1014         u32 ui32BridgeFlags;
1015         IMG_BOOL bInitSuccesful;
1016 };
1017
1018 struct PVRSRV_BRIDGE_IN_ALLOC_SHARED_SYS_MEM {
1019         u32 ui32BridgeFlags;
1020         u32 ui32Flags;
1021         u32 ui32Size;
1022 };
1023
1024 struct PVRSRV_BRIDGE_OUT_ALLOC_SHARED_SYS_MEM {
1025         enum PVRSRV_ERROR eError;
1026         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
1027         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
1028 };
1029
1030 struct PVRSRV_BRIDGE_IN_FREE_SHARED_SYS_MEM {
1031         u32 ui32BridgeFlags;
1032         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
1033         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
1034 };
1035
1036 struct PVRSRV_BRIDGE_OUT_FREE_SHARED_SYS_MEM {
1037         enum PVRSRV_ERROR eError;
1038 };
1039
1040 struct PVRSRV_BRIDGE_IN_MAP_MEMINFO_MEM {
1041         u32 ui32BridgeFlags;
1042         void *hKernelMemInfo;
1043 };
1044
1045 struct PVRSRV_BRIDGE_OUT_MAP_MEMINFO_MEM {
1046         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
1047         struct PVRSRV_CLIENT_SYNC_INFO sClientSyncInfo;
1048         struct PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
1049         struct PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfo;
1050         enum PVRSRV_ERROR eError;
1051 };
1052
1053 struct PVRSRV_BRIDGE_IN_UNMAP_MEMINFO_MEM {
1054         u32 ui32BridgeFlags;
1055         struct PVRSRV_CLIENT_MEM_INFO sClientMemInfo;
1056 };
1057
1058 struct PVRSRV_BRIDGE_OUT_UNMAP_MEMINFO_MEM {
1059         enum PVRSRV_ERROR eError;
1060 };
1061
1062 struct PVRSRV_BRIDGE_IN_GETMMU_PD_DEVPADDR {
1063         u32 ui32BridgeFlags;
1064         void *hDevMemContext;
1065 };
1066
1067 struct PVRSRV_BRIDGE_OUT_GETMMU_PD_DEVPADDR {
1068         struct IMG_DEV_PHYADDR sPDDevPAddr;
1069         enum PVRSRV_ERROR eError;
1070 };
1071
1072 struct PVRSRV_BRIDGE_IN_EVENT_OBJECT_WAIT {
1073         u32 ui32BridgeFlags;
1074         void *hOSEventKM;
1075 };
1076
1077 struct PVRSRV_BRIDGE_IN_EVENT_OBJECT_OPEN {
1078         struct PVRSRV_EVENTOBJECT sEventObject;
1079 };
1080
1081 struct PVRSRV_BRIDGE_OUT_EVENT_OBJECT_OPEN {
1082         void *hOSEvent;
1083         enum PVRSRV_ERROR eError;
1084 };
1085
1086 struct PVRSRV_BRIDGE_IN_EVENT_OBJECT_CLOSE {
1087         struct PVRSRV_EVENTOBJECT sEventObject;
1088         void *hOSEventKM;
1089 };
1090
1091 struct PVRSRV_BRIDGE_IN_MODIFY_SYNC_OPS {
1092         u32 ui32BridgeFlags;
1093         void *hKernelSyncInfo;
1094         u32 ui32ModifyFlags;
1095
1096 };
1097
1098 struct PVRSRV_BRIDGE_OUT_MODIFY_SYNC_OPS {
1099         enum PVRSRV_ERROR eError;
1100         u32 ui32ReadOpsPending;
1101         u32 ui32ReadOpsComplete;
1102         u32 ui32WriteOpsPending;
1103         u32 ui32WriteOpsComplete;
1104
1105 };
1106
1107 #endif