1 /*************************************************************************/ /*!
3 @Title PVR Bridge Functionality
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Header for the PVR Bridge code
6 @License Dual MIT/GPLv2
8 The contents of this file are subject to the MIT license as set out below.
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
32 This License is also included in this distribution in the file called
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
44 #ifndef __PVR_BRIDGE_H__
45 #define __PVR_BRIDGE_H__
47 #if defined (__cplusplus)
51 #include "pvrsrv_error.h"
52 #include "cache_defines.h"
54 #if defined(SUPPORT_DISPLAY_CLASS)
55 #include "common_dc_bridge.h"
57 #include "common_mm_bridge.h"
58 #if defined(SUPPORT_MMPLAT_BRIDGE)
59 #include "common_mmplat_bridge.h"
61 #include "common_cmm_bridge.h"
62 #include "common_pdumpmm_bridge.h"
63 #include "common_pdump_bridge.h"
64 #if defined(SUPPORT_ION)
65 #include "common_dmabuf_bridge.h"
67 #include "common_pdumpctrl_bridge.h"
68 #include "common_srvcore_bridge.h"
69 #include "common_sync_bridge.h"
70 #if defined(SUPPORT_INSECURE_EXPORT)
71 #include "common_syncexport_bridge.h"
73 #if defined(SUPPORT_SECURE_EXPORT)
74 #include "common_syncsexport_bridge.h"
76 #if (CACHEFLUSH_TYPE == CACHEFLUSH_GENERIC)
77 #include "common_cachegeneric_bridge.h"
79 #if defined(SUPPORT_SECURE_EXPORT)
80 #include "common_smm_bridge.h"
82 #include "common_pvrtl_bridge.h"
83 #if defined(PVR_RI_DEBUG)
84 #include "common_ri_bridge.h"
87 #if defined(SUPPORT_VALIDATION)
88 #include "common_validation_bridge.h"
91 #if defined(PVR_TESTING_UTILS)
92 #include "common_tutils_bridge.h"
95 #if defined(SUPPORT_PAGE_FAULT_DEBUG)
96 #include "common_devicememhistory_bridge.h"
105 * #define PVRSRV_BRIDGE_FEATURE (PVRSRV_BRIDGE_PREVFEATURE + 1)
106 * #if defined(SUPPORT_FEATURE)
107 * #define PVRSRV_BRIDGE_FEATURE_DISPATCH_FIRST (PVRSRV_BRIDGE_PREVFEATURE_DISPATCH_LAST + 1)
108 * #define PVRSRV_BRIDGE_FEATURE_DISPATCH_LAST (PVRSRV_BRIDGE_FEATURE_DISPATCH_FIRST + PVRSRV_BRIDGE_FEATURE_CMD_LAST)
110 * #define PVRSRV_BRIDGE_FEATURE_DISPATCH_FIRST 0
111 * #define PVRSRV_BRIDGE_FEATURE_DISPATCH_LAST (PVRSRV_BRIDGE_PREVFEATURE_DISPATCH_LAST)
113 * is used in the macro definitions below to make PVRSRV_BRIDGE_FEATURE_*
114 * take up no space in the dispatch table if SUPPORT_FEATURE is disabled.
116 * Note however that a bridge always defines PVRSRV_BRIDGE_FEATURE, even where
117 * the feature is not enabled (each bridge group retains its own ioctl number).
120 /* 0: CORE functions */
121 #define PVRSRV_BRIDGE_SRVCORE 0UL
122 #define PVRSRV_BRIDGE_SRVCORE_DISPATCH_FIRST 0UL
123 #define PVRSRV_BRIDGE_SRVCORE_DISPATCH_LAST (PVRSRV_BRIDGE_SRVCORE_DISPATCH_FIRST + PVRSRV_BRIDGE_SRVCORE_CMD_LAST)
125 /* 1: SYNC functions */
126 #define PVRSRV_BRIDGE_SYNC 1UL
127 #define PVRSRV_BRIDGE_SYNC_DISPATCH_FIRST (PVRSRV_BRIDGE_SRVCORE_DISPATCH_LAST + 1)
128 #define PVRSRV_BRIDGE_SYNC_DISPATCH_LAST (PVRSRV_BRIDGE_SYNC_DISPATCH_FIRST + PVRSRV_BRIDGE_SYNC_CMD_LAST)
130 /* 2: SYNCEXPORT functions */
131 #define PVRSRV_BRIDGE_SYNCEXPORT 2UL
132 #if defined(SUPPORT_INSECURE_EXPORT)
133 #define PVRSRV_BRIDGE_SYNCEXPORT_DISPATCH_FIRST (PVRSRV_BRIDGE_SYNC_DISPATCH_LAST + 1)
134 #define PVRSRV_BRIDGE_SYNCEXPORT_DISPATCH_LAST (PVRSRV_BRIDGE_SYNCEXPORT_DISPATCH_FIRST + PVRSRV_BRIDGE_SYNCEXPORT_CMD_LAST)
136 #define PVRSRV_BRIDGE_SYNCEXPORT_DISPATCH_FIRST 0
137 #define PVRSRV_BRIDGE_SYNCEXPORT_DISPATCH_LAST (PVRSRV_BRIDGE_SYNC_DISPATCH_LAST)
140 /* 3: SYNCSEXPORT functions */
141 #define PVRSRV_BRIDGE_SYNCSEXPORT 3UL
142 #if defined(SUPPORT_SECURE_EXPORT)
143 #define PVRSRV_BRIDGE_SYNCSEXPORT_DISPATCH_FIRST (PVRSRV_BRIDGE_SYNCEXPORT_DISPATCH_LAST + 1)
144 #define PVRSRV_BRIDGE_SYNCSEXPORT_DISPATCH_LAST (PVRSRV_BRIDGE_SYNCSEXPORT_DISPATCH_FIRST + PVRSRV_BRIDGE_SYNCSEXPORT_CMD_LAST)
146 #define PVRSRV_BRIDGE_SYNCSEXPORT_DISPATCH_FIRST 0
147 #define PVRSRV_BRIDGE_SYNCSEXPORT_DISPATCH_LAST (PVRSRV_BRIDGE_SYNCEXPORT_DISPATCH_LAST)
150 /* 4: PDUMP CTRL layer functions*/
151 #define PVRSRV_BRIDGE_PDUMPCTRL 4UL
152 #define PVRSRV_BRIDGE_PDUMPCTRL_DISPATCH_FIRST (PVRSRV_BRIDGE_SYNCSEXPORT_DISPATCH_LAST + 1)
153 #define PVRSRV_BRIDGE_PDUMPCTRL_DISPATCH_LAST (PVRSRV_BRIDGE_PDUMPCTRL_DISPATCH_FIRST + PVRSRV_BRIDGE_PDUMPCTRL_CMD_LAST)
155 /* 5: Memory Management functions */
156 #define PVRSRV_BRIDGE_MM 5UL
157 #define PVRSRV_BRIDGE_MM_DISPATCH_FIRST (PVRSRV_BRIDGE_PDUMPCTRL_DISPATCH_LAST + 1)
158 #define PVRSRV_BRIDGE_MM_DISPATCH_LAST (PVRSRV_BRIDGE_MM_DISPATCH_FIRST + PVRSRV_BRIDGE_MM_CMD_LAST)
160 /* 6: Non-Linux Memory Management functions */
161 #define PVRSRV_BRIDGE_MMPLAT 6UL
162 #if defined(SUPPORT_MMPLAT_BRIDGE)
163 #define PVRSRV_BRIDGE_MMPLAT_DISPATCH_FIRST (PVRSRV_BRIDGE_MM_DISPATCH_LAST + 1)
164 #define PVRSRV_BRIDGE_MMPLAT_DISPATCH_LAST (PVRSRV_BRIDGE_MMPLAT_DISPATCH_FIRST + PVRSRV_BRIDGE_MMPLAT_CMD_LAST)
166 #define PVRSRV_BRIDGE_MMPLAT_DISPATCH_FIRST 0
167 #define PVRSRV_BRIDGE_MMPLAT_DISPATCH_LAST (PVRSRV_BRIDGE_MM_DISPATCH_LAST)
170 /* 7: Context Memory Management functions */
171 #define PVRSRV_BRIDGE_CMM 7UL
172 #define PVRSRV_BRIDGE_CMM_DISPATCH_FIRST (PVRSRV_BRIDGE_MMPLAT_DISPATCH_LAST + 1)
173 #define PVRSRV_BRIDGE_CMM_DISPATCH_LAST (PVRSRV_BRIDGE_CMM_DISPATCH_FIRST + PVRSRV_BRIDGE_CMM_CMD_LAST)
175 /* 8: PDUMP Memory Management functions */
176 #define PVRSRV_BRIDGE_PDUMPMM 8UL
177 #define PVRSRV_BRIDGE_PDUMPMM_DISPATCH_FIRST (PVRSRV_BRIDGE_CMM_DISPATCH_LAST + 1)
178 #define PVRSRV_BRIDGE_PDUMPMM_DISPATCH_LAST (PVRSRV_BRIDGE_PDUMPMM_DISPATCH_FIRST + PVRSRV_BRIDGE_PDUMPMM_CMD_LAST)
180 /* 9: PDUMP functions */
181 #define PVRSRV_BRIDGE_PDUMP 9UL
182 #define PVRSRV_BRIDGE_PDUMP_DISPATCH_FIRST (PVRSRV_BRIDGE_PDUMPMM_DISPATCH_LAST + 1)
183 #define PVRSRV_BRIDGE_PDUMP_DISPATCH_LAST (PVRSRV_BRIDGE_PDUMP_DISPATCH_FIRST + PVRSRV_BRIDGE_PDUMP_CMD_LAST)
185 /* 10: DMABUF functions */
186 #define PVRSRV_BRIDGE_DMABUF 10UL
187 #if defined(SUPPORT_ION)
188 #define PVRSRV_BRIDGE_DMABUF_DISPATCH_FIRST (PVRSRV_BRIDGE_PDUMP_DISPATCH_LAST + 1)
189 #define PVRSRV_BRIDGE_DMABUF_DISPATCH_LAST (PVRSRV_BRIDGE_DMABUF_DISPATCH_FIRST + PVRSRV_BRIDGE_DMABUF_CMD_LAST)
191 #define PVRSRV_BRIDGE_DMABUF_DISPATCH_FIRST 0
192 #define PVRSRV_BRIDGE_DMABUF_DISPATCH_LAST (PVRSRV_BRIDGE_PDUMP_DISPATCH_LAST)
195 /* 11: Display Class functions */
196 #define PVRSRV_BRIDGE_DC 11UL
197 #if defined(SUPPORT_DISPLAY_CLASS)
198 #define PVRSRV_BRIDGE_DC_DISPATCH_FIRST (PVRSRV_BRIDGE_DMABUF_DISPATCH_LAST + 1)
199 #define PVRSRV_BRIDGE_DC_DISPATCH_LAST (PVRSRV_BRIDGE_DC_DISPATCH_FIRST + PVRSRV_BRIDGE_DC_CMD_LAST)
201 #define PVRSRV_BRIDGE_DC_DISPATCH_FIRST 0
202 #define PVRSRV_BRIDGE_DC_DISPATCH_LAST (PVRSRV_BRIDGE_DMABUF_DISPATCH_LAST)
205 /* 12: Generic cache interface functions*/
206 #define PVRSRV_BRIDGE_CACHEGENERIC 12UL
207 #if (CACHEFLUSH_TYPE == CACHEFLUSH_GENERIC)
208 #define PVRSRV_BRIDGE_CACHEGENERIC_DISPATCH_FIRST (PVRSRV_BRIDGE_DC_DISPATCH_LAST + 1)
209 #define PVRSRV_BRIDGE_CACHEGENERIC_DISPATCH_LAST (PVRSRV_BRIDGE_CACHEGENERIC_DISPATCH_FIRST + PVRSRV_BRIDGE_CACHEGENERIC_CMD_LAST)
211 #define PVRSRV_BRIDGE_CACHEGENERIC_DISPATCH_FIRST 0
212 #define PVRSRV_BRIDGE_CACHEGENERIC_DISPATCH_LAST (PVRSRV_BRIDGE_DC_DISPATCH_LAST)
215 /* 13: Secure Memory Management functions*/
216 #define PVRSRV_BRIDGE_SMM 13UL
217 #if defined(SUPPORT_SECURE_EXPORT)
218 #define PVRSRV_BRIDGE_SMM_DISPATCH_FIRST (PVRSRV_BRIDGE_CACHEGENERIC_DISPATCH_LAST + 1)
219 #define PVRSRV_BRIDGE_SMM_DISPATCH_LAST (PVRSRV_BRIDGE_SMM_DISPATCH_FIRST + PVRSRV_BRIDGE_SMM_CMD_LAST)
221 #define PVRSRV_BRIDGE_SMM_DISPATCH_FIRST 0
222 #define PVRSRV_BRIDGE_SMM_DISPATCH_LAST (PVRSRV_BRIDGE_CACHEGENERIC_DISPATCH_LAST)
225 /* 14: Transport Layer interface functions */
226 #define PVRSRV_BRIDGE_PVRTL 14UL
227 #define PVRSRV_BRIDGE_PVRTL_DISPATCH_FIRST (PVRSRV_BRIDGE_SMM_DISPATCH_LAST + 1)
228 #define PVRSRV_BRIDGE_PVRTL_DISPATCH_LAST (PVRSRV_BRIDGE_PVRTL_DISPATCH_FIRST + PVRSRV_BRIDGE_PVRTL_CMD_LAST)
230 /* 15: Resource Information (RI) interface functions */
231 #define PVRSRV_BRIDGE_RI 15UL
232 #if defined(PVR_RI_DEBUG)
233 #define PVRSRV_BRIDGE_RI_DISPATCH_FIRST (PVRSRV_BRIDGE_PVRTL_DISPATCH_LAST + 1)
234 #define PVRSRV_BRIDGE_RI_DISPATCH_LAST (PVRSRV_BRIDGE_RI_DISPATCH_FIRST + PVRSRV_BRIDGE_RI_CMD_LAST)
236 #define PVRSRV_BRIDGE_RI_DISPATCH_FIRST 0
237 #define PVRSRV_BRIDGE_RI_DISPATCH_LAST (PVRSRV_BRIDGE_PVRTL_DISPATCH_LAST)
240 /* 16: Validation interface functions */
241 #define PVRSRV_BRIDGE_VALIDATION 16UL
242 #if defined(SUPPORT_VALIDATION)
243 #define PVRSRV_BRIDGE_VALIDATION_DISPATCH_FIRST (PVRSRV_BRIDGE_RI_DISPATCH_LAST + 1)
244 #define PVRSRV_BRIDGE_VALIDATION_DISPATCH_LAST (PVRSRV_BRIDGE_VALIDATION_DISPATCH_FIRST + PVRSRV_BRIDGE_VALIDATION_CMD_LAST)
246 #define PVRSRV_BRIDGE_VALIDATION_DISPATCH_FIRST 0
247 #define PVRSRV_BRIDGE_VALIDATION_DISPATCH_LAST (PVRSRV_BRIDGE_RI_DISPATCH_LAST)
250 /* 17: TUTILS interface functions */
251 #define PVRSRV_BRIDGE_TUTILS 17UL
252 #if defined(PVR_TESTING_UTILS)
253 #define PVRSRV_BRIDGE_TUTILS_DISPATCH_FIRST (PVRSRV_BRIDGE_VALIDATION_DISPATCH_LAST + 1)
254 #define PVRSRV_BRIDGE_TUTILS_DISPATCH_LAST (PVRSRV_BRIDGE_TUTILS_DISPATCH_FIRST + PVRSRV_BRIDGE_TUTILS_CMD_LAST)
256 #define PVRSRV_BRIDGE_TUTILS_DISPATCH_FIRST 0
257 #define PVRSRV_BRIDGE_TUTILS_DISPATCH_LAST (PVRSRV_BRIDGE_VALIDATION_DISPATCH_LAST)
260 /* 18: DevMem history interface functions */
261 #define PVRSRV_BRIDGE_DEVICEMEMHISTORY 18UL
262 #if defined(SUPPORT_PAGE_FAULT_DEBUG)
263 #define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DISPATCH_FIRST (PVRSRV_BRIDGE_TUTILS_DISPATCH_LAST + 1)
264 #define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DISPATCH_LAST (PVRSRV_BRIDGE_DEVICEMEMHISTORY_DISPATCH_FIRST + PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_LAST)
266 #define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DISPATCH_FIRST 0
267 #define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DISPATCH_LAST (PVRSRV_BRIDGE_TUTILS_DISPATCH_LAST)
270 /* NB PVRSRV_BRIDGE_LAST below must be the last bridge group defined above (PVRSRV_BRIDGE_FEATURE) */
271 #define PVRSRV_BRIDGE_LAST (PVRSRV_BRIDGE_DEVICEMEMHISTORY)
272 /* NB PVRSRV_BRIDGE_DISPATCH LAST below must be the last dispatch entry defined above (PVRSRV_BRIDGE_FEATURE_DISPATCH_LAST) */
273 #define PVRSRV_BRIDGE_DISPATCH_LAST (PVRSRV_BRIDGE_DEVICEMEMHISTORY_DISPATCH_LAST)
276 /******************************************************************************
277 * Generic bridge structures
278 *****************************************************************************/
281 /******************************************************************************
282 * bridge packaging structure
283 *****************************************************************************/
284 typedef struct PVRSRV_BRIDGE_PACKAGE_TAG
286 IMG_UINT32 ui32BridgeID; /*!< ioctl bridge group */
287 IMG_UINT32 ui32FunctionID; /*!< ioctl function index */
288 IMG_UINT32 ui32Size; /*!< size of structure */
289 IMG_VOID *pvParamIn; /*!< input data buffer */
290 IMG_UINT32 ui32InBufferSize; /*!< size of input data buffer */
291 IMG_VOID *pvParamOut; /*!< output data buffer */
292 IMG_UINT32 ui32OutBufferSize; /*!< size of output data buffer */
293 }PVRSRV_BRIDGE_PACKAGE;
296 #if defined (__cplusplus)
300 #endif /* __PVR_BRIDGE_H__ */
302 /******************************************************************************
303 End of file (pvr_bridge.h)
304 ******************************************************************************/