PVRSRV_ERROR PVRSRVSyncPrimOpDestroyKM(SERVER_OP_COOKIE *psServerCookie) { IMG_UINT32 i; /* If the operation is still active then check if it's finished yet */ if (psServerCookie->bActive) { if (PVRSRVSyncPrimOpCompleteKM(psServerCookie) == PVRSRV_ERROR_BAD_SYNC_STATE) { PVR_DPF((PVR_DBG_ERROR, "%s: Not ready, ask for retry", __FUNCTION__)); return PVRSRV_ERROR_RETRY; } } /* Drop our references on the sync blocks and server syncs*/ for (i = 0; i < psServerCookie->ui32SyncBlockCount; i++) { _SyncPrimitiveBlockUnref(psServerCookie->papsSyncPrimBlock[i]); } for (i = 0; i < psServerCookie->ui32ServerSyncCount; i++) { _ServerSyncUnref(psServerCookie->papsServerSync[i]); } OSFreeMem(psServerCookie); return PVRSRV_OK; }
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpComplete(IMG_HANDLE hBridge, IMG_HANDLE hServerCookie) { PVRSRV_ERROR eError; SERVER_OP_COOKIE * psServerCookieInt; PVR_UNREFERENCED_PARAMETER(hBridge); psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie; eError = PVRSRVSyncPrimOpCompleteKM( psServerCookieInt); return eError; }
static IMG_INT PVRSRVBridgeSyncPrimOpComplete(IMG_UINT32 ui32BridgeID, PVRSRV_BRIDGE_IN_SYNCPRIMOPCOMPLETE *psSyncPrimOpCompleteIN, PVRSRV_BRIDGE_OUT_SYNCPRIMOPCOMPLETE *psSyncPrimOpCompleteOUT, CONNECTION_DATA *psConnection) { SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; IMG_HANDLE hServerCookieInt2 = IMG_NULL; PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCOMPLETE); { /* Look up the address from the handle */ psSyncPrimOpCompleteOUT->eError = PVRSRVLookupHandle(psConnection->psHandleBase, (IMG_HANDLE *) &hServerCookieInt2, psSyncPrimOpCompleteIN->hServerCookie, PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); if(psSyncPrimOpCompleteOUT->eError != PVRSRV_OK) { goto SyncPrimOpComplete_exit; } /* Look up the data from the resman address */ psSyncPrimOpCompleteOUT->eError = ResManFindPrivateDataByPtr(hServerCookieInt2, (IMG_VOID **) &psServerCookieInt); if(psSyncPrimOpCompleteOUT->eError != PVRSRV_OK) { goto SyncPrimOpComplete_exit; } } psSyncPrimOpCompleteOUT->eError = PVRSRVSyncPrimOpCompleteKM( psServerCookieInt); SyncPrimOpComplete_exit: return 0; }