1 /*************************************************************************/ /*!
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
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_RGXTQ_BRIDGE_H
46 #define COMMON_RGXTQ_BRIDGE_H
48 #include "img_types.h"
49 #include "pvrsrv_error.h"
51 #include "rgx_bridge.h"
52 #include "sync_external.h"
53 #include "rgx_fwif_shared.h"
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)
65 /*******************************************
66 RGXCreateTransferContext
67 *******************************************/
69 /* Bridge in structure for RGXCreateTransferContext */
70 typedef struct PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT_TAG
73 IMG_UINT32 ui32Priority;
74 IMG_DEV_VIRTADDR sMCUFenceAddr;
75 IMG_UINT32 ui32FrameworkCmdize;
76 IMG_BYTE * psFrameworkCmd;
78 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT;
81 /* Bridge out structure for RGXCreateTransferContext */
82 typedef struct PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT_TAG
84 IMG_HANDLE hTransferContext;
86 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT;
88 /*******************************************
89 RGXDestroyTransferContext
90 *******************************************/
92 /* Bridge in structure for RGXDestroyTransferContext */
93 typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT_TAG
95 IMG_HANDLE hTransferContext;
96 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT;
99 /* Bridge out structure for RGXDestroyTransferContext */
100 typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT_TAG
103 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT;
105 /*******************************************
107 *******************************************/
109 /* Bridge in structure for RGXSubmitTransfer */
110 typedef struct PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER_TAG
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;
136 /* Bridge out structure for RGXSubmitTransfer */
137 typedef struct PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER_TAG
140 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER;
142 /*******************************************
143 RGXSetTransferContextPriority
144 *******************************************/
146 /* Bridge in structure for RGXSetTransferContextPriority */
147 typedef struct PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY_TAG
149 IMG_HANDLE hTransferContext;
150 IMG_UINT32 ui32Priority;
151 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY;
154 /* Bridge out structure for RGXSetTransferContextPriority */
155 typedef struct PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY_TAG
158 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY;
160 /*******************************************
162 *******************************************/
164 /* Bridge in structure for RGXKickSyncTransfer */
165 typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER_TAG
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;
186 /* Bridge out structure for RGXKickSyncTransfer */
187 typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER_TAG
190 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER;
192 #endif /* COMMON_RGXTQ_BRIDGE_H */