aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/pvr/services4/srvkm/include/ttrace.h')
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/ttrace.h200
1 files changed, 200 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/services4/srvkm/include/ttrace.h b/drivers/gpu/pvr/services4/srvkm/include/ttrace.h
new file mode 100644
index 000000000000..cb70ff8e2a2b
--- /dev/null
+++ b/drivers/gpu/pvr/services4/srvkm/include/ttrace.h
@@ -0,0 +1,200 @@
1/*************************************************************************/ /*!
2@Title Timed Trace header
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description Timed Trace header. Contines structures and functions used
5 in the timed trace subsystem.
6@License Dual MIT/GPLv2
7
8The contents of this file are subject to the MIT license as set out below.
9
10Permission is hereby granted, free of charge, to any person obtaining a copy
11of this software and associated documentation files (the "Software"), to deal
12in the Software without restriction, including without limitation the rights
13to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14copies of the Software, and to permit persons to whom the Software is
15furnished to do so, subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20Alternatively, the contents of this file may be used under the terms of
21the GNU General Public License Version 2 ("GPL") in which case the provisions
22of GPL are applicable instead of those above.
23
24If you wish to allow use of your version of this file only under the terms of
25GPL, and not to allow others to use your version of this file under the terms
26of the MIT license, indicate your decision by deleting the provisions above
27and replace them with the notice and other provisions required by GPL as set
28out in the file called "GPL-COPYING" included in this distribution. If you do
29not delete the provisions above, a recipient may use your version of this file
30under the terms of either the MIT license or GPL.
31
32This License is also included in this distribution in the file called
33"MIT-COPYING".
34
35EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42*/ /**************************************************************************/
43#include "services_headers.h"
44#include "ttrace_common.h"
45#include "ttrace_tokens.h"
46
47#ifndef __TTRACE_H__
48#define __TTRACE_H__
49
50#if defined(TTRACE)
51
52 #define PVR_TTRACE(group, class, token) \
53 PVRSRVTimeTrace(group, class, token)
54 #define PVR_TTRACE_UI8(group, class, token, val) \
55 PVRSRVTimeTraceUI8(group, class, token, val)
56 #define PVR_TTRACE_UI16(group, class, token, val) \
57 PVRSRVTimeTraceUI16(group, class, token, val)
58 #define PVR_TTRACE_UI32(group, class, token, val) \
59 PVRSRVTimeTraceUI32(group, class, token, val)
60 #define PVR_TTRACE_UI64(group, class, token, val) \
61 PVRSRVTimeTraceUI64(group, class, token, val)
62 #define PVR_TTRACE_DEV_VIRTADDR(group, class, token, val) \
63 PVRSRVTimeTraceDevVirtAddr(group, class, token, val)
64 #define PVR_TTRACE_CPU_PHYADDR(group, class, token, val) \
65 PVRSRVTimeTraceCpuPhyAddr(group, class, token, val)
66 #define PVR_TTRACE_DEV_PHYADDR(group, class, token, val) \
67 PVRSRVTimeTraceDevPhysAddr(group, class, token, val)
68 #define PVR_TTRACE_SYS_PHYADDR(group, class, token, val) \
69 PVRSRVTimeTraceSysPhysAddr(group, class, token, val)
70 #define PVR_TTRACE_SYNC_OBJECT(group, token, syncobj, op) \
71 PVRSRVTimeTraceSyncObject(group, token, syncobj, op)
72
73IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVTimeTraceArray(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
74 IMG_UINT32 ui32Token, IMG_UINT32 ui32TypeSize,
75 IMG_UINT32 ui32Count, IMG_UINT8 *ui8Data);
76
77#ifdef INLINE_IS_PRAGMA
78#pragma inline(PVRSRVTimeTrace)
79#endif
80static INLINE IMG_VOID PVRSRVTimeTrace(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
81 IMG_UINT32 ui32Token)
82{
83 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, 0, 0, NULL);
84}
85
86#ifdef INLINE_IS_PRAGMA
87#pragma inline(PVRSRVTimeTraceUI8)
88#endif
89static INLINE IMG_VOID PVRSRVTimeTraceUI8(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
90 IMG_UINT32 ui32Token, IMG_UINT8 ui8Value)
91{
92 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, PVRSRV_TRACE_TYPE_UI8,
93 1, &ui8Value);
94}
95
96#ifdef INLINE_IS_PRAGMA
97#pragma inline(PVRSRVTimeTraceUI16)
98#endif
99static INLINE IMG_VOID PVRSRVTimeTraceUI16(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
100 IMG_UINT32 ui32Token, IMG_UINT16 ui16Value)
101{
102 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, PVRSRV_TRACE_TYPE_UI16,
103 1, (IMG_UINT8 *) &ui16Value);
104}
105
106#ifdef INLINE_IS_PRAGMA
107#pragma inline(PVRSRVTimeTraceUI32)
108#endif
109static INLINE IMG_VOID PVRSRVTimeTraceUI32(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
110 IMG_UINT32 ui32Token, IMG_UINT32 ui32Value)
111{
112 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, PVRSRV_TRACE_TYPE_UI32,
113 1, (IMG_UINT8 *) &ui32Value);
114}
115
116#ifdef INLINE_IS_PRAGMA
117#pragma inline(PVRSRVTimeTraceUI64)
118#endif
119static INLINE IMG_VOID PVRSRVTimeTraceUI64(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
120 IMG_UINT32 ui32Token, IMG_UINT64 ui64Value)
121{
122 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, PVRSRV_TRACE_TYPE_UI64,
123 1, (IMG_UINT8 *) &ui64Value);
124}
125
126#ifdef INLINE_IS_PRAGMA
127#pragma inline(PVRSRVTimeTraceDevVirtAddr)
128#endif
129static INLINE IMG_VOID PVRSRVTimeTraceDevVirtAddr(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
130 IMG_UINT32 ui32Token, IMG_DEV_VIRTADDR psVAddr)
131{
132 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, PVRSRV_TRACE_TYPE_UI32,
133 1, (IMG_UINT8 *) &psVAddr.uiAddr);
134}
135
136#ifdef INLINE_IS_PRAGMA
137#pragma inline(PVRSRVTimeTraceCpuPhyAddr)
138#endif
139static INLINE IMG_VOID PVRSRVTimeTraceCpuPhyAddr(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
140 IMG_UINT32 ui32Token, IMG_CPU_PHYADDR psPAddr)
141{
142 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, PVRSRV_TRACE_TYPE_UI32,
143 1, (IMG_UINT8 *) &psPAddr.uiAddr);
144}
145
146#ifdef INLINE_IS_PRAGMA
147#pragma inline(PVRSRVTimeTraceDevPhysAddr)
148#endif
149static INLINE IMG_VOID PVRSRVTimeTraceDevPhysAddr(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
150 IMG_UINT32 ui32Token, IMG_DEV_PHYADDR psPAddr)
151{
152 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, PVRSRV_TRACE_TYPE_UI32,
153 1, (IMG_UINT8 *) &psPAddr.uiAddr);
154}
155
156#ifdef INLINE_IS_PRAGMA
157#pragma inline(PVRSRVTimeTraceSysPhysAddr)
158#endif
159static INLINE IMG_VOID PVRSRVTimeTraceSysPhysAddr(IMG_UINT32 ui32Group, IMG_UINT32 ui32Class,
160 IMG_UINT32 ui32Token, IMG_SYS_PHYADDR psPAddr)
161{
162 PVRSRVTimeTraceArray(ui32Group, ui32Class, ui32Token, sizeof(psPAddr.uiAddr),
163 1, (IMG_UINT8 *) &psPAddr.uiAddr);
164}
165
166#else /* defined(PVRSRV_NEED_PVR_TIME_TRACE) */
167
168 #define PVR_TTRACE(group, class, token) \
169 ((void) 0)
170 #define PVR_TTRACE_UI8(group, class, token, val) \
171 ((void) 0)
172 #define PVR_TTRACE_UI16(group, class, token, val) \
173 ((void) 0)
174 #define PVR_TTRACE_UI32(group, class, token, val) \
175 ((void) 0)
176 #define PVR_TTRACE_UI64(group, class, token, val) \
177 ((void) 0)
178 #define PVR_TTRACE_DEV_VIRTADDR(group, class, token, val) \
179 ((void) 0)
180 #define PVR_TTRACE_CPU_PHYADDR(group, class, token, val) \
181 ((void) 0)
182 #define PVR_TTRACE_DEV_PHYADDR(group, class, token, val) \
183 ((void) 0)
184 #define PVR_TTRACE_SYS_PHYADDR(group, class, token, val) \
185 ((void) 0)
186 #define PVR_TTRACE_SYNC_OBJECT(group, token, syncobj, op) \
187 ((void) 0)
188
189#endif /* defined(PVRSRV_NEED_PVR_TIME_TRACE) */
190
191IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceInit(IMG_VOID);
192IMG_IMPORT IMG_VOID PVRSRVTimeTraceDeinit(IMG_VOID);
193
194IMG_IMPORT IMG_VOID PVRSRVTimeTraceSyncObject(IMG_UINT32 ui32Group, IMG_UINT32 ui32Token,
195 PVRSRV_KERNEL_SYNC_INFO *psSync, IMG_UINT8 ui8SyncOp);
196IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceBufferCreate(IMG_UINT32 ui32PID);
197IMG_IMPORT PVRSRV_ERROR PVRSRVTimeTraceBufferDestroy(IMG_UINT32 ui32PID);
198
199IMG_IMPORT IMG_VOID PVRSRVDumpTimeTraceBuffers(IMG_VOID);
200#endif /* __TTRACE_H__ */