1 /*************************************************************************/ /*!
3 @Title Server bridge for rgxkicksync
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Implements the server side of the bridge for rgxkicksync
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 */ /**************************************************************************/
45 #include <asm/uaccess.h>
49 #include "rgxkicksync.h"
52 #include "common_rgxkicksync_bridge.h"
55 #include "pvr_debug.h"
56 #include "connection_server.h"
57 #include "pvr_bridge.h"
58 #include "rgx_bridge.h"
62 #include <linux/slab.h>
69 /* ***************************************************************************
70 * Server-side bridge entry points
74 PVRSRVBridgeRGXCreateKickSyncContext(IMG_UINT32 ui32DispatchTableEntry,
75 PVRSRV_BRIDGE_IN_RGXCREATEKICKSYNCCONTEXT *psRGXCreateKickSyncContextIN,
76 PVRSRV_BRIDGE_OUT_RGXCREATEKICKSYNCCONTEXT *psRGXCreateKickSyncContextOUT,
77 CONNECTION_DATA *psConnection)
79 IMG_HANDLE hPrivData = psRGXCreateKickSyncContextIN->hPrivData;
80 IMG_HANDLE hPrivDataInt = NULL;
81 RGX_SERVER_KICKSYNC_CONTEXT * psKickSyncContextInt = NULL;
89 /* Lock over handle lookup. */
97 /* Look up the address from the handle */
98 psRGXCreateKickSyncContextOUT->eError =
99 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
100 (void **) &hPrivDataInt,
102 PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA,
104 if(psRGXCreateKickSyncContextOUT->eError != PVRSRV_OK)
107 goto RGXCreateKickSyncContext_exit;
110 /* Release now we have looked up handles. */
113 psRGXCreateKickSyncContextOUT->eError =
114 PVRSRVRGXCreateKickSyncContextKM(psConnection, OSGetDevData(psConnection),
116 &psKickSyncContextInt);
117 /* Exit early if bridged call fails */
118 if(psRGXCreateKickSyncContextOUT->eError != PVRSRV_OK)
120 goto RGXCreateKickSyncContext_exit;
123 /* Lock over handle creation. */
130 psRGXCreateKickSyncContextOUT->eError = PVRSRVAllocHandleUnlocked(psConnection->psHandleBase,
132 &psRGXCreateKickSyncContextOUT->hKickSyncContext,
133 (void *) psKickSyncContextInt,
134 PVRSRV_HANDLE_TYPE_RGX_SERVER_KICKSYNC_CONTEXT,
135 PVRSRV_HANDLE_ALLOC_FLAG_MULTI
136 ,(PFN_HANDLE_RELEASE)&PVRSRVRGXDestroyKickSyncContextKM);
137 if (psRGXCreateKickSyncContextOUT->eError != PVRSRV_OK)
140 goto RGXCreateKickSyncContext_exit;
143 /* Release now we have created handles. */
148 RGXCreateKickSyncContext_exit:
150 /* Lock over handle lookup cleanup. */
159 /* Unreference the previously looked up handle */
162 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
164 PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
167 /* Release now we have cleaned up look up handles. */
170 if (psRGXCreateKickSyncContextOUT->eError != PVRSRV_OK)
172 if (psKickSyncContextInt)
174 PVRSRVRGXDestroyKickSyncContextKM(psKickSyncContextInt);
184 PVRSRVBridgeRGXDestroyKickSyncContext(IMG_UINT32 ui32DispatchTableEntry,
185 PVRSRV_BRIDGE_IN_RGXDESTROYKICKSYNCCONTEXT *psRGXDestroyKickSyncContextIN,
186 PVRSRV_BRIDGE_OUT_RGXDESTROYKICKSYNCCONTEXT *psRGXDestroyKickSyncContextOUT,
187 CONNECTION_DATA *psConnection)
198 /* Lock over handle destruction. */
205 psRGXDestroyKickSyncContextOUT->eError =
206 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
207 (IMG_HANDLE) psRGXDestroyKickSyncContextIN->hKickSyncContext,
208 PVRSRV_HANDLE_TYPE_RGX_SERVER_KICKSYNC_CONTEXT);
209 if ((psRGXDestroyKickSyncContextOUT->eError != PVRSRV_OK) &&
210 (psRGXDestroyKickSyncContextOUT->eError != PVRSRV_ERROR_RETRY))
212 PVR_DPF((PVR_DBG_ERROR,
213 "PVRSRVBridgeRGXDestroyKickSyncContext: %s",
214 PVRSRVGetErrorStringKM(psRGXDestroyKickSyncContextOUT->eError)));
217 goto RGXDestroyKickSyncContext_exit;
220 /* Release now we have destroyed handles. */
225 RGXDestroyKickSyncContext_exit:
235 PVRSRVBridgeRGXKickSync(IMG_UINT32 ui32DispatchTableEntry,
236 PVRSRV_BRIDGE_IN_RGXKICKSYNC *psRGXKickSyncIN,
237 PVRSRV_BRIDGE_OUT_RGXKICKSYNC *psRGXKickSyncOUT,
238 CONNECTION_DATA *psConnection)
240 IMG_HANDLE hKickSyncContext = psRGXKickSyncIN->hKickSyncContext;
241 RGX_SERVER_KICKSYNC_CONTEXT * psKickSyncContextInt = NULL;
242 SYNC_PRIMITIVE_BLOCK * *psFenceUFOSyncPrimBlockInt = NULL;
243 IMG_HANDLE *hFenceUFOSyncPrimBlockInt2 = NULL;
244 IMG_UINT32 *ui32FenceSyncOffsetInt = NULL;
245 IMG_UINT32 *ui32FenceValueInt = NULL;
246 SYNC_PRIMITIVE_BLOCK * *psUpdateUFOSyncPrimBlockInt = NULL;
247 IMG_HANDLE *hUpdateUFOSyncPrimBlockInt2 = NULL;
248 IMG_UINT32 *ui32UpdateSyncOffsetInt = NULL;
249 IMG_UINT32 *ui32UpdateValueInt = NULL;
250 IMG_UINT32 *ui32ServerSyncFlagsInt = NULL;
251 SERVER_SYNC_PRIMITIVE * *psServerSyncInt = NULL;
252 IMG_HANDLE *hServerSyncInt2 = NULL;
253 IMG_CHAR *uiUpdateFenceNameInt = NULL;
255 IMG_UINT32 ui32NextOffset = 0;
256 IMG_BYTE *pArrayArgsBuffer = NULL;
257 #if !defined(INTEGRITY_OS)
258 IMG_BOOL bHaveEnoughSpace = IMG_FALSE;
261 IMG_UINT32 ui32BufferSize =
262 (psRGXKickSyncIN->ui32ClientFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)) +
263 (psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) +
264 (psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) +
265 (psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) +
266 (psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)) +
267 (psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) +
268 (psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) +
269 (psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) +
270 (psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) +
271 (psRGXKickSyncIN->ui32ServerSyncCount * sizeof(SERVER_SYNC_PRIMITIVE *)) +
272 (psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) +
273 (32 * sizeof(IMG_CHAR)) +
280 if (ui32BufferSize != 0)
282 #if !defined(INTEGRITY_OS)
283 /* Try to use remainder of input buffer for copies if possible, word-aligned for safety. */
284 IMG_UINT32 ui32InBufferOffset = PVR_ALIGN(sizeof(*psRGXKickSyncIN), sizeof(unsigned long));
285 IMG_UINT32 ui32InBufferExcessSize = ui32InBufferOffset >= PVRSRV_MAX_BRIDGE_IN_SIZE ? 0 :
286 PVRSRV_MAX_BRIDGE_IN_SIZE - ui32InBufferOffset;
288 bHaveEnoughSpace = ui32BufferSize <= ui32InBufferExcessSize;
289 if (bHaveEnoughSpace)
291 IMG_BYTE *pInputBuffer = (IMG_BYTE *)psRGXKickSyncIN;
293 pArrayArgsBuffer = &pInputBuffer[ui32InBufferOffset]; }
297 pArrayArgsBuffer = OSAllocMemNoStats(ui32BufferSize);
299 if(!pArrayArgsBuffer)
301 psRGXKickSyncOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
302 goto RGXKickSync_exit;
307 if (psRGXKickSyncIN->ui32ClientFenceCount != 0)
309 psFenceUFOSyncPrimBlockInt = (SYNC_PRIMITIVE_BLOCK **)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
310 ui32NextOffset += psRGXKickSyncIN->ui32ClientFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *);
311 hFenceUFOSyncPrimBlockInt2 = (IMG_HANDLE *)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
312 ui32NextOffset += psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_HANDLE);
315 /* Copy the data over */
316 if (psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_HANDLE) > 0)
318 if ( OSCopyFromUser(NULL, hFenceUFOSyncPrimBlockInt2, psRGXKickSyncIN->phFenceUFOSyncPrimBlock, psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK )
320 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
322 goto RGXKickSync_exit;
325 if (psRGXKickSyncIN->ui32ClientFenceCount != 0)
327 ui32FenceSyncOffsetInt = (IMG_UINT32*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
328 ui32NextOffset += psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32);
331 /* Copy the data over */
332 if (psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32) > 0)
334 if ( OSCopyFromUser(NULL, ui32FenceSyncOffsetInt, psRGXKickSyncIN->pui32FenceSyncOffset, psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK )
336 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
338 goto RGXKickSync_exit;
341 if (psRGXKickSyncIN->ui32ClientFenceCount != 0)
343 ui32FenceValueInt = (IMG_UINT32*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
344 ui32NextOffset += psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32);
347 /* Copy the data over */
348 if (psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32) > 0)
350 if ( OSCopyFromUser(NULL, ui32FenceValueInt, psRGXKickSyncIN->pui32FenceValue, psRGXKickSyncIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK )
352 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
354 goto RGXKickSync_exit;
357 if (psRGXKickSyncIN->ui32ClientUpdateCount != 0)
359 psUpdateUFOSyncPrimBlockInt = (SYNC_PRIMITIVE_BLOCK **)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
360 ui32NextOffset += psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *);
361 hUpdateUFOSyncPrimBlockInt2 = (IMG_HANDLE *)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
362 ui32NextOffset += psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE);
365 /* Copy the data over */
366 if (psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE) > 0)
368 if ( OSCopyFromUser(NULL, hUpdateUFOSyncPrimBlockInt2, psRGXKickSyncIN->phUpdateUFOSyncPrimBlock, psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK )
370 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
372 goto RGXKickSync_exit;
375 if (psRGXKickSyncIN->ui32ClientUpdateCount != 0)
377 ui32UpdateSyncOffsetInt = (IMG_UINT32*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
378 ui32NextOffset += psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32);
381 /* Copy the data over */
382 if (psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32) > 0)
384 if ( OSCopyFromUser(NULL, ui32UpdateSyncOffsetInt, psRGXKickSyncIN->pui32UpdateSyncOffset, psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK )
386 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
388 goto RGXKickSync_exit;
391 if (psRGXKickSyncIN->ui32ClientUpdateCount != 0)
393 ui32UpdateValueInt = (IMG_UINT32*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
394 ui32NextOffset += psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32);
397 /* Copy the data over */
398 if (psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32) > 0)
400 if ( OSCopyFromUser(NULL, ui32UpdateValueInt, psRGXKickSyncIN->pui32UpdateValue, psRGXKickSyncIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK )
402 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
404 goto RGXKickSync_exit;
407 if (psRGXKickSyncIN->ui32ServerSyncCount != 0)
409 ui32ServerSyncFlagsInt = (IMG_UINT32*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
410 ui32NextOffset += psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_UINT32);
413 /* Copy the data over */
414 if (psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_UINT32) > 0)
416 if ( OSCopyFromUser(NULL, ui32ServerSyncFlagsInt, psRGXKickSyncIN->pui32ServerSyncFlags, psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK )
418 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
420 goto RGXKickSync_exit;
423 if (psRGXKickSyncIN->ui32ServerSyncCount != 0)
425 psServerSyncInt = (SERVER_SYNC_PRIMITIVE **)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
426 ui32NextOffset += psRGXKickSyncIN->ui32ServerSyncCount * sizeof(SERVER_SYNC_PRIMITIVE *);
427 hServerSyncInt2 = (IMG_HANDLE *)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
428 ui32NextOffset += psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_HANDLE);
431 /* Copy the data over */
432 if (psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_HANDLE) > 0)
434 if ( OSCopyFromUser(NULL, hServerSyncInt2, psRGXKickSyncIN->phServerSync, psRGXKickSyncIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) != PVRSRV_OK )
436 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
438 goto RGXKickSync_exit;
443 uiUpdateFenceNameInt = (IMG_CHAR*)(((IMG_UINT8 *)pArrayArgsBuffer) + ui32NextOffset);
444 ui32NextOffset += 32 * sizeof(IMG_CHAR);
447 /* Copy the data over */
448 if (32 * sizeof(IMG_CHAR) > 0)
450 if ( OSCopyFromUser(NULL, uiUpdateFenceNameInt, psRGXKickSyncIN->puiUpdateFenceName, 32 * sizeof(IMG_CHAR)) != PVRSRV_OK )
452 psRGXKickSyncOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
454 goto RGXKickSync_exit;
458 /* Lock over handle lookup. */
466 /* Look up the address from the handle */
467 psRGXKickSyncOUT->eError =
468 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
469 (void **) &psKickSyncContextInt,
471 PVRSRV_HANDLE_TYPE_RGX_SERVER_KICKSYNC_CONTEXT,
473 if(psRGXKickSyncOUT->eError != PVRSRV_OK)
476 goto RGXKickSync_exit;
487 for (i=0;i<psRGXKickSyncIN->ui32ClientFenceCount;i++)
490 /* Look up the address from the handle */
491 psRGXKickSyncOUT->eError =
492 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
493 (void **) &psFenceUFOSyncPrimBlockInt[i],
494 hFenceUFOSyncPrimBlockInt2[i],
495 PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK,
497 if(psRGXKickSyncOUT->eError != PVRSRV_OK)
500 goto RGXKickSync_exit;
513 for (i=0;i<psRGXKickSyncIN->ui32ClientUpdateCount;i++)
516 /* Look up the address from the handle */
517 psRGXKickSyncOUT->eError =
518 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
519 (void **) &psUpdateUFOSyncPrimBlockInt[i],
520 hUpdateUFOSyncPrimBlockInt2[i],
521 PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK,
523 if(psRGXKickSyncOUT->eError != PVRSRV_OK)
526 goto RGXKickSync_exit;
539 for (i=0;i<psRGXKickSyncIN->ui32ServerSyncCount;i++)
542 /* Look up the address from the handle */
543 psRGXKickSyncOUT->eError =
544 PVRSRVLookupHandleUnlocked(psConnection->psHandleBase,
545 (void **) &psServerSyncInt[i],
547 PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE,
549 if(psRGXKickSyncOUT->eError != PVRSRV_OK)
552 goto RGXKickSync_exit;
557 /* Release now we have looked up handles. */
560 psRGXKickSyncOUT->eError =
562 psKickSyncContextInt,
563 psRGXKickSyncIN->ui32ClientCacheOpSeqNum,
564 psRGXKickSyncIN->ui32ClientFenceCount,
565 psFenceUFOSyncPrimBlockInt,
566 ui32FenceSyncOffsetInt,
568 psRGXKickSyncIN->ui32ClientUpdateCount,
569 psUpdateUFOSyncPrimBlockInt,
570 ui32UpdateSyncOffsetInt,
572 psRGXKickSyncIN->ui32ServerSyncCount,
573 ui32ServerSyncFlagsInt,
575 psRGXKickSyncIN->i32CheckFenceFD,
576 psRGXKickSyncIN->i32TimelineFenceFD,
577 &psRGXKickSyncOUT->i32UpdateFenceFD,
578 uiUpdateFenceNameInt,
579 psRGXKickSyncIN->ui32ExtJobRef);
586 /* Lock over handle lookup cleanup. */
595 /* Unreference the previously looked up handle */
596 if(psKickSyncContextInt)
598 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
600 PVRSRV_HANDLE_TYPE_RGX_SERVER_KICKSYNC_CONTEXT);
611 for (i=0;i<psRGXKickSyncIN->ui32ClientFenceCount;i++)
614 /* Unreference the previously looked up handle */
615 if(psFenceUFOSyncPrimBlockInt[i])
617 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
618 hFenceUFOSyncPrimBlockInt2[i],
619 PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK);
632 for (i=0;i<psRGXKickSyncIN->ui32ClientUpdateCount;i++)
635 /* Unreference the previously looked up handle */
636 if(psUpdateUFOSyncPrimBlockInt[i])
638 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
639 hUpdateUFOSyncPrimBlockInt2[i],
640 PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK);
653 for (i=0;i<psRGXKickSyncIN->ui32ServerSyncCount;i++)
656 /* Unreference the previously looked up handle */
657 if(psServerSyncInt[i])
659 PVRSRVReleaseHandleUnlocked(psConnection->psHandleBase,
661 PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE);
666 /* Release now we have cleaned up look up handles. */
669 /* Allocated space should be equal to the last updated offset */
670 PVR_ASSERT(ui32BufferSize == ui32NextOffset);
672 #if defined(INTEGRITY_OS)
675 if(!bHaveEnoughSpace && pArrayArgsBuffer)
677 OSFreeMemNoStats(pArrayArgsBuffer);
686 /* ***************************************************************************
687 * Server bridge dispatch related glue
690 static IMG_BOOL bUseLock = IMG_TRUE;
692 PVRSRV_ERROR InitRGXKICKSYNCBridge(void);
693 PVRSRV_ERROR DeinitRGXKICKSYNCBridge(void);
696 * Register all RGXKICKSYNC functions with services
698 PVRSRV_ERROR InitRGXKICKSYNCBridge(void)
701 SetDispatchTableEntry(PVRSRV_BRIDGE_RGXKICKSYNC, PVRSRV_BRIDGE_RGXKICKSYNC_RGXCREATEKICKSYNCCONTEXT, PVRSRVBridgeRGXCreateKickSyncContext,
704 SetDispatchTableEntry(PVRSRV_BRIDGE_RGXKICKSYNC, PVRSRV_BRIDGE_RGXKICKSYNC_RGXDESTROYKICKSYNCCONTEXT, PVRSRVBridgeRGXDestroyKickSyncContext,
707 SetDispatchTableEntry(PVRSRV_BRIDGE_RGXKICKSYNC, PVRSRV_BRIDGE_RGXKICKSYNC_RGXKICKSYNC, PVRSRVBridgeRGXKickSync,
715 * Unregister all rgxkicksync functions with services
717 PVRSRV_ERROR DeinitRGXKICKSYNCBridge(void)