RK3368 GPU version Rogue M 1.28
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue_m / generated / rgxtq_bridge / common_rgxtq_bridge.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          Common bridge header for rgxtq
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 rgxtq
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_RGXTQ_BRIDGE_H
46 #define COMMON_RGXTQ_BRIDGE_H
47
48 #include "img_types.h"
49 #include "pvrsrv_error.h"
50
51 #include "rgx_bridge.h"
52 #include "sync_external.h"
53 #include "rgx_fwif_shared.h"
54
55
56 #define PVRSRV_BRIDGE_RGXTQ_CMD_FIRST                   0
57 #define PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT                    PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+0
58 #define PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT                   PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+1
59 #define PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER                   PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+2
60 #define PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY                       PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+3
61 #define PVRSRV_BRIDGE_RGXTQ_RGXKICKSYNCTRANSFER                 PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4
62 #define PVRSRV_BRIDGE_RGXTQ_CMD_LAST                    (PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4)
63
64
65 /*******************************************
66             RGXCreateTransferContext          
67  *******************************************/
68
69 /* Bridge in structure for RGXCreateTransferContext */
70 typedef struct PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT_TAG
71 {
72         IMG_HANDLE hDevNode;
73         IMG_UINT32 ui32Priority;
74         IMG_DEV_VIRTADDR sMCUFenceAddr;
75         IMG_UINT32 ui32FrameworkCmdize;
76         IMG_BYTE * psFrameworkCmd;
77         IMG_HANDLE hPrivData;
78 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT;
79
80
81 /* Bridge out structure for RGXCreateTransferContext */
82 typedef struct PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT_TAG
83 {
84         IMG_HANDLE hTransferContext;
85         PVRSRV_ERROR eError;
86 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT;
87
88 /*******************************************
89             RGXDestroyTransferContext          
90  *******************************************/
91
92 /* Bridge in structure for RGXDestroyTransferContext */
93 typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT_TAG
94 {
95         IMG_HANDLE hTransferContext;
96 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT;
97
98
99 /* Bridge out structure for RGXDestroyTransferContext */
100 typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT_TAG
101 {
102         PVRSRV_ERROR eError;
103 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT;
104
105 /*******************************************
106             RGXSubmitTransfer          
107  *******************************************/
108
109 /* Bridge in structure for RGXSubmitTransfer */
110 typedef struct PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER_TAG
111 {
112         IMG_HANDLE hTransferContext;
113         IMG_UINT32 ui32PrepareCount;
114         IMG_UINT32 * pui32ClientFenceCount;
115         IMG_HANDLE* * phFenceUFOSyncPrimBlock;
116         IMG_UINT32* * pui32FenceSyncOffset;
117         IMG_UINT32* * pui32FenceValue;
118         IMG_UINT32 * pui32ClientUpdateCount;
119         IMG_HANDLE* * phUpdateUFOSyncPrimBlock;
120         IMG_UINT32* * pui32UpdateSyncOffset;
121         IMG_UINT32* * pui32UpdateValue;
122         IMG_UINT32 * pui32ServerSyncCount;
123         IMG_UINT32* * pui32ServerSyncFlags;
124         IMG_HANDLE* * phServerSync;
125         IMG_UINT32 ui32NumCheckFenceFDs;
126         IMG_INT32 * pi32CheckFenceFDs;
127         IMG_INT32 i32UpdateFenceFD;
128         IMG_UINT32 * pui32CommandSize;
129         IMG_UINT8* * pui8FWCommand;
130         IMG_UINT32 * pui32TQPrepareFlags;
131         IMG_UINT32 ui32ExternalJobReference;
132         IMG_UINT32 ui32InternalJobReference;
133 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER;
134
135
136 /* Bridge out structure for RGXSubmitTransfer */
137 typedef struct PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER_TAG
138 {
139         PVRSRV_ERROR eError;
140 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER;
141
142 /*******************************************
143             RGXSetTransferContextPriority          
144  *******************************************/
145
146 /* Bridge in structure for RGXSetTransferContextPriority */
147 typedef struct PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY_TAG
148 {
149         IMG_HANDLE hTransferContext;
150         IMG_UINT32 ui32Priority;
151 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY;
152
153
154 /* Bridge out structure for RGXSetTransferContextPriority */
155 typedef struct PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY_TAG
156 {
157         PVRSRV_ERROR eError;
158 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY;
159
160 /*******************************************
161             RGXKickSyncTransfer          
162  *******************************************/
163
164 /* Bridge in structure for RGXKickSyncTransfer */
165 typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER_TAG
166 {
167         IMG_HANDLE hTransferContext;
168         IMG_UINT32 ui32ClientFenceCount;
169         IMG_HANDLE * phClientFenceUFOSyncPrimBlock;
170         IMG_UINT32 * pui32ClientFenceSyncOffset;
171         IMG_UINT32 * pui32ClientFenceValue;
172         IMG_UINT32 ui32ClientUpdateCount;
173         IMG_HANDLE * phClientUpdateUFOSyncPrimBlock;
174         IMG_UINT32 * pui32ClientUpdateSyncOffset;
175         IMG_UINT32 * pui32ClientUpdateValue;
176         IMG_UINT32 ui32ServerSyncCount;
177         IMG_UINT32 * pui32ServerSyncFlags;
178         IMG_HANDLE * phServerSyncs;
179         IMG_UINT32 ui32NumCheckFenceFDs;
180         IMG_INT32 * pi32CheckFenceFDs;
181         IMG_INT32 i32UpdateFenceFD;
182         IMG_UINT32 ui32TQPrepareFlags;
183 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER;
184
185
186 /* Bridge out structure for RGXKickSyncTransfer */
187 typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER_TAG
188 {
189         PVRSRV_ERROR eError;
190 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER;
191
192 #endif /* COMMON_RGXTQ_BRIDGE_H */