1 /*************************************************************************/ /*!
3 @Title RGX time correlation and calibration header file
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Header for the RGX time correlation and calibration routines
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 */ /**************************************************************************/
44 #if !defined(__RGXTIMECORR_H__)
45 #define __RGXTIMECORR_H__
47 #include "img_types.h"
51 RGXTIMECORR_CLOCK_MONO,
52 RGXTIMECORR_CLOCK_MONO_RAW,
53 RGXTIMECORR_CLOCK_SCHED,
55 RGXTIMECORR_CLOCK_LAST
56 } RGXTIMECORR_CLOCK_TYPE;
59 ******************************************************************************
61 @Function RGXGPUFreqCalibratePrePowerOff
63 @Description Manage GPU frequency and timer correlation data
66 @Input hDevHandle : RGX Device Node
70 ******************************************************************************/
71 void RGXGPUFreqCalibratePrePowerOff(IMG_HANDLE hDevHandle);
74 ******************************************************************************
76 @Function RGXGPUFreqCalibratePostPowerOn
78 @Description Manage GPU frequency and timer correlation data
81 @Input hDevHandle : RGX Device Node
85 ******************************************************************************/
86 void RGXGPUFreqCalibratePostPowerOn(IMG_HANDLE hDevHandle);
89 ******************************************************************************
91 @Function RGXGPUFreqCalibratePreClockSpeedChange
93 @Description Manage GPU frequency and timer correlation data
94 before a DVFS transition.
96 @Input hDevHandle : RGX Device Node
100 ******************************************************************************/
101 void RGXGPUFreqCalibratePreClockSpeedChange(IMG_HANDLE hDevHandle);
104 ******************************************************************************
106 @Function RGXGPUFreqCalibratePostClockSpeedChange
108 @Description Manage GPU frequency and timer correlation data
109 after a DVFS transition.
111 @Input hDevHandle : RGX Device Node
112 @Input ui32NewClockSpeed : GPU clock speed after the DVFS transition
114 @Return IMG_UINT32 : Calibrated GPU clock speed after the DVFS transition
116 ******************************************************************************/
117 IMG_UINT32 RGXGPUFreqCalibratePostClockSpeedChange(IMG_HANDLE hDevHandle, IMG_UINT32 ui32NewClockSpeed);
120 ******************************************************************************
122 @Function RGXGPUFreqCalibratePeriodic
124 @Description Calibrate the GPU clock speed and correlate the timers
125 at regular intervals.
127 @Input hDevHandle : RGX Device Node
131 ******************************************************************************/
132 void RGXGPUFreqCalibrateCorrelatePeriodic(IMG_HANDLE hDevHandle);
135 ******************************************************************************
137 @Function RGXGPUFreqCalibrateClockns64
139 @Description Returns value of currently selected clock (in ns).
141 @Return clock value from currently selected clock source
143 ******************************************************************************/
144 IMG_UINT64 RGXGPUFreqCalibrateClockns64(void);
147 ******************************************************************************
149 @Function RGXGPUFreqCalibrateClockns64
151 @Description Returns value of currently selected clock (in us).
153 @Return clock value from currently selected clock source
155 ******************************************************************************/
156 IMG_UINT64 RGXGPUFreqCalibrateClockus64(void);
159 ******************************************************************************
161 @Function RGXGPUFreqCalibrateClockSource
163 @Description Returns currently selected clock source
165 @Return clock source type
167 ******************************************************************************/
168 RGXTIMECORR_CLOCK_TYPE RGXGPUFreqCalibrateGetClockSource(void);
171 ******************************************************************************
173 @Function RGXGPUFreqCalibrateSetClockSource
175 @Description Sets clock source for correlation data.
177 @Input psDeviceNode : RGX Device Node
178 @Input eClockType : clock source type
182 ******************************************************************************/
183 PVRSRV_ERROR RGXGPUFreqCalibrateSetClockSource(PVRSRV_DEVICE_NODE *psDeviceNode,
184 RGXTIMECORR_CLOCK_TYPE eClockType);
186 void RGXGPUFreqCalibrationInitAppHintCallbacks(
187 const PVRSRV_DEVICE_NODE *psDeviceNode);
189 #endif /* __RGXTIMECORR_H__ */