PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful) { SYS_DATA *psSysData; PVRSRV_ERROR eError; PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVFinaliseSystem")); SysAcquireData(&psSysData); if (bInitSuccessful) { eError = SysFinalise(); if (eError != PVRSRV_OK) { PVR_DPF((PVR_DBG_ERROR,"PVRSRVFinaliseSystem: SysFinalise failed (%d)", eError)); return eError; } eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList, PVRSRVFinaliseSystem_SetPowerState_AnyCb); if (eError != PVRSRV_OK) { return eError; } eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList, PVRSRVFinaliseSystem_CompatCheck_AnyCb); if (eError != PVRSRV_OK) { return eError; } } #if !defined(SUPPORT_DRI_DRM) PDUMPENDINITPHASE(); #endif return PVRSRV_OK; }
/*! ****************************************************************************** @Function PVRSRVFinaliseSystem @Description Final part of system initialisation. @Input ui32DevIndex : Index to the required device @Return PVRSRV_ERROR : ******************************************************************************/ PVRSRV_ERROR IMG_CALLCONV PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful) { /* PVRSRV_DEVICE_NODE *psDeviceNode;*/ SYS_DATA *psSysData; PVRSRV_ERROR eError; PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVFinaliseSystem")); SysAcquireData(&psSysData); if (bInitSuccessful) { eError = SysFinalise(); if (eError != PVRSRV_OK) { PVR_DPF((PVR_DBG_ERROR,"PVRSRVFinaliseSystem: SysFinalise failed (%d)", eError)); return eError; } /* Place all devices into their default power state. */ eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList, &PVRSRVFinaliseSystem_SetPowerState_AnyCb); if (eError != PVRSRV_OK) { return eError; } /* Verify microkernel compatibility for devices */ eError = List_PVRSRV_DEVICE_NODE_PVRSRV_ERROR_Any(psSysData->psDeviceNodeList, &PVRSRVFinaliseSystem_CompatCheck_AnyCb); if (eError != PVRSRV_OK) { return eError; } } /* Some platforms call this too early in the boot phase. */ PDUMPENDINITPHASE(); return PVRSRV_OK; }
enum PVRSRV_ERROR PVRSRVFinaliseSystem(IMG_BOOL bInitSuccessful) { struct PVRSRV_DEVICE_NODE *psDeviceNode; struct SYS_DATA *psSysData; enum PVRSRV_ERROR eError; PVR_DPF(PVR_DBG_MESSAGE, "PVRSRVFinaliseSystem"); eError = SysAcquireData(&psSysData); if (eError != PVRSRV_OK) { PVR_DPF(PVR_DBG_ERROR, "PVRSRVFinaliseSystem: Failed to get SysData"); return eError; } if (bInitSuccessful) { eError = SysFinalise(); if (eError != PVRSRV_OK) { PVR_DPF(PVR_DBG_ERROR, "PVRSRVFinaliseSystem: SysFinalise failed (%d)", eError); return eError; } psDeviceNode = psSysData->psDeviceNodeList; while (psDeviceNode) { eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId. ui32DeviceIndex, PVRSRV_POWER_Unspecified, KERNEL_ID, IMG_FALSE); if (eError != PVRSRV_OK) PVR_DPF(PVR_DBG_ERROR, "PVRSRVFinaliseSystem: " "Failed PVRSRVSetDevicePowerStateKM " "call (device index: %d)", psDeviceNode->sDevId.ui32DeviceIndex); psDeviceNode = psDeviceNode->psNext; } psDeviceNode = psSysData->psDeviceNodeList; while (psDeviceNode) { if (psDeviceNode->pfnInitDeviceCompatCheck) { eError = PVRSRVDevInitCompatCheck(psDeviceNode); if (eError != PVRSRV_OK) { PVR_DPF(PVR_DBG_ERROR, "PVRSRVFinaliseSystem: " "Failed PVRSRVDevInitCompatCheck " "call (device index: %d)", psDeviceNode->sDevId. ui32DeviceIndex); return eError; } } psDeviceNode = psDeviceNode->psNext; } } return PVRSRV_OK; }