Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue / generated / srvcore_bridge / common_srvcore_bridge.h
1 /*************************************************************************/ /*!
2 @File
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
8
9 The contents of this file are subject to the MIT license as set out below.
10
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:
17
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
20
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.
24
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.
32
33 This License is also included in this distribution in the file called
34 "MIT-COPYING".
35
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 */ /**************************************************************************/
44
45 #ifndef COMMON_SRVCORE_BRIDGE_H
46 #define COMMON_SRVCORE_BRIDGE_H
47
48 #include "pvrsrv_device_types.h"
49 #include "cache_external.h"
50
51
52 #include "pvr_bridge_io.h"
53
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)
73
74
75 /*******************************************
76             Connect          
77  *******************************************/
78
79 /* Bridge in structure for Connect */
80 typedef struct PVRSRV_BRIDGE_IN_CONNECT_TAG
81 {
82         IMG_UINT32 ui32Flags;
83         IMG_UINT32 ui32ClientBuildOptions;
84         IMG_UINT32 ui32ClientDDKVersion;
85         IMG_UINT32 ui32ClientDDKBuild;
86 } __attribute__((packed)) PVRSRV_BRIDGE_IN_CONNECT;
87
88
89 /* Bridge out structure for Connect */
90 typedef struct PVRSRV_BRIDGE_OUT_CONNECT_TAG
91 {
92         IMG_UINT8 ui8KernelArch;
93         IMG_UINT32 ui32Log2PageSize;
94         PVRSRV_ERROR eError;
95 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_CONNECT;
96
97 /*******************************************
98             Disconnect          
99  *******************************************/
100
101 /* Bridge in structure for Disconnect */
102 typedef struct PVRSRV_BRIDGE_IN_DISCONNECT_TAG
103 {
104          IMG_UINT32 ui32EmptyStructPlaceholder;
105 } __attribute__((packed)) PVRSRV_BRIDGE_IN_DISCONNECT;
106
107
108 /* Bridge out structure for Disconnect */
109 typedef struct PVRSRV_BRIDGE_OUT_DISCONNECT_TAG
110 {
111         PVRSRV_ERROR eError;
112 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_DISCONNECT;
113
114 /*******************************************
115             EnumerateDevices          
116  *******************************************/
117
118 /* Bridge in structure for EnumerateDevices */
119 typedef struct PVRSRV_BRIDGE_IN_ENUMERATEDEVICES_TAG
120 {
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;
128
129
130 /* Bridge out structure for EnumerateDevices */
131 typedef struct PVRSRV_BRIDGE_OUT_ENUMERATEDEVICES_TAG
132 {
133         IMG_UINT32 ui32NumDevices;
134         PVRSRV_DEVICE_TYPE * peDeviceType;
135         PVRSRV_DEVICE_CLASS * peDeviceClass;
136         IMG_UINT32 * pui32DeviceIndex;
137         PVRSRV_ERROR eError;
138 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_ENUMERATEDEVICES;
139
140 /*******************************************
141             AcquireDeviceData          
142  *******************************************/
143
144 /* Bridge in structure for AcquireDeviceData */
145 typedef struct PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA_TAG
146 {
147         IMG_UINT32 ui32DevIndex;
148         PVRSRV_DEVICE_TYPE eDeviceType;
149 } __attribute__((packed)) PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA;
150
151
152 /* Bridge out structure for AcquireDeviceData */
153 typedef struct PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA_TAG
154 {
155         IMG_HANDLE hDevCookie;
156         PVRSRV_ERROR eError;
157 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA;
158
159 /*******************************************
160             ReleaseDeviceData          
161  *******************************************/
162
163 /* Bridge in structure for ReleaseDeviceData */
164 typedef struct PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA_TAG
165 {
166         IMG_HANDLE hDevCookie;
167 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA;
168
169
170 /* Bridge out structure for ReleaseDeviceData */
171 typedef struct PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA_TAG
172 {
173         PVRSRV_ERROR eError;
174 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA;
175
176 /*******************************************
177             InitSrvDisconnect          
178  *******************************************/
179
180 /* Bridge in structure for InitSrvDisconnect */
181 typedef struct PVRSRV_BRIDGE_IN_INITSRVDISCONNECT_TAG
182 {
183         IMG_BOOL bInitSuccesful;
184         IMG_UINT32 ui32ClientBuildOptions;
185 } __attribute__((packed)) PVRSRV_BRIDGE_IN_INITSRVDISCONNECT;
186
187
188 /* Bridge out structure for InitSrvDisconnect */
189 typedef struct PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT_TAG
190 {
191         PVRSRV_ERROR eError;
192 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT;
193
194 /*******************************************
195             AcquireGlobalEventObject          
196  *******************************************/
197
198 /* Bridge in structure for AcquireGlobalEventObject */
199 typedef struct PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT_TAG
200 {
201          IMG_UINT32 ui32EmptyStructPlaceholder;
202 } __attribute__((packed)) PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT;
203
204
205 /* Bridge out structure for AcquireGlobalEventObject */
206 typedef struct PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT_TAG
207 {
208         IMG_HANDLE hGlobalEventObject;
209         PVRSRV_ERROR eError;
210 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT;
211
212 /*******************************************
213             ReleaseGlobalEventObject          
214  *******************************************/
215
216 /* Bridge in structure for ReleaseGlobalEventObject */
217 typedef struct PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT_TAG
218 {
219         IMG_HANDLE hGlobalEventObject;
220 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT;
221
222
223 /* Bridge out structure for ReleaseGlobalEventObject */
224 typedef struct PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT_TAG
225 {
226         PVRSRV_ERROR eError;
227 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT;
228
229 /*******************************************
230             EventObjectOpen          
231  *******************************************/
232
233 /* Bridge in structure for EventObjectOpen */
234 typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN_TAG
235 {
236         IMG_HANDLE hEventObject;
237 } __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN;
238
239
240 /* Bridge out structure for EventObjectOpen */
241 typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN_TAG
242 {
243         IMG_HANDLE hOSEvent;
244         PVRSRV_ERROR eError;
245 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN;
246
247 /*******************************************
248             EventObjectWait          
249  *******************************************/
250
251 /* Bridge in structure for EventObjectWait */
252 typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT_TAG
253 {
254         IMG_HANDLE hOSEventKM;
255 } __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT;
256
257
258 /* Bridge out structure for EventObjectWait */
259 typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT_TAG
260 {
261         PVRSRV_ERROR eError;
262 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT;
263
264 /*******************************************
265             EventObjectClose          
266  *******************************************/
267
268 /* Bridge in structure for EventObjectClose */
269 typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE_TAG
270 {
271         IMG_HANDLE hOSEventKM;
272 } __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE;
273
274
275 /* Bridge out structure for EventObjectClose */
276 typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE_TAG
277 {
278         PVRSRV_ERROR eError;
279 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE;
280
281 /*******************************************
282             DumpDebugInfo          
283  *******************************************/
284
285 /* Bridge in structure for DumpDebugInfo */
286 typedef struct PVRSRV_BRIDGE_IN_DUMPDEBUGINFO_TAG
287 {
288         IMG_UINT32 ui32ui32VerbLevel;
289 } __attribute__((packed)) PVRSRV_BRIDGE_IN_DUMPDEBUGINFO;
290
291
292 /* Bridge out structure for DumpDebugInfo */
293 typedef struct PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO_TAG
294 {
295         PVRSRV_ERROR eError;
296 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO;
297
298 /*******************************************
299             GetDevClockSpeed          
300  *******************************************/
301
302 /* Bridge in structure for GetDevClockSpeed */
303 typedef struct PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED_TAG
304 {
305         IMG_HANDLE hDevNode;
306 } __attribute__((packed)) PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED;
307
308
309 /* Bridge out structure for GetDevClockSpeed */
310 typedef struct PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED_TAG
311 {
312         IMG_UINT32 ui32ui32RGXClockSpeed;
313         PVRSRV_ERROR eError;
314 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED;
315
316 /*******************************************
317             HWOpTimeout          
318  *******************************************/
319
320 /* Bridge in structure for HWOpTimeout */
321 typedef struct PVRSRV_BRIDGE_IN_HWOPTIMEOUT_TAG
322 {
323          IMG_UINT32 ui32EmptyStructPlaceholder;
324 } __attribute__((packed)) PVRSRV_BRIDGE_IN_HWOPTIMEOUT;
325
326
327 /* Bridge out structure for HWOpTimeout */
328 typedef struct PVRSRV_BRIDGE_OUT_HWOPTIMEOUT_TAG
329 {
330         PVRSRV_ERROR eError;
331 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_HWOPTIMEOUT;
332
333 /*******************************************
334             KickDevices          
335  *******************************************/
336
337 /* Bridge in structure for KickDevices */
338 typedef struct PVRSRV_BRIDGE_IN_KICKDEVICES_TAG
339 {
340          IMG_UINT32 ui32EmptyStructPlaceholder;
341 } __attribute__((packed)) PVRSRV_BRIDGE_IN_KICKDEVICES;
342
343
344 /* Bridge out structure for KickDevices */
345 typedef struct PVRSRV_BRIDGE_OUT_KICKDEVICES_TAG
346 {
347         PVRSRV_ERROR eError;
348 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_KICKDEVICES;
349
350 /*******************************************
351             ResetHWRLogs          
352  *******************************************/
353
354 /* Bridge in structure for ResetHWRLogs */
355 typedef struct PVRSRV_BRIDGE_IN_RESETHWRLOGS_TAG
356 {
357         IMG_HANDLE hDevNode;
358 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RESETHWRLOGS;
359
360
361 /* Bridge out structure for ResetHWRLogs */
362 typedef struct PVRSRV_BRIDGE_OUT_RESETHWRLOGS_TAG
363 {
364         PVRSRV_ERROR eError;
365 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RESETHWRLOGS;
366
367 /*******************************************
368             SoftReset          
369  *******************************************/
370
371 /* Bridge in structure for SoftReset */
372 typedef struct PVRSRV_BRIDGE_IN_SOFTRESET_TAG
373 {
374         IMG_HANDLE hDevNode;
375         IMG_UINT64 ui64ResetValue;
376 } __attribute__((packed)) PVRSRV_BRIDGE_IN_SOFTRESET;
377
378
379 /* Bridge out structure for SoftReset */
380 typedef struct PVRSRV_BRIDGE_OUT_SOFTRESET_TAG
381 {
382         PVRSRV_ERROR eError;
383 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_SOFTRESET;
384
385 #endif /* COMMON_SRVCORE_BRIDGE_H */