示例#1
0
IMG_BOOL PVRSRVIsDevicePowered(u32 ui32DeviceIndex)
{
	enum PVRSRV_ERROR eError;
	struct SYS_DATA *psSysData;
	struct PVRSRV_POWER_DEV *psPowerDevice;

	eError = SysAcquireData(&psSysData);
	if (eError != PVRSRV_OK)
		return IMG_FALSE;

	if (OSIsResourceLocked(&psSysData->sPowerStateChangeResource,
								KERNEL_ID) ||
	    OSIsResourceLocked(&psSysData->sPowerStateChangeResource, ISR_ID))
		return IMG_FALSE;

	psPowerDevice = psSysData->psPowerDeviceList;
	while (psPowerDevice) {
		if (psPowerDevice->ui32DeviceIndex == ui32DeviceIndex)
			return (IMG_BOOL)(psPowerDevice->eCurrentPowerState ==
						PVRSRV_POWER_STATE_D0);
		psPowerDevice = psPowerDevice->psNext;
	}

	return IMG_FALSE;
}
示例#2
0
IMG_EXPORT
IMG_BOOL PVRSRVIsDevicePowered(IMG_UINT32 ui32DeviceIndex)
{
	SYS_DATA			*psSysData;
	PVRSRV_POWER_DEV	*psPowerDevice;

	SysAcquireData(&psSysData);

	if (OSIsResourceLocked(&psSysData->sPowerStateChangeResource, KERNEL_ID) ||
		OSIsResourceLocked(&psSysData->sPowerStateChangeResource, ISR_ID))
	{
		return IMG_FALSE;
	}

	psPowerDevice = (PVRSRV_POWER_DEV*)
					List_PVRSRV_POWER_DEV_Any_va(psSysData->psPowerDeviceList,
												 MatchPowerDeviceIndex_AnyVaCb,
												 ui32DeviceIndex);
	return (psPowerDevice && (psPowerDevice->eCurrentPowerState == PVRSRV_DEV_POWER_STATE_ON))
			? IMG_TRUE : IMG_FALSE;
}