1 /**********************************************************************
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful but, except
10 * as otherwise stated in writing, without any warranty; without even the
11 * implied warranty of merchantability or fitness for a particular purpose.
12 * See the GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25 ******************************************************************************/
30 struct PVRSRV_POWER_DEV {
31 enum PVRSRV_ERROR (*pfnPrePower)(void *, enum PVR_POWER_STATE,
32 enum PVR_POWER_STATE);
33 enum PVRSRV_ERROR (*pfnPostPower)(void *, enum PVR_POWER_STATE,
34 enum PVR_POWER_STATE);
35 enum PVRSRV_ERROR (*pfnPreClockSpeedChange)(void *, IMG_BOOL,
36 enum PVR_POWER_STATE);
37 enum PVRSRV_ERROR (*pfnPostClockSpeedChange)(void *, IMG_BOOL,
38 enum PVR_POWER_STATE);
41 enum PVR_POWER_STATE eDefaultPowerState;
42 enum PVR_POWER_STATE eCurrentPowerState;
43 struct PVRSRV_POWER_DEV *psNext;
47 enum PVRSRV_INIT_SERVER_STATE {
48 PVRSRV_INIT_SERVER_Unspecified = -1,
49 PVRSRV_INIT_SERVER_RUNNING = 0,
50 PVRSRV_INIT_SERVER_RAN = 1,
51 PVRSRV_INIT_SERVER_SUCCESSFUL = 2,
52 PVRSRV_INIT_SERVER_NUM = 3,
53 PVRSRV_INIT_SERVER_FORCE_I32 = 0x7fffffff
56 IMG_BOOL PVRSRVGetInitServerState(enum PVRSRV_INIT_SERVER_STATE
59 enum PVRSRV_ERROR PVRSRVSetInitServerState(enum PVRSRV_INIT_SERVER_STATE
63 enum PVRSRV_ERROR PVRSRVPowerLock(u32 ui32CallerID,
64 IMG_BOOL bSystemPowerEvent);
65 void PVRSRVPowerUnlock(u32 ui32CallerID);
66 void PVRSRVDvfsLock(void);
67 void PVRSRVDvfsUnlock(void);
69 enum PVRSRV_ERROR PVRSRVSetDevicePowerStateKM(u32 ui32DeviceIndex,
70 enum PVR_POWER_STATE eNewPowerState, u32 ui32CallerID,
71 IMG_BOOL bRetainMutex);
73 enum PVRSRV_ERROR PVRSRVSystemPrePowerStateKM(
74 enum PVR_POWER_STATE eNewPowerState);
75 enum PVRSRV_ERROR PVRSRVSystemPostPowerStateKM(
76 enum PVR_POWER_STATE eNewPowerState);
78 enum PVRSRV_ERROR PVRSRVSetPowerStateKM(enum PVR_POWER_STATE ePVRState);
80 enum PVRSRV_ERROR PVRSRVRegisterPowerDevice(u32 ui32DeviceIndex,
81 enum PVRSRV_ERROR (*pfnPrePower)(void *, enum PVR_POWER_STATE,
82 enum PVR_POWER_STATE),
83 enum PVRSRV_ERROR (*pfnPostPower)(void *, enum PVR_POWER_STATE,
84 enum PVR_POWER_STATE),
85 enum PVRSRV_ERROR (*pfnPreClockSpeedChange)(void *, IMG_BOOL,
86 enum PVR_POWER_STATE),
87 enum PVRSRV_ERROR (*pfnPostClockSpeedChange)(void *, IMG_BOOL,
88 enum PVR_POWER_STATE),
89 void *hDevCookie, enum PVR_POWER_STATE eCurrentPowerState,
90 enum PVR_POWER_STATE eDefaultPowerState);
92 enum PVRSRV_ERROR PVRSRVRemovePowerDevice(u32 ui32DeviceIndex);
94 IMG_BOOL PVRSRVIsDevicePowered(u32 ui32DeviceIndex);
96 enum PVRSRV_ERROR PVRSRVDevicePreClockSpeedChange(u32 ui32DeviceIndex,
100 void PVRSRVDevicePostClockSpeedChange(u32 ui32DeviceIndex,
101 IMG_BOOL bIdleDevice,