1
/**********************************************************************
3
* Copyright (C) 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
******************************************************************************/
31
#if defined (__cplusplus)
36
#if defined(DEBUG) || defined(TIMING)
47
extern Temporal_Data asTimers[];
49
extern IMG_UINT32 PVRSRVTimeNow(IMG_VOID);
50
extern IMG_VOID PVRSRVSetupMetricTimers(IMG_VOID *pvDevInfo);
51
extern IMG_VOID PVRSRVOutputMetricTotals(IMG_VOID);
54
#define PVRSRV_TIMER_DUMMY 0
56
#define PVRSRV_TIMER_EXAMPLE_1 1
57
#define PVRSRV_TIMER_EXAMPLE_2 2
60
#define PVRSRV_NUM_TIMERS (PVRSRV_TIMER_EXAMPLE_2 + 1)
62
#define PVRSRV_TIME_START(X) { \
63
asTimers[X].ui32Count += 1; \
64
asTimers[X].ui32Count |= 0x80000000L; \
65
asTimers[X].ui32Start = PVRSRVTimeNow(); \
66
asTimers[X].ui32Stop = 0; \
69
#define PVRSRV_TIME_SUSPEND(X) { \
70
asTimers[X].ui32Stop += PVRSRVTimeNow() - asTimers[X].ui32Start; \
73
#define PVRSRV_TIME_RESUME(X) { \
74
asTimers[X].ui32Start = PVRSRVTimeNow(); \
77
#define PVRSRV_TIME_STOP(X) { \
78
asTimers[X].ui32Stop += PVRSRVTimeNow() - asTimers[X].ui32Start; \
79
asTimers[X].ui32Total += asTimers[X].ui32Stop; \
80
asTimers[X].ui32Count &= 0x7FFFFFFFL; \
83
#define PVRSRV_TIME_RESET(X) { \
84
asTimers[X].ui32Start = 0; \
85
asTimers[X].ui32Stop = 0; \
86
asTimers[X].ui32Total = 0; \
87
asTimers[X].ui32Count = 0; \
93
#define TST_REG ((volatile IMG_UINT8 *) (psDevInfo->pvSOCRegsBaseKM))
95
#define TCOR_2 ((volatile IMG_UINT *) (psDevInfo->pvSOCRegsBaseKM+28))
96
#define TCNT_2 ((volatile IMG_UINT *) (psDevInfo->pvSOCRegsBaseKM+32))
97
#define TCR_2 ((volatile IMG_UINT16 *)(psDevInfo->pvSOCRegsBaseKM+36))
99
#define TIMER_DIVISOR 4
111
#define PVRSRV_TIME_START(X)
112
#define PVRSRV_TIME_SUSPEND(X)
113
#define PVRSRV_TIME_RESUME(X)
114
#define PVRSRV_TIME_STOP(X)
115
#define PVRSRV_TIME_RESET(X)
117
#define PVRSRVSetupMetricTimers(X)
118
#define PVRSRVOutputMetricTotals()
124
#if defined(__cplusplus)