1 /*************************************************************************/ /*!
2 @Title Direct client bridge for sync
3 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4 @License Dual MIT/GPLv2
6 The contents of this file are subject to the MIT license as set out below.
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
18 Alternatively, the contents of this file may be used under the terms of
19 the GNU General Public License Version 2 ("GPL") in which case the provisions
20 of GPL are applicable instead of those above.
22 If you wish to allow use of your version of this file only under the terms of
23 GPL, and not to allow others to use your version of this file under the terms
24 of the MIT license, indicate your decision by deleting the provisions above
25 and replace them with the notice and other provisions required by GPL as set
26 out in the file called "GPL-COPYING" included in this distribution. If you do
27 not delete the provisions above, a recipient may use your version of this file
28 under the terms of either the MIT license or GPL.
30 This License is also included in this distribution in the file called
33 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
34 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
35 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
37 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
38 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 */ /**************************************************************************/
42 #include "client_sync_bridge.h"
44 #include "pvr_debug.h"
46 /* Module specific includes */
48 #include "pdumpdefs.h"
49 #include "devicemem_typedefs.h"
52 #include "sync_server.h"
56 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeAllocSyncPrimitiveBlock(IMG_HANDLE hBridge,
57 IMG_HANDLE *phSyncHandle,
58 IMG_UINT32 *pui32SyncPrimVAddr,
59 IMG_UINT32 *pui32SyncPrimBlockSize,
60 IMG_HANDLE *phhSyncPMR)
63 SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
68 PVRSRVAllocSyncPrimitiveBlockKM(NULL, (PVRSRV_DEVICE_NODE *)((void*) hBridge)
72 pui32SyncPrimBlockSize,
75 *phSyncHandle = psSyncHandleInt;
76 *phhSyncPMR = pshSyncPMRInt;
80 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeFreeSyncPrimitiveBlock(IMG_HANDLE hBridge,
81 IMG_HANDLE hSyncHandle)
84 SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
85 PVR_UNREFERENCED_PARAMETER(hBridge);
87 psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
90 PVRSRVFreeSyncPrimitiveBlockKM(
96 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimSet(IMG_HANDLE hBridge,
97 IMG_HANDLE hSyncHandle,
102 SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
103 PVR_UNREFERENCED_PARAMETER(hBridge);
105 psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
116 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncPrimSet(IMG_HANDLE hBridge,
117 IMG_HANDLE hSyncHandle,
118 IMG_UINT32 ui32Value)
121 SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
122 PVR_UNREFERENCED_PARAMETER(hBridge);
124 psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle;
127 PVRSRVServerSyncPrimSetKM(
134 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncAlloc(IMG_HANDLE hBridge,
135 IMG_HANDLE *phSyncHandle,
136 IMG_UINT32 *pui32SyncPrimVAddr,
137 IMG_UINT32 ui32ClassNameSize,
138 const IMG_CHAR *puiClassName)
141 SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
145 PVRSRVServerSyncAllocKM(NULL, (PVRSRV_DEVICE_NODE *)((void*) hBridge)
152 *phSyncHandle = psSyncHandleInt;
156 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncFree(IMG_HANDLE hBridge,
157 IMG_HANDLE hSyncHandle)
160 SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
161 PVR_UNREFERENCED_PARAMETER(hBridge);
163 psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle;
166 PVRSRVServerSyncFreeKM(
172 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncQueueHWOp(IMG_HANDLE hBridge,
173 IMG_HANDLE hSyncHandle,
175 IMG_UINT32 *pui32FenceValue,
176 IMG_UINT32 *pui32UpdateValue)
179 SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
180 PVR_UNREFERENCED_PARAMETER(hBridge);
182 psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle;
185 PVRSRVServerSyncQueueHWOpKM(
194 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncGetStatus(IMG_HANDLE hBridge,
195 IMG_UINT32 ui32SyncCount,
196 IMG_HANDLE *phSyncHandle,
197 IMG_UINT32 *pui32UID,
198 IMG_UINT32 *pui32FWAddr,
199 IMG_UINT32 *pui32CurrentOp,
200 IMG_UINT32 *pui32NextOp)
203 SERVER_SYNC_PRIMITIVE * *psSyncHandleInt;
204 PVR_UNREFERENCED_PARAMETER(hBridge);
206 psSyncHandleInt = (SERVER_SYNC_PRIMITIVE **) phSyncHandle;
209 PVRSRVServerSyncGetStatusKM(
220 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpCreate(IMG_HANDLE hBridge,
221 IMG_UINT32 ui32SyncBlockCount,
222 IMG_HANDLE *phBlockList,
223 IMG_UINT32 ui32ClientSyncCount,
224 IMG_UINT32 *pui32SyncBlockIndex,
225 IMG_UINT32 *pui32Index,
226 IMG_UINT32 ui32ServerSyncCount,
227 IMG_HANDLE *phServerSync,
228 IMG_HANDLE *phServerCookie)
231 SYNC_PRIMITIVE_BLOCK * *psBlockListInt;
232 SERVER_SYNC_PRIMITIVE * *psServerSyncInt;
233 SERVER_OP_COOKIE * psServerCookieInt;
234 PVR_UNREFERENCED_PARAMETER(hBridge);
236 psBlockListInt = (SYNC_PRIMITIVE_BLOCK **) phBlockList;
237 psServerSyncInt = (SERVER_SYNC_PRIMITIVE **) phServerSync;
240 PVRSRVSyncPrimOpCreateKM(
250 *phServerCookie = psServerCookieInt;
254 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpTake(IMG_HANDLE hBridge,
255 IMG_HANDLE hServerCookie,
256 IMG_UINT32 ui32ClientSyncCount,
257 IMG_UINT32 *pui32Flags,
258 IMG_UINT32 *pui32FenceValue,
259 IMG_UINT32 *pui32UpdateValue,
260 IMG_UINT32 ui32ServerSyncCount,
261 IMG_UINT32 *pui32ServerFlags)
264 SERVER_OP_COOKIE * psServerCookieInt;
265 PVR_UNREFERENCED_PARAMETER(hBridge);
267 psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
270 PVRSRVSyncPrimOpTakeKM(
282 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpReady(IMG_HANDLE hBridge,
283 IMG_HANDLE hServerCookie,
287 SERVER_OP_COOKIE * psServerCookieInt;
288 PVR_UNREFERENCED_PARAMETER(hBridge);
290 psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
293 PVRSRVSyncPrimOpReadyKM(
300 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpComplete(IMG_HANDLE hBridge,
301 IMG_HANDLE hServerCookie)
304 SERVER_OP_COOKIE * psServerCookieInt;
305 PVR_UNREFERENCED_PARAMETER(hBridge);
307 psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
310 PVRSRVSyncPrimOpCompleteKM(
316 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpDestroy(IMG_HANDLE hBridge,
317 IMG_HANDLE hServerCookie)
320 SERVER_OP_COOKIE * psServerCookieInt;
321 PVR_UNREFERENCED_PARAMETER(hBridge);
323 psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
326 PVRSRVSyncPrimOpDestroyKM(
332 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDump(IMG_HANDLE hBridge,
333 IMG_HANDLE hSyncHandle,
334 IMG_UINT32 ui32Offset)
338 SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
339 PVR_UNREFERENCED_PARAMETER(hBridge);
341 psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
344 PVRSRVSyncPrimPDumpKM(
350 PVR_UNREFERENCED_PARAMETER(hBridge);
351 PVR_UNREFERENCED_PARAMETER(hSyncHandle);
352 PVR_UNREFERENCED_PARAMETER(ui32Offset);
354 return PVRSRV_ERROR_NOT_IMPLEMENTED;
358 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpValue(IMG_HANDLE hBridge,
359 IMG_HANDLE hSyncHandle,
360 IMG_UINT32 ui32Offset,
361 IMG_UINT32 ui32Value)
365 SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
366 PVR_UNREFERENCED_PARAMETER(hBridge);
368 psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
371 PVRSRVSyncPrimPDumpValueKM(
378 PVR_UNREFERENCED_PARAMETER(hBridge);
379 PVR_UNREFERENCED_PARAMETER(hSyncHandle);
380 PVR_UNREFERENCED_PARAMETER(ui32Offset);
381 PVR_UNREFERENCED_PARAMETER(ui32Value);
383 return PVRSRV_ERROR_NOT_IMPLEMENTED;
387 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpPol(IMG_HANDLE hBridge,
388 IMG_HANDLE hSyncHandle,
389 IMG_UINT32 ui32Offset,
390 IMG_UINT32 ui32Value,
392 PDUMP_POLL_OPERATOR eOperator,
393 PDUMP_FLAGS_T uiPDumpFlags)
397 SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
398 PVR_UNREFERENCED_PARAMETER(hBridge);
400 psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
403 PVRSRVSyncPrimPDumpPolKM(
413 PVR_UNREFERENCED_PARAMETER(hBridge);
414 PVR_UNREFERENCED_PARAMETER(hSyncHandle);
415 PVR_UNREFERENCED_PARAMETER(ui32Offset);
416 PVR_UNREFERENCED_PARAMETER(ui32Value);
417 PVR_UNREFERENCED_PARAMETER(ui32Mask);
418 PVR_UNREFERENCED_PARAMETER(eOperator);
419 PVR_UNREFERENCED_PARAMETER(uiPDumpFlags);
421 return PVRSRV_ERROR_NOT_IMPLEMENTED;
425 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpPDumpPol(IMG_HANDLE hBridge,
426 IMG_HANDLE hServerCookie,
427 PDUMP_POLL_OPERATOR eOperator,
428 PDUMP_FLAGS_T uiPDumpFlags)
432 SERVER_OP_COOKIE * psServerCookieInt;
433 PVR_UNREFERENCED_PARAMETER(hBridge);
435 psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
438 PVRSRVSyncPrimOpPDumpPolKM(
445 PVR_UNREFERENCED_PARAMETER(hBridge);
446 PVR_UNREFERENCED_PARAMETER(hServerCookie);
447 PVR_UNREFERENCED_PARAMETER(eOperator);
448 PVR_UNREFERENCED_PARAMETER(uiPDumpFlags);
450 return PVRSRV_ERROR_NOT_IMPLEMENTED;
454 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpCBP(IMG_HANDLE hBridge,
455 IMG_HANDLE hSyncHandle,
456 IMG_UINT32 ui32Offset,
457 IMG_DEVMEM_OFFSET_T uiWriteOffset,
458 IMG_DEVMEM_SIZE_T uiPacketSize,
459 IMG_DEVMEM_SIZE_T uiBufferSize)
463 SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
464 PVR_UNREFERENCED_PARAMETER(hBridge);
466 psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
469 PVRSRVSyncPrimPDumpCBPKM(
478 PVR_UNREFERENCED_PARAMETER(hBridge);
479 PVR_UNREFERENCED_PARAMETER(hSyncHandle);
480 PVR_UNREFERENCED_PARAMETER(ui32Offset);
481 PVR_UNREFERENCED_PARAMETER(uiWriteOffset);
482 PVR_UNREFERENCED_PARAMETER(uiPacketSize);
483 PVR_UNREFERENCED_PARAMETER(uiBufferSize);
485 return PVRSRV_ERROR_NOT_IMPLEMENTED;
489 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncAllocEvent(IMG_HANDLE hBridge,
490 IMG_BOOL bServerSync,
491 IMG_UINT32 ui32FWAddr,
492 IMG_UINT32 ui32ClassNameSize,
493 const IMG_CHAR *puiClassName)
496 PVR_UNREFERENCED_PARAMETER(hBridge);
500 PVRSRVSyncAllocEventKM(
509 IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncFreeEvent(IMG_HANDLE hBridge,
510 IMG_UINT32 ui32FWAddr)
513 PVR_UNREFERENCED_PARAMETER(hBridge);
517 PVRSRVSyncFreeEventKM(