1 /*************************************************************************/ /*!
3 @Title Common bridge header for srvcore
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Declares common defines and structures that are used by both
6 the client and sever side of the bridge for srvcore
7 @License Dual MIT/GPLv2
9 The contents of this file are subject to the MIT license as set out below.
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is
16 furnished to do so, subject to the following conditions:
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
21 Alternatively, the contents of this file may be used under the terms of
22 the GNU General Public License Version 2 ("GPL") in which case the provisions
23 of GPL are applicable instead of those above.
25 If you wish to allow use of your version of this file only under the terms of
26 GPL, and not to allow others to use your version of this file under the terms
27 of the MIT license, indicate your decision by deleting the provisions above
28 and replace them with the notice and other provisions required by GPL as set
29 out in the file called "GPL-COPYING" included in this distribution. If you do
30 not delete the provisions above, a recipient may use your version of this file
31 under the terms of either the MIT license or GPL.
33 This License is also included in this distribution in the file called
36 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 */ /**************************************************************************/
45 #ifndef COMMON_SRVCORE_BRIDGE_H
46 #define COMMON_SRVCORE_BRIDGE_H
48 #include "pvrsrv_device_types.h"
49 #include "cache_external.h"
52 #include "pvr_bridge_io.h"
54 #define PVRSRV_BRIDGE_SRVCORE_CMD_FIRST (PVRSRV_BRIDGE_SRVCORE_START)
55 #define PVRSRV_BRIDGE_SRVCORE_CONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+0)
56 #define PVRSRV_BRIDGE_SRVCORE_DISCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+1)
57 #define PVRSRV_BRIDGE_SRVCORE_ENUMERATEDEVICES PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+2)
58 #define PVRSRV_BRIDGE_SRVCORE_ACQUIREDEVICEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+3)
59 #define PVRSRV_BRIDGE_SRVCORE_RELEASEDEVICEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+4)
60 #define PVRSRV_BRIDGE_SRVCORE_INITSRVDISCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+5)
61 #define PVRSRV_BRIDGE_SRVCORE_ACQUIREGLOBALEVENTOBJECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+6)
62 #define PVRSRV_BRIDGE_SRVCORE_RELEASEGLOBALEVENTOBJECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+7)
63 #define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTOPEN PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+8)
64 #define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTWAIT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+9)
65 #define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTCLOSE PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+10)
66 #define PVRSRV_BRIDGE_SRVCORE_DUMPDEBUGINFO PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+11)
67 #define PVRSRV_BRIDGE_SRVCORE_GETDEVCLOCKSPEED PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+12)
68 #define PVRSRV_BRIDGE_SRVCORE_HWOPTIMEOUT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+13)
69 #define PVRSRV_BRIDGE_SRVCORE_KICKDEVICES PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+14)
70 #define PVRSRV_BRIDGE_SRVCORE_RESETHWRLOGS PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+15)
71 #define PVRSRV_BRIDGE_SRVCORE_SOFTRESET PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+16)
72 #define PVRSRV_BRIDGE_SRVCORE_CMD_LAST (PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+16)
75 /*******************************************
77 *******************************************/
79 /* Bridge in structure for Connect */
80 typedef struct PVRSRV_BRIDGE_IN_CONNECT_TAG
83 IMG_UINT32 ui32ClientBuildOptions;
84 IMG_UINT32 ui32ClientDDKVersion;
85 IMG_UINT32 ui32ClientDDKBuild;
86 } __attribute__((packed)) PVRSRV_BRIDGE_IN_CONNECT;
89 /* Bridge out structure for Connect */
90 typedef struct PVRSRV_BRIDGE_OUT_CONNECT_TAG
92 IMG_UINT8 ui8KernelArch;
93 IMG_UINT32 ui32Log2PageSize;
95 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_CONNECT;
97 /*******************************************
99 *******************************************/
101 /* Bridge in structure for Disconnect */
102 typedef struct PVRSRV_BRIDGE_IN_DISCONNECT_TAG
104 IMG_UINT32 ui32EmptyStructPlaceholder;
105 } __attribute__((packed)) PVRSRV_BRIDGE_IN_DISCONNECT;
108 /* Bridge out structure for Disconnect */
109 typedef struct PVRSRV_BRIDGE_OUT_DISCONNECT_TAG
112 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_DISCONNECT;
114 /*******************************************
116 *******************************************/
118 /* Bridge in structure for EnumerateDevices */
119 typedef struct PVRSRV_BRIDGE_IN_ENUMERATEDEVICES_TAG
121 /* Output pointer peDeviceType is also an implied input */
122 PVRSRV_DEVICE_TYPE * peDeviceType;
123 /* Output pointer peDeviceClass is also an implied input */
124 PVRSRV_DEVICE_CLASS * peDeviceClass;
125 /* Output pointer pui32DeviceIndex is also an implied input */
126 IMG_UINT32 * pui32DeviceIndex;
127 } __attribute__((packed)) PVRSRV_BRIDGE_IN_ENUMERATEDEVICES;
130 /* Bridge out structure for EnumerateDevices */
131 typedef struct PVRSRV_BRIDGE_OUT_ENUMERATEDEVICES_TAG
133 IMG_UINT32 ui32NumDevices;
134 PVRSRV_DEVICE_TYPE * peDeviceType;
135 PVRSRV_DEVICE_CLASS * peDeviceClass;
136 IMG_UINT32 * pui32DeviceIndex;
138 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_ENUMERATEDEVICES;
140 /*******************************************
142 *******************************************/
144 /* Bridge in structure for AcquireDeviceData */
145 typedef struct PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA_TAG
147 IMG_UINT32 ui32DevIndex;
148 PVRSRV_DEVICE_TYPE eDeviceType;
149 } __attribute__((packed)) PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA;
152 /* Bridge out structure for AcquireDeviceData */
153 typedef struct PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA_TAG
155 IMG_HANDLE hDevCookie;
157 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA;
159 /*******************************************
161 *******************************************/
163 /* Bridge in structure for ReleaseDeviceData */
164 typedef struct PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA_TAG
166 IMG_HANDLE hDevCookie;
167 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA;
170 /* Bridge out structure for ReleaseDeviceData */
171 typedef struct PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA_TAG
174 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA;
176 /*******************************************
178 *******************************************/
180 /* Bridge in structure for InitSrvDisconnect */
181 typedef struct PVRSRV_BRIDGE_IN_INITSRVDISCONNECT_TAG
183 IMG_BOOL bInitSuccesful;
184 IMG_UINT32 ui32ClientBuildOptions;
185 } __attribute__((packed)) PVRSRV_BRIDGE_IN_INITSRVDISCONNECT;
188 /* Bridge out structure for InitSrvDisconnect */
189 typedef struct PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT_TAG
192 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT;
194 /*******************************************
195 AcquireGlobalEventObject
196 *******************************************/
198 /* Bridge in structure for AcquireGlobalEventObject */
199 typedef struct PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT_TAG
201 IMG_UINT32 ui32EmptyStructPlaceholder;
202 } __attribute__((packed)) PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT;
205 /* Bridge out structure for AcquireGlobalEventObject */
206 typedef struct PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT_TAG
208 IMG_HANDLE hGlobalEventObject;
210 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT;
212 /*******************************************
213 ReleaseGlobalEventObject
214 *******************************************/
216 /* Bridge in structure for ReleaseGlobalEventObject */
217 typedef struct PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT_TAG
219 IMG_HANDLE hGlobalEventObject;
220 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT;
223 /* Bridge out structure for ReleaseGlobalEventObject */
224 typedef struct PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT_TAG
227 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT;
229 /*******************************************
231 *******************************************/
233 /* Bridge in structure for EventObjectOpen */
234 typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN_TAG
236 IMG_HANDLE hEventObject;
237 } __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN;
240 /* Bridge out structure for EventObjectOpen */
241 typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN_TAG
245 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN;
247 /*******************************************
249 *******************************************/
251 /* Bridge in structure for EventObjectWait */
252 typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT_TAG
254 IMG_HANDLE hOSEventKM;
255 } __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT;
258 /* Bridge out structure for EventObjectWait */
259 typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT_TAG
262 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT;
264 /*******************************************
266 *******************************************/
268 /* Bridge in structure for EventObjectClose */
269 typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE_TAG
271 IMG_HANDLE hOSEventKM;
272 } __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE;
275 /* Bridge out structure for EventObjectClose */
276 typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE_TAG
279 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE;
281 /*******************************************
283 *******************************************/
285 /* Bridge in structure for DumpDebugInfo */
286 typedef struct PVRSRV_BRIDGE_IN_DUMPDEBUGINFO_TAG
288 IMG_UINT32 ui32ui32VerbLevel;
289 } __attribute__((packed)) PVRSRV_BRIDGE_IN_DUMPDEBUGINFO;
292 /* Bridge out structure for DumpDebugInfo */
293 typedef struct PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO_TAG
296 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO;
298 /*******************************************
300 *******************************************/
302 /* Bridge in structure for GetDevClockSpeed */
303 typedef struct PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED_TAG
306 } __attribute__((packed)) PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED;
309 /* Bridge out structure for GetDevClockSpeed */
310 typedef struct PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED_TAG
312 IMG_UINT32 ui32ui32RGXClockSpeed;
314 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED;
316 /*******************************************
318 *******************************************/
320 /* Bridge in structure for HWOpTimeout */
321 typedef struct PVRSRV_BRIDGE_IN_HWOPTIMEOUT_TAG
323 IMG_UINT32 ui32EmptyStructPlaceholder;
324 } __attribute__((packed)) PVRSRV_BRIDGE_IN_HWOPTIMEOUT;
327 /* Bridge out structure for HWOpTimeout */
328 typedef struct PVRSRV_BRIDGE_OUT_HWOPTIMEOUT_TAG
331 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_HWOPTIMEOUT;
333 /*******************************************
335 *******************************************/
337 /* Bridge in structure for KickDevices */
338 typedef struct PVRSRV_BRIDGE_IN_KICKDEVICES_TAG
340 IMG_UINT32 ui32EmptyStructPlaceholder;
341 } __attribute__((packed)) PVRSRV_BRIDGE_IN_KICKDEVICES;
344 /* Bridge out structure for KickDevices */
345 typedef struct PVRSRV_BRIDGE_OUT_KICKDEVICES_TAG
348 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_KICKDEVICES;
350 /*******************************************
352 *******************************************/
354 /* Bridge in structure for ResetHWRLogs */
355 typedef struct PVRSRV_BRIDGE_IN_RESETHWRLOGS_TAG
358 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RESETHWRLOGS;
361 /* Bridge out structure for ResetHWRLogs */
362 typedef struct PVRSRV_BRIDGE_OUT_RESETHWRLOGS_TAG
365 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RESETHWRLOGS;
367 /*******************************************
369 *******************************************/
371 /* Bridge in structure for SoftReset */
372 typedef struct PVRSRV_BRIDGE_IN_SOFTRESET_TAG
375 IMG_UINT64 ui64ResetValue;
376 } __attribute__((packed)) PVRSRV_BRIDGE_IN_SOFTRESET;
379 /* Bridge out structure for SoftReset */
380 typedef struct PVRSRV_BRIDGE_OUT_SOFTRESET_TAG
383 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_SOFTRESET;
385 #endif /* COMMON_SRVCORE_BRIDGE_H */