drm/GPU: Add support Imagination PowerVR GPU driver v1.17
[platform/kernel/linux-starfive.git] / drivers / gpu / drm / img / img-rogue / services / server / include / pdump_km.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          pdump functions
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description    Main APIs for pdump functions
6 @License        Dual MIT/GPLv2
7
8 The contents of this file are subject to the MIT license as set out below.
9
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:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
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.
23
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.
31
32 This License is also included in this distribution in the file called
33 "MIT-COPYING".
34
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 */ /**************************************************************************/
43
44 #ifndef PDUMP_KM_H
45 #define PDUMP_KM_H
46
47 #if defined(PDUMP)
48  #if defined(__linux__)
49   #include <linux/version.h>
50   #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0))
51    #include <linux/stdarg.h>
52   #else
53    #include <stdarg.h>
54   #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) */
55  #else
56   #include <stdarg.h>
57  #endif /* __linux__ */
58 #endif /* PDUMP */
59
60 /* services/srvkm/include/ */
61 #include "device.h"
62
63 /* include/ */
64 #include "pvrsrv_error.h"
65
66
67 #if defined(__KERNEL__) && defined(__linux__) && !defined(__GENKSYMS__)
68 #define __pvrsrv_defined_struct_enum__
69 #include <services_kernel_client.h>
70 #endif
71
72 #include "connection_server.h"
73 /* Pull in pdump flags from services include */
74 #include "pdump.h"
75 #include "pdumpdefs.h"
76
77 /* Define this to enable the PDUMP_HERE trace in the server */
78 #undef PDUMP_TRACE
79
80 #if defined(PDUMP_TRACE)
81 #define PDUMP_HERE_VAR  IMG_UINT32 here = 0;
82 #define PDUMP_HERE(a)   { here = (a); if (ui32Flags & PDUMP_FLAGS_DEBUG) PVR_DPF((PVR_DBG_WARNING, "HERE %d", (a))); }
83 #define PDUMP_HEREA(a)  { here = (a); PVR_DPF((PVR_DBG_WARNING, "HERE ALWAYS %d", (a))); }
84 #else
85 #define PDUMP_HERE_VAR  IMG_UINT32 here = 0;
86 #define PDUMP_HERE(a)   here = (a);
87 #define PDUMP_HEREA(a)  here = (a);
88 #endif
89
90 #define PDUMP_PD_UNIQUETAG      (IMG_HANDLE)0
91 #define PDUMP_PT_UNIQUETAG      (IMG_HANDLE)0
92
93 /* Invalid value for PDump block number */
94 #define PDUMP_BLOCKNUM_INVALID      IMG_UINT32_MAX
95
96 typedef struct _PDUMP_CONNECTION_DATA_ PDUMP_CONNECTION_DATA;
97
98 /* PDump transition events */
99 typedef enum _PDUMP_TRANSITION_EVENT_
100 {
101         PDUMP_TRANSITION_EVENT_NONE,              /* No event */
102         PDUMP_TRANSITION_EVENT_BLOCK_FINISHED,    /* Block mode event, current PDump-block has finished */
103         PDUMP_TRANSITION_EVENT_BLOCK_STARTED,     /* Block mode event, new PDump-block has started */
104         PDUMP_TRANSITION_EVENT_RANGE_ENTERED,     /* Transition into capture range */
105         PDUMP_TRANSITION_EVENT_RANGE_EXITED,      /* Transition out of capture range */
106 } PDUMP_TRANSITION_EVENT;
107
108 typedef PVRSRV_ERROR (*PFN_PDUMP_TRANSITION)(void *pvData, void *pvDevice, PDUMP_TRANSITION_EVENT eEvent, IMG_UINT32 ui32PDumpFlags);
109 typedef void (*PFN_PDUMP_SYNCBLOCKS)(PVRSRV_DEVICE_NODE *psDevNode, void *pvData, PDUMP_TRANSITION_EVENT eEvent);
110
111 typedef PVRSRV_ERROR (*PFN_PDUMP_TRANSITION_FENCE_SYNC)(void *pvData, PDUMP_TRANSITION_EVENT eEvent);
112
113 #ifdef PDUMP
114
115 /*! Macro used to record a panic in the PDump script stream */
116 #define PDUMP_PANIC(_dev, _id, _msg) do \
117                 { PVRSRV_ERROR _eE;\
118                         _eE = PDumpPanic((_dev), ((RGX_PDUMP_PANIC_ ## _id) & 0xFFFF), _msg, __func__, __LINE__);       \
119                         PVR_LOG_IF_ERROR(_eE, "PDumpPanic");\
120                 MSC_SUPPRESS_4127\
121                 } while (0)
122
123 /*! Macro used to record a driver error in the PDump script stream to invalidate the capture */
124 #define PDUMP_ERROR(_dev, _err, _msg) \
125         (void)PDumpCaptureError((_dev), _err, _msg, __func__, __LINE__)
126
127 #define SZ_MSG_SIZE_MAX                 PVRSRV_PDUMP_MAX_COMMENT_SIZE
128 #define SZ_SCRIPT_SIZE_MAX              PVRSRV_PDUMP_MAX_COMMENT_SIZE
129 #define SZ_FILENAME_SIZE_MAX    (PVRSRV_PDUMP_MAX_FILENAME_SIZE+sizeof(PDUMP_PARAM_N_FILE_NAME))
130
131 #define PDUMP_GET_SCRIPT_STRING()                                                                                                                                                       \
132         IMG_HANDLE hScript;                                                                                                                                                                             \
133         void *pvScriptAlloc;                                                                                                                                                                    \
134         IMG_UINT32 ui32MaxLen = SZ_SCRIPT_SIZE_MAX-1;                                                                                                                   \
135         pvScriptAlloc = OSAllocMem( SZ_SCRIPT_SIZE_MAX );                                                                                                               \
136         if (!pvScriptAlloc)                                                                                                                                                                             \
137         {                                                                                                                                                                                                               \
138                 PVR_DPF((PVR_DBG_ERROR, "PDUMP_GET_SCRIPT_STRING() failed to allocate memory for script buffer"));      \
139                 return PVRSRV_ERROR_OUT_OF_MEMORY;                                                                                                                                      \
140         }                                                                                                                                                                                                               \
141                                                                                                                                                                                                                         \
142         hScript = (IMG_HANDLE) pvScriptAlloc;
143
144 #define PDUMP_GET_MSG_STRING()                                                                                                                                                          \
145         IMG_CHAR *pszMsg;                                                                                                                                                                               \
146         void *pvMsgAlloc;                                                                                                                                                                               \
147         IMG_UINT32 ui32MaxLen = SZ_MSG_SIZE_MAX-1;                                                                                                                              \
148         pvMsgAlloc = OSAllocMem( SZ_MSG_SIZE_MAX );                                                                                                                             \
149         if (!pvMsgAlloc)                                                                                                                                                                                \
150         {                                                                                                                                                                                                               \
151                 PVR_DPF((PVR_DBG_ERROR, "PDUMP_GET_MSG_STRING() failed to allocate memory for message buffer"));        \
152                 return PVRSRV_ERROR_OUT_OF_MEMORY;                                                                                                                                      \
153         }                                                                                                                                                                                                               \
154         pszMsg = (IMG_CHAR *)pvMsgAlloc;
155
156 #define PDUMP_GET_SCRIPT_AND_FILE_STRING()                                                                                                                                      \
157         IMG_HANDLE hScript;                                                                                                                                                                             \
158         IMG_CHAR *pszFileName;                                                                                                                                                                  \
159         IMG_UINT32 ui32MaxLenScript = SZ_SCRIPT_SIZE_MAX-1;                                                                                                             \
160         void *pvScriptAlloc;                                                                                                                                                                    \
161         void *pvFileAlloc;                                                                                                                                                                              \
162         pvScriptAlloc = OSAllocMem( SZ_SCRIPT_SIZE_MAX );                                                                                                               \
163         if (!pvScriptAlloc)                                                                                                                                                                             \
164         {                                                                                                                                                                                                               \
165                 PVR_DPF((PVR_DBG_ERROR, "PDUMP_GET_SCRIPT_AND_FILE_STRING() failed to allocate memory for script buffer"));             \
166                 return PVRSRV_ERROR_OUT_OF_MEMORY;                                                                                                                                      \
167         }                                                                                                                                                                                                               \
168                                                                                                                                                                                                                         \
169         hScript = (IMG_HANDLE) pvScriptAlloc;                                                                                                                                   \
170         pvFileAlloc = OSAllocMem( SZ_FILENAME_SIZE_MAX );                                                                                                               \
171         if (!pvFileAlloc)                                                                                                                                                                               \
172         {                                                                                                                                                                                                               \
173                 PVR_DPF((PVR_DBG_ERROR, "PDUMP_GET_SCRIPT_AND_FILE_STRING() failed to allocate memory for filename buffer"));   \
174                 OSFreeMem(pvScriptAlloc);                                                                                                                                                       \
175                 return PVRSRV_ERROR_OUT_OF_MEMORY;                                                                                                                                      \
176         }                                                                                                                                                                                                               \
177         pszFileName = (IMG_CHAR *)pvFileAlloc;
178
179 #define PDUMP_RELEASE_SCRIPT_STRING()                                                                                                                                           \
180         if (pvScriptAlloc)                                                                                                                                                                              \
181         {                                                                                                                                                                                                               \
182                 OSFreeMem(pvScriptAlloc);                                                                                                                                                       \
183                 pvScriptAlloc = NULL;                                                                                                                                                           \
184         }
185
186 #define PDUMP_RELEASE_MSG_STRING()                                                                                                                                                      \
187         if (pvMsgAlloc)                                                                                                                                                                                 \
188         {                                                                                                                                                                                                               \
189                 OSFreeMem(pvMsgAlloc);                                                                                                                                                          \
190                 pvMsgAlloc = NULL;                                                                                                                                                                      \
191         }
192
193 #define PDUMP_RELEASE_FILE_STRING()                                                                                                                                                     \
194         if (pvFileAlloc)                                                                                                                                                                                \
195         {                                                                                                                                                                                                               \
196                 OSFreeMem(pvFileAlloc);                                                                                                                                                         \
197                 pvFileAlloc = NULL;                                                                                                                                                                     \
198         }
199
200 #define PDUMP_RELEASE_SCRIPT_AND_FILE_STRING()                                                                                                                          \
201         if (pvScriptAlloc)                                                                                                                                                                              \
202         {                                                                                                                                                                                                               \
203                 OSFreeMem(pvScriptAlloc);                                                                                                                                                       \
204                 pvScriptAlloc = NULL;                                                                                                                                                           \
205         }                                                                                                                                                                                                               \
206         if (pvFileAlloc)                                                                                                                                                                                \
207         {                                                                                                                                                                                                               \
208                 OSFreeMem(pvFileAlloc);                                                                                                                                                         \
209                 pvFileAlloc = NULL;                                                                                                                                                                     \
210         }
211
212
213 /* Shared across pdump_x files */
214 PVRSRV_ERROR PDumpInitCommon(void);
215 void PDumpDeInitCommon(void);
216 PVRSRV_ERROR PDumpReady(void);
217 void PDumpGetParameterZeroPageInfo(PDUMP_FILEOFFSET_T *puiZeroPageOffset,
218                                    size_t *puiZeroPageSize,
219                                    const IMG_CHAR **ppszZeroPageFilename);
220
221 void PDumpConnectionNotify(PVRSRV_DEVICE_NODE *psDeviceNode);
222 void PDumpDisconnectionNotify(PVRSRV_DEVICE_NODE *psDeviceNode);
223
224 void PDumpStopInitPhase(PVRSRV_DEVICE_NODE *psDeviceNode);
225 PVRSRV_ERROR PDumpSetFrameKM(CONNECTION_DATA *psConnection,
226                              PVRSRV_DEVICE_NODE *psDeviceNode,
227                              IMG_UINT32 ui32Frame);
228 PVRSRV_ERROR PDumpGetFrameKM(CONNECTION_DATA *psConnection,
229                              PVRSRV_DEVICE_NODE * psDeviceNode,
230                              IMG_UINT32* pui32Frame);
231 PVRSRV_ERROR PDumpCommentKM(CONNECTION_DATA *psConnection,
232                             PVRSRV_DEVICE_NODE *psDeviceNode,
233                             IMG_UINT32 ui32CommentSize,
234                             IMG_CHAR *pszComment,
235                             IMG_UINT32 ui32Flags);
236
237 PVRSRV_ERROR PDumpSetDefaultCaptureParamsKM(CONNECTION_DATA *psConnection,
238                                             PVRSRV_DEVICE_NODE *psDeviceNode,
239                                             IMG_UINT32 ui32Mode,
240                                             IMG_UINT32 ui32Start,
241                                             IMG_UINT32 ui32End,
242                                             IMG_UINT32 ui32Interval,
243                                             IMG_UINT32 ui32MaxParamFileSize);
244
245
246 PVRSRV_ERROR PDumpReg32(PVRSRV_DEVICE_NODE *psDeviceNode,
247                         IMG_CHAR *pszPDumpRegName,
248                         IMG_UINT32 ui32RegAddr,
249                         IMG_UINT32 ui32RegValue,
250                         IMG_UINT32 ui32Flags);
251
252 PVRSRV_ERROR PDumpReg64(PVRSRV_DEVICE_NODE *psDeviceNode,
253                         IMG_CHAR *pszPDumpRegName,
254                         IMG_UINT32 ui32RegAddr,
255                         IMG_UINT64 ui64RegValue,
256                         IMG_UINT32 ui32Flags);
257
258 PVRSRV_ERROR PDumpRegLabelToReg64(PVRSRV_DEVICE_NODE *psDeviceNode,
259                                   IMG_CHAR *pszPDumpRegName,
260                                   IMG_UINT32 ui32RegDst,
261                                   IMG_UINT32 ui32RegSrc,
262                                   IMG_UINT32 ui32Flags);
263
264 PVRSRV_ERROR PDumpPhysHandleToInternalVar64(PVRSRV_DEVICE_NODE *psDeviceNode,
265                                             IMG_CHAR *pszInternalVar,
266                                             IMG_HANDLE hPdumpPages,
267                                             IMG_UINT32 ui32Flags);
268
269 PVRSRV_ERROR PDumpMemLabelToInternalVar64(IMG_CHAR *pszInternalVar,
270                                           PMR *psPMR,
271                                           IMG_DEVMEM_OFFSET_T uiLogicalOffset,
272                                           IMG_UINT32 ui32Flags);
273
274 PVRSRV_ERROR PDumpInternalVarToMemLabel(PMR *psPMR,
275                                         IMG_DEVMEM_OFFSET_T uiLogicalOffset,
276                                         IMG_CHAR *pszInternalVar,
277                                         IMG_UINT32 ui32Flags);
278
279 PVRSRV_ERROR PDumpWriteVarORValueOp(PVRSRV_DEVICE_NODE *psDeviceNode,
280                                     const IMG_CHAR *pszInternalVariable,
281                                     const IMG_UINT64 ui64Value,
282                                     const IMG_UINT32 ui32PDumpFlags);
283
284 PVRSRV_ERROR PDumpWriteVarANDValueOp(PVRSRV_DEVICE_NODE *psDeviceNode,
285                                      const IMG_CHAR *pszInternalVariable,
286                                      const IMG_UINT64 ui64Value,
287                                      const IMG_UINT32 ui32PDumpFlags);
288
289 PVRSRV_ERROR PDumpWriteVarSHRValueOp(PVRSRV_DEVICE_NODE *psDeviceNode,
290                                      const IMG_CHAR *pszInternalVariable,
291                                      const IMG_UINT64 ui64Value,
292                                      const IMG_UINT32 ui32PDumpFlags);
293
294 PVRSRV_ERROR PDumpWriteVarORVarOp(PVRSRV_DEVICE_NODE *psDeviceNode,
295                                   const IMG_CHAR *pszInternalVar,
296                                   const IMG_CHAR *pszInternalVar2,
297                                   const IMG_UINT32 ui32PDumpFlags);
298
299 PVRSRV_ERROR PDumpWriteVarANDVarOp(PVRSRV_DEVICE_NODE *psDeviceNode,
300                                    const IMG_CHAR *pszInternalVar,
301                                    const IMG_CHAR *pszInternalVar2,
302                                    const IMG_UINT32 ui32PDumpFlags);
303
304 PVRSRV_ERROR PDumpInternalVarToReg32(PVRSRV_DEVICE_NODE *psDeviceNode,
305                                      IMG_CHAR *pszPDumpRegName,
306                                      IMG_UINT32 ui32Reg,
307                                      IMG_CHAR *pszInternalVar,
308                                      IMG_UINT32 ui32Flags);
309
310 PVRSRV_ERROR PDumpInternalVarToReg64(PVRSRV_DEVICE_NODE *psDeviceNode,
311                                      IMG_CHAR *pszPDumpRegName,
312                                      IMG_UINT32 ui32Reg,
313                                      IMG_CHAR *pszInternalVar,
314                                      IMG_UINT32 ui32Flags);
315
316 PVRSRV_ERROR PDumpMemLabelToMem32(PMR *psPMRSource,
317                                   PMR *psPMRDest,
318                                   IMG_DEVMEM_OFFSET_T uiLogicalOffsetSource,
319                                   IMG_DEVMEM_OFFSET_T uiLogicalOffsetDest,
320                                   IMG_UINT32 ui32Flags);
321
322 PVRSRV_ERROR PDumpMemLabelToMem64(PMR *psPMRSource,
323                                   PMR *psPMRDest,
324                                   IMG_DEVMEM_OFFSET_T uiLogicalOffsetSource,
325                                   IMG_DEVMEM_OFFSET_T uiLogicalOffsetDest,
326                                   IMG_UINT32 ui32Flags);
327
328 PVRSRV_ERROR PDumpRegLabelToMem32(IMG_CHAR *pszPDumpRegName,
329                                   IMG_UINT32 ui32Reg,
330                                   PMR *psPMR,
331                                   IMG_DEVMEM_OFFSET_T uiLogicalOffset,
332                                   IMG_UINT32 ui32Flags);
333
334 PVRSRV_ERROR PDumpRegLabelToMem64(IMG_CHAR *pszPDumpRegName,
335                                   IMG_UINT32 ui32Reg,
336                                   PMR *psPMR,
337                                   IMG_DEVMEM_OFFSET_T uiLogicalOffset,
338                                   IMG_UINT32 ui32Flags);
339
340 PVRSRV_ERROR PDumpRegLabelToInternalVar(PVRSRV_DEVICE_NODE *psDeviceNode,
341                                         IMG_CHAR *pszPDumpRegName,
342                                         IMG_UINT32 ui32Reg,
343                                         IMG_CHAR *pszInternalVar,
344                                         IMG_UINT32 ui32Flags);
345
346 PVRSRV_ERROR PDumpSAW(PVRSRV_DEVICE_NODE *psDeviceNode,
347                       IMG_CHAR      *pszDevSpaceName,
348                       IMG_UINT32    ui32HPOffsetBytes,
349                       IMG_UINT32    ui32NumSaveBytes,
350                       IMG_CHAR      *pszOutfileName,
351                       IMG_UINT32    ui32OutfileOffsetByte,
352                       PDUMP_FLAGS_T uiPDumpFlags);
353
354 PVRSRV_ERROR PDumpRegPolKM(PVRSRV_DEVICE_NODE *psDeviceNode,
355                            IMG_CHAR            *pszPDumpRegName,
356                            IMG_UINT32          ui32RegAddr,
357                            IMG_UINT32          ui32RegValue,
358                            IMG_UINT32          ui32Mask,
359                            IMG_UINT32          ui32Flags,
360                            PDUMP_POLL_OPERATOR eOperator);
361
362
363 /**************************************************************************/ /*!
364 @Function       PDumpImageDescriptor
365 @Description    PDumps image data out as an IMGBv2 data section
366 @Input          psDeviceNode         Pointer to device node.
367 @Input          ui32MMUContextID     PDUMP MMU context ID.
368 @Input          pszSABFileName       Pointer to string containing file name of
369                                      Image being SABed
370 @Input          sData                GPU virtual address of this surface.
371 @Input          ui32DataSize         Image data size
372 @Input          ui32LogicalWidth     Image logical width
373 @Input          ui32LogicalHeight    Image logical height
374 @Input          ui32PhysicalWidth    Image physical width
375 @Input          ui32PhysicalHeight   Image physical height
376 @Input          ePixFmt              Image pixel format
377 @Input          eFBCompression       FB compression mode
378 @Input          paui32FBCClearColour FB clear colour (Only applicable to FBC surfaces)
379 @Input          eFBCSwizzle          FBC channel swizzle (Only applicable to FBC surfaces)
380 @Input          sHeader              GPU virtual address of the headers of this
381                                      surface (Only applicable to FBC surfaces)
382 @Input          ui32HeaderSize       Header size (Only applicable to FBC surfaces)
383 @Input          ui32PDumpFlags       PDUMP flags
384 @Return         PVRSRV_ERROR:        PVRSRV_OK on success. Otherwise, a PVRSRV_
385                                      error code
386 */ /***************************************************************************/
387 PVRSRV_ERROR PDumpImageDescriptor(PVRSRV_DEVICE_NODE *psDeviceNode,
388                                   IMG_UINT32 ui32MMUContextID,
389                                   IMG_CHAR *pszSABFileName,
390                                   IMG_DEV_VIRTADDR sData,
391                                   IMG_UINT32 ui32DataSize,
392                                   IMG_UINT32 ui32LogicalWidth,
393                                   IMG_UINT32 ui32LogicalHeight,
394                                   IMG_UINT32 ui32PhysicalWidth,
395                                   IMG_UINT32 ui32PhysicalHeight,
396                                   PDUMP_PIXEL_FORMAT ePixFmt,
397                                   IMG_MEMLAYOUT eMemLayout,
398                                   IMG_FB_COMPRESSION eFBCompression,
399                                   const IMG_UINT32 *paui32FBCClearColour,
400                                   PDUMP_FBC_SWIZZLE eFBCSwizzle,
401                                   IMG_DEV_VIRTADDR sHeader,
402                                   IMG_UINT32 ui32HeaderSize,
403                                   IMG_UINT32 ui32PDumpFlags);
404
405 /**************************************************************************/ /*!
406 @Function       PDumpDataDescriptor
407 @Description    PDumps non-image data out as an IMGCv1 data section
408 @Input          psDeviceNode         Pointer to device node.
409 @Input          ui32MMUContextID     PDUMP MMU context ID.
410 @Input          pszSABFileName       Pointer to string containing file name of
411                                      Data being SABed
412 @Input          sData                GPU virtual address of this data.
413 @Input          ui32DataSize         Data size
414 @Input          ui32HeaderType       Header type
415 @Input          ui32ElementType      Data element type
416 @Input          ui32ElementCount     Number of data elements
417 @Input          ui32PDumpFlags       PDUMP flags
418 @Return         PVRSRV_ERROR:        PVRSRV_OK on success. Otherwise, a PVRSRV_
419                                      error code
420 */ /***************************************************************************/
421 PVRSRV_ERROR PDumpDataDescriptor(PVRSRV_DEVICE_NODE *psDeviceNode,
422                                  IMG_UINT32 ui32MMUContextID,
423                                  IMG_CHAR *pszSABFileName,
424                                  IMG_DEV_VIRTADDR sData,
425                                  IMG_UINT32 ui32DataSize,
426                                  IMG_UINT32 ui32HeaderType,
427                                  IMG_UINT32 ui32ElementType,
428                                  IMG_UINT32 ui32ElementCount,
429                                  IMG_UINT32 ui32PDumpFlags);
430
431
432 PVRSRV_ERROR PDumpReadRegKM(PVRSRV_DEVICE_NODE *psDeviceNode,
433                             IMG_CHAR *pszPDumpRegName,
434                             IMG_CHAR *pszFileName,
435                             IMG_UINT32 ui32FileOffset,
436                             IMG_UINT32 ui32Address,
437                             IMG_UINT32 ui32Size,
438                             IMG_UINT32 ui32PDumpFlags);
439
440 __printf(3, 4)
441 PVRSRV_ERROR PDumpCommentWithFlags(PVRSRV_DEVICE_NODE *psDeviceNode,
442                                    IMG_UINT32 ui32Flags,
443                                    IMG_CHAR* pszFormat,
444                                    ...);
445
446 PVRSRV_ERROR PDumpCommentWithFlagsVA(PVRSRV_DEVICE_NODE *psDeviceNode,
447                                      IMG_UINT32 ui32Flags,
448                                      const IMG_CHAR * pszFormat,
449                                      va_list args);
450
451 PVRSRV_ERROR PDumpPanic(PVRSRV_DEVICE_NODE *psDeviceNode,
452                         IMG_UINT32      ui32PanicNo,
453                         IMG_CHAR*       pszPanicMsg,
454                         const IMG_CHAR* pszPPFunc,
455                         IMG_UINT32      ui32PPline);
456
457 PVRSRV_ERROR PDumpCaptureError(PVRSRV_DEVICE_NODE *psDeviceNode,
458                                PVRSRV_ERROR    ui32ErrorNo,
459                                IMG_CHAR*       pszErrorMsg,
460                                const IMG_CHAR* pszPPFunc,
461                                IMG_UINT32      ui32PPline);
462
463 PVRSRV_ERROR PDumpIsLastCaptureFrameKM(IMG_BOOL *pbIsLastCaptureFrame);
464
465 PVRSRV_ERROR PDumpGetStateKM(IMG_UINT64 *ui64State);
466
467 PVRSRV_ERROR PDumpForceCaptureStopKM(CONNECTION_DATA *psConnection,
468                                      PVRSRV_DEVICE_NODE *psDeviceNode);
469
470 PVRSRV_ERROR PDumpRegRead32ToInternalVar(PVRSRV_DEVICE_NODE *psDeviceNode,
471                                          IMG_CHAR *pszPDumpRegName,
472                                          IMG_UINT32 ui32RegOffset,
473                                          IMG_CHAR *pszInternalVar,
474                                          IMG_UINT32 ui32Flags);
475
476 PVRSRV_ERROR PDumpRegRead32(PVRSRV_DEVICE_NODE *psDeviceNode,
477                             IMG_CHAR *pszPDumpRegName,
478                             const IMG_UINT32 dwRegOffset,
479                             IMG_UINT32 ui32Flags);
480
481 PVRSRV_ERROR PDumpRegRead64(PVRSRV_DEVICE_NODE *psDeviceNode,
482                             IMG_CHAR *pszPDumpRegName,
483                             const IMG_UINT32 dwRegOffset,
484                             IMG_UINT32 ui32Flags);
485
486 PVRSRV_ERROR PDumpRegRead64ToInternalVar(PVRSRV_DEVICE_NODE *psDeviceNode,
487                                          IMG_CHAR *pszPDumpRegName,
488                                          IMG_CHAR *pszInternalVar,
489                                          const IMG_UINT32 dwRegOffset,
490                                          IMG_UINT32     ui32Flags);
491
492 PVRSRV_ERROR PDumpIDLWithFlags(PVRSRV_DEVICE_NODE *psDeviceNode,
493                                IMG_UINT32 ui32Clocks,
494                                IMG_UINT32 ui32Flags);
495 PVRSRV_ERROR PDumpIDL(PVRSRV_DEVICE_NODE *psDeviceNode,
496                       IMG_UINT32 ui32Clocks);
497
498 PVRSRV_ERROR PDumpRegBasedCBP(PVRSRV_DEVICE_NODE *psDeviceNode,
499                               IMG_CHAR   *pszPDumpRegName,
500                               IMG_UINT32 ui32RegOffset,
501                               IMG_UINT32 ui32WPosVal,
502                               IMG_UINT32 ui32PacketSize,
503                               IMG_UINT32 ui32BufferSize,
504                               IMG_UINT32 ui32Flags);
505
506 PVRSRV_ERROR PDumpTRG(PVRSRV_DEVICE_NODE *psDeviceNode,
507                       IMG_CHAR *pszMemSpace,
508                       IMG_UINT32 ui32MMUCtxID,
509                       IMG_UINT32 ui32RegionID,
510                       IMG_BOOL bEnable,
511                       IMG_UINT64 ui64VAddr,
512                       IMG_UINT64 ui64LenBytes,
513                       IMG_UINT32 ui32XStride,
514                       IMG_UINT32 ui32Flags);
515
516 void PDumpLock(void);
517 void PDumpUnlock(void);
518
519 PVRSRV_ERROR PDumpRegCondStr(IMG_CHAR            **ppszPDumpCond,
520                              IMG_CHAR            *pszPDumpRegName,
521                              IMG_UINT32          ui32RegAddr,
522                              IMG_UINT32          ui32RegValue,
523                              IMG_UINT32          ui32Mask,
524                              IMG_UINT32          ui32Flags,
525                              PDUMP_POLL_OPERATOR eOperator);
526
527 PVRSRV_ERROR PDumpInternalValCondStr(IMG_CHAR            **ppszPDumpCond,
528                                      IMG_CHAR            *pszInternalVar,
529                                      IMG_UINT32          ui32RegValue,
530                                      IMG_UINT32          ui32Mask,
531                                      IMG_UINT32          ui32Flags,
532                                      PDUMP_POLL_OPERATOR eOperator);
533
534 PVRSRV_ERROR PDumpIfKM(PVRSRV_DEVICE_NODE *psDeviceNode,
535                        IMG_CHAR *pszPDumpCond, IMG_UINT32 ui32PDumpFlags);
536 PVRSRV_ERROR PDumpElseKM(PVRSRV_DEVICE_NODE *psDeviceNode,
537                          IMG_CHAR *pszPDumpCond, IMG_UINT32 ui32PDumpFlags);
538 PVRSRV_ERROR PDumpFiKM(PVRSRV_DEVICE_NODE *psDeviceNode,
539                        IMG_CHAR *pszPDumpCond, IMG_UINT32 ui32PDumpFlags);
540 PVRSRV_ERROR PDumpStartDoLoopKM(PVRSRV_DEVICE_NODE *psDeviceNode,
541                                 IMG_UINT32 ui32PDumpFlags);
542 PVRSRV_ERROR PDumpEndDoWhileLoopKM(PVRSRV_DEVICE_NODE *psDeviceNode,
543                                    IMG_CHAR *pszPDumpWhileCond,
544                                    IMG_UINT32 ui32PDumpFlags);
545 PVRSRV_ERROR PDumpCOMCommand(PVRSRV_DEVICE_NODE *psDeviceNode,
546                              IMG_UINT32 ui32PDumpFlags,
547                              const IMG_CHAR *pszPDump);
548
549 void PDumpPowerTransitionStart(PVRSRV_DEVICE_NODE *psDeviceNode);
550 void PDumpPowerTransitionEnd(PVRSRV_DEVICE_NODE *psDeviceNode);
551 IMG_BOOL PDumpCheckFlagsWrite(PVRSRV_DEVICE_NODE *psDeviceNode,
552                               IMG_UINT32 ui32Flags);
553
554 /*!
555  * @name        PDumpWriteParameter
556  * @brief       General function for writing to PDump stream. Used
557  *          mainly for memory dumps to parameter stream.
558  *          Usually more convenient to use PDumpWriteScript below
559  *          for the script stream.
560  * @param       psDeviceNode - device PDump pertains to
561  * @param       psui8Data - data to write
562  * @param       ui32Size - size of write
563  * @param       ui32Flags - PDump flags
564  * @param   pui32FileOffset - on return contains the file offset to
565  *                            the start of the parameter data
566  * @param   aszFilenameStr - pointer to at least a 20 char buffer to
567  *                           return the parameter filename
568  * @return      error
569  */
570 PVRSRV_ERROR PDumpWriteParameter(PVRSRV_DEVICE_NODE *psDeviceNode,
571                                  IMG_UINT8 *psui8Data, IMG_UINT32 ui32Size,
572                                  IMG_UINT32 ui32Flags, IMG_UINT32* pui32FileOffset,
573                                  IMG_CHAR* aszFilenameStr);
574
575 /*!
576  * @name        PDumpWriteScript
577  * @brief       Write an PDumpOS created string to the "script" output stream
578  * @param       psDeviceNode - device PDump pertains to
579  * @param       hString - PDump OS layer handle of string buffer to write
580  * @param       ui32Flags - PDump flags
581  * @return      IMG_TRUE on success.
582  */
583 IMG_BOOL PDumpWriteScript(PVRSRV_DEVICE_NODE *psDeviceNode,
584                           IMG_HANDLE hString, IMG_UINT32 ui32Flags);
585
586 /**************************************************************************/ /*!
587 @Function       PDumpSNPrintf
588 @Description    Printf to OS-specific PDump state buffer. This function is
589                 only called if PDUMP is defined.
590 @Input          hBuf               handle of buffer to write into
591 @Input          ui32ScriptSizeMax  maximum size of data to write (chars)
592 @Input          pszFormat          format string
593 @Return         None
594 */ /**************************************************************************/
595 __printf(3, 4)
596 PVRSRV_ERROR PDumpSNPrintf(IMG_HANDLE hBuf, IMG_UINT32 ui32ScriptSizeMax, IMG_CHAR* pszFormat, ...);
597
598
599 /*
600         PDumpWriteShiftedMaskedValue():
601
602         loads the "reference" address into an internal PDump register,
603         optionally shifts it right,
604         optionally shifts it left,
605         optionally masks it
606         then finally writes the computed value to the given destination address
607
608         i.e. it emits pdump language equivalent to this expression:
609
610          dest = ((&ref) >> SHRamount << SHLamount) & MASK
611 */
612 PVRSRV_ERROR
613 PDumpWriteShiftedMaskedValue(PVRSRV_DEVICE_NODE *psDeviceNode,
614                              const IMG_CHAR *pszDestRegspaceName,
615                              const IMG_CHAR *pszDestSymbolicName,
616                              IMG_DEVMEM_OFFSET_T uiDestOffset,
617                              const IMG_CHAR *pszRefRegspaceName,
618                              const IMG_CHAR *pszRefSymbolicName,
619                              IMG_DEVMEM_OFFSET_T uiRefOffset,
620                              IMG_UINT32 uiSHRAmount,
621                              IMG_UINT32 uiSHLAmount,
622                              IMG_UINT32 uiMask,
623                              IMG_DEVMEM_SIZE_T uiWordSize,
624                              IMG_UINT32 uiPDumpFlags);
625
626 /*
627         PDumpWriteSymbAddress():
628         writes the address of the "reference" to the offset given
629 */
630 PVRSRV_ERROR
631 PDumpWriteSymbAddress(PVRSRV_DEVICE_NODE *psDeviceNode,
632                       const IMG_CHAR *pszDestSpaceName,
633                       IMG_DEVMEM_OFFSET_T uiDestOffset,
634                       const IMG_CHAR *pszRefSymbolicName,
635                       IMG_DEVMEM_OFFSET_T uiRefOffset,
636                       const IMG_CHAR *pszPDumpDevName,
637                       IMG_UINT32 ui32WordSize,
638                       IMG_UINT32 ui32AlignShift,
639                       IMG_UINT32 ui32Shift,
640                       IMG_UINT32 uiPDumpFlags);
641
642 /* Register the connection with the PDump subsystem */
643 PVRSRV_ERROR
644 PDumpRegisterConnection(void *hSyncPrivData,
645                         PFN_PDUMP_SYNCBLOCKS pfnPDumpSyncBlocks,
646                         PDUMP_CONNECTION_DATA **ppsPDumpConnectionData);
647
648 /* Unregister the connection with the PDump subsystem */
649 void
650 PDumpUnregisterConnection(PDUMP_CONNECTION_DATA *psPDumpConnectionData);
651
652 /* Register for notification of PDump Transition into/out of capture range */
653 PVRSRV_ERROR
654 PDumpRegisterTransitionCallback(PDUMP_CONNECTION_DATA *psPDumpConnectionData,
655                                 PFN_PDUMP_TRANSITION pfnCallback,
656                                 void *hPrivData,
657                                 void *pvDevice,
658                                 void **ppvHandle);
659
660 /* Unregister notification of PDump Transition */
661 void
662 PDumpUnregisterTransitionCallback(void *pvHandle);
663
664 PVRSRV_ERROR
665 PDumpRegisterTransitionCallbackFenceSync(void *hPrivData,
666                                          PFN_PDUMP_TRANSITION_FENCE_SYNC pfnCallback,
667                                          void **ppvHandle);
668
669 void
670 PDumpUnregisterTransitionCallbackFenceSync(void *pvHandle);
671
672 /* Notify PDump of a Transition into/out of capture range */
673 PVRSRV_ERROR
674 PDumpTransition(PVRSRV_DEVICE_NODE *psDeviceNode,
675                 PDUMP_CONNECTION_DATA *psPDumpConnectionData,
676                 PDUMP_TRANSITION_EVENT eEvent,
677                 IMG_UINT32 ui32PDumpFlags);
678
679 /* Check if writing to a PDump file is permitted for the given device */
680 IMG_BOOL PDumpIsDevicePermitted(PVRSRV_DEVICE_NODE *psDeviceNode);
681
682 /* _ui32PDumpFlags must be a variable in the local scope */
683 #define PDUMP_LOCK(_ui32PDumpFlags) do \
684         { if ((_ui32PDumpFlags & PDUMP_FLAGS_PDUMP_LOCK_HELD) == 0)\
685                 {\
686                         PDumpLock();\
687                 }\
688         MSC_SUPPRESS_4127\
689         } while (0)
690
691 /* _ui32PDumpFlags must be a variable in the local scope */
692 #define PDUMP_UNLOCK(_ui32PDumpFlags) do \
693         { if ((_ui32PDumpFlags & PDUMP_FLAGS_PDUMP_LOCK_HELD) == 0)\
694                 {\
695                         PDumpUnlock();\
696                 }\
697         MSC_SUPPRESS_4127\
698         } while (0)
699
700 #define PDUMPINIT                               PDumpInitCommon
701 #define PDUMPDEINIT                             PDumpDeInitCommon
702 #define PDUMPREG32                              PDumpReg32
703 #define PDUMPREG64                              PDumpReg64
704 #define PDUMPREGREAD32                  PDumpRegRead32
705 #define PDUMPREGREAD64                  PDumpRegRead64
706 #define PDUMPCOMMENT(d, ...)    PDumpCommentWithFlags(d, PDUMP_FLAGS_CONTINUOUS, __VA_ARGS__)
707 #define PDUMPCOMMENTWITHFLAGS   PDumpCommentWithFlags
708 #define PDUMPREGPOL                             PDumpRegPolKM
709 #define PDUMPREGBASEDCBP                PDumpRegBasedCBP
710 #define PDUMPENDINITPHASE               PDumpStopInitPhase
711 #define PDUMPIDLWITHFLAGS               PDumpIDLWithFlags
712 #define PDUMPIDL                                PDumpIDL
713 #define PDUMPPOWCMDSTART                PDumpPowerTransitionStart
714 #define PDUMPPOWCMDEND                  PDumpPowerTransitionEnd
715 #define PDUMPCOM                                PDumpCOMCommand
716
717 /* _ui32PDumpFlags must be a variable in the local scope */
718 #define PDUMP_BLKSTART(_ui32PDumpFlags) do \
719         { PDUMP_LOCK(_ui32PDumpFlags);\
720         _ui32PDumpFlags |= PDUMP_FLAGS_PDUMP_LOCK_HELD;\
721         MSC_SUPPRESS_4127\
722         } while (0)
723
724 /* _ui32PDumpFlags must be a variable in the local scope */
725 #define PDUMP_BLKEND(_ui32PDumpFlags) do \
726         { _ui32PDumpFlags &= ~PDUMP_FLAGS_PDUMP_LOCK_HELD;\
727         PDUMP_UNLOCK(_ui32PDumpFlags);\
728         MSC_SUPPRESS_4127\
729         } while (0)
730
731 /* _ui32PDumpFlags must be a variable in the local scope */
732 #define PDUMPIF(_dev,_msg,_ui32PDumpFlags) do \
733         {PDUMP_BLKSTART(_ui32PDumpFlags);\
734         PDumpIfKM(_dev,_msg,_ui32PDumpFlags);\
735         MSC_SUPPRESS_4127\
736         } while (0)
737
738 #define PDUMPELSE                               PDumpElseKM
739
740 /* _ui32PDumpFlags must be a variable in the local scope */
741 #define PDUMPFI(_dev,_msg,_ui32PDumpFlags) do \
742         { PDumpFiKM(_dev,_msg,_ui32PDumpFlags);\
743         PDUMP_BLKEND(_ui32PDumpFlags);\
744         MSC_SUPPRESS_4127\
745         } while (0)
746
747 #else
748 /*
749         We should be clearer about which functions can be called
750         across the bridge as this looks rather unbalanced
751 */
752
753 /*! Macro used to record a panic in the PDump script stream */
754 #define PDUMP_PANIC(_dev, _id, _msg)  ((void)0)
755
756 /*! Macro used to record a driver error in the PDump script stream to invalidate the capture */
757 #define PDUMP_ERROR(_dev, _err, _msg) ((void)0)
758
759 #ifdef INLINE_IS_PRAGMA
760 #pragma inline(PDumpInitCommon)
761 #endif
762 static INLINE PVRSRV_ERROR
763 PDumpInitCommon(void)
764 {
765         return PVRSRV_OK;
766 }
767
768 #ifdef INLINE_IS_PRAGMA
769 #pragma inline(PDumpConnectionNotify)
770 #endif
771 static INLINE void
772 PDumpConnectionNotify(PVRSRV_DEVICE_NODE *psDeviceNode)
773 {
774         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
775 }
776
777 #ifdef INLINE_IS_PRAGMA
778 #pragma inline(PDumpDisconnectionNotify)
779 #endif
780 static INLINE void
781 PDumpDisconnectionNotify(PVRSRV_DEVICE_NODE *psDeviceNode)
782 {
783         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
784 }
785
786 #ifdef INLINE_IS_PRAGMA
787 #pragma inline(PDumpLock)
788 #endif
789 static INLINE void
790 PDumpLock(void)
791 {
792 }
793
794 #ifdef INLINE_IS_PRAGMA
795 #pragma inline(PDumpUnlock)
796 #endif
797 static INLINE void
798 PDumpUnlock(void)
799 {
800 }
801
802 #ifdef INLINE_IS_PRAGMA
803 #pragma inline(PDumpStopInitPhase)
804 #endif
805 static INLINE void
806 PDumpStopInitPhase(PVRSRV_DEVICE_NODE *psDeviceNode)
807 {
808         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
809 }
810
811 #ifdef INLINE_IS_PRAGMA
812 #pragma inline(PDumpSetFrameKM)
813 #endif
814 static INLINE PVRSRV_ERROR
815 PDumpSetFrameKM(CONNECTION_DATA *psConnection,
816                 PVRSRV_DEVICE_NODE *psDevNode,
817                 IMG_UINT32 ui32Frame)
818 {
819         PVR_UNREFERENCED_PARAMETER(psConnection);
820         PVR_UNREFERENCED_PARAMETER(ui32Frame);
821         return PVRSRV_OK;
822 }
823
824 #ifdef INLINE_IS_PRAGMA
825 #pragma inline(PDumpGetFrameKM)
826 #endif
827 static INLINE PVRSRV_ERROR
828 PDumpGetFrameKM(CONNECTION_DATA *psConnection,
829                 PVRSRV_DEVICE_NODE *psDeviceNode,
830                 IMG_UINT32* pui32Frame)
831 {
832         PVR_UNREFERENCED_PARAMETER(psConnection);
833         PVR_UNREFERENCED_PARAMETER(pui32Frame);
834         return PVRSRV_OK;
835 }
836
837 #ifdef INLINE_IS_PRAGMA
838 #pragma inline(PDumpCommentKM)
839 #endif
840 static INLINE PVRSRV_ERROR
841 PDumpCommentKM(CONNECTION_DATA *psConnection,
842                PVRSRV_DEVICE_NODE *psDeviceNode,
843                IMG_UINT32 ui32CommentSize,
844                IMG_CHAR *pszComment,
845                IMG_UINT32 ui32Flags)
846 {
847         PVR_UNREFERENCED_PARAMETER(psConnection);
848         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
849     PVR_UNREFERENCED_PARAMETER(ui32CommentSize);
850         PVR_UNREFERENCED_PARAMETER(pszComment);
851         PVR_UNREFERENCED_PARAMETER(ui32Flags);
852         return PVRSRV_OK;
853 }
854
855
856 #ifdef INLINE_IS_PRAGMA
857 #pragma inline(PDumpSetDefaultCaptureParamsKM)
858 #endif
859 static INLINE PVRSRV_ERROR
860 PDumpSetDefaultCaptureParamsKM(CONNECTION_DATA *psConnection,
861                                PVRSRV_DEVICE_NODE *psDeviceNode,
862                                IMG_UINT32 ui32Mode,
863                                IMG_UINT32 ui32Start,
864                                IMG_UINT32 ui32End,
865                                IMG_UINT32 ui32Interval,
866                                IMG_UINT32 ui32MaxParamFileSize)
867 {
868         PVR_UNREFERENCED_PARAMETER(psConnection);
869         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
870         PVR_UNREFERENCED_PARAMETER(ui32Mode);
871         PVR_UNREFERENCED_PARAMETER(ui32Start);
872         PVR_UNREFERENCED_PARAMETER(ui32End);
873         PVR_UNREFERENCED_PARAMETER(ui32Interval);
874         PVR_UNREFERENCED_PARAMETER(ui32MaxParamFileSize);
875
876         return PVRSRV_OK;
877 }
878
879
880 #ifdef INLINE_IS_PRAGMA
881 #pragma inline(PDumpPanic)
882 #endif
883 static INLINE PVRSRV_ERROR
884 PDumpPanic(IMG_UINT32      ui32PanicNo,
885            IMG_CHAR*       pszPanicMsg,
886            const IMG_CHAR* pszPPFunc,
887            IMG_UINT32      ui32PPline)
888 {
889         PVR_UNREFERENCED_PARAMETER(ui32PanicNo);
890         PVR_UNREFERENCED_PARAMETER(pszPanicMsg);
891         PVR_UNREFERENCED_PARAMETER(pszPPFunc);
892         PVR_UNREFERENCED_PARAMETER(ui32PPline);
893         return PVRSRV_OK;
894 }
895
896 #ifdef INLINE_IS_PRAGMA
897 #pragma inline(PDumpCaptureError)
898 #endif
899 static INLINE PVRSRV_ERROR
900 PDumpCaptureError(PVRSRV_ERROR    ui32ErrorNo,
901                   IMG_CHAR*       pszErrorMsg,
902                   const IMG_CHAR* pszPPFunc,
903                   IMG_UINT32      ui32PPline)
904 {
905         PVR_UNREFERENCED_PARAMETER(ui32ErrorNo);
906         PVR_UNREFERENCED_PARAMETER(pszErrorMsg);
907         PVR_UNREFERENCED_PARAMETER(pszPPFunc);
908         PVR_UNREFERENCED_PARAMETER(ui32PPline);
909         return PVRSRV_OK;
910 }
911
912 #ifdef INLINE_IS_PRAGMA
913 #pragma inline(PDumpIsLastCaptureFrameKM)
914 #endif
915 static INLINE PVRSRV_ERROR
916 PDumpIsLastCaptureFrameKM(IMG_BOOL *pbIsLastCaptureFrame)
917 {
918         *pbIsLastCaptureFrame = IMG_FALSE;
919         return PVRSRV_OK;
920 }
921
922 #ifdef INLINE_IS_PRAGMA
923 #pragma inline(PDumpGetStateKM)
924 #endif
925 static INLINE PVRSRV_ERROR
926 PDumpGetStateKM(IMG_UINT64 *ui64State)
927 {
928         *ui64State = 0;
929         return PVRSRV_OK;
930 }
931
932 #ifdef INLINE_IS_PRAGMA
933 #pragma inline(PDumpForceCaptureStopKM)
934 #endif
935 static INLINE PVRSRV_ERROR
936 PDumpForceCaptureStopKM(CONNECTION_DATA *psConnection,
937                         PVRSRV_DEVICE_NODE *psDeviceNode)
938 {
939         PVR_UNREFERENCED_PARAMETER(psConnection);
940         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
941         return PVRSRV_OK;
942 }
943
944 #ifdef INLINE_IS_PRAGMA
945 #pragma inline(PDumpImageDescriptor)
946 #endif
947 static INLINE PVRSRV_ERROR
948 PDumpImageDescriptor(PVRSRV_DEVICE_NODE *psDeviceNode,
949                      IMG_UINT32 ui32MMUContextID,
950                      IMG_CHAR *pszSABFileName,
951                      IMG_DEV_VIRTADDR sData,
952                      IMG_UINT32 ui32DataSize,
953                      IMG_UINT32 ui32LogicalWidth,
954                      IMG_UINT32 ui32LogicalHeight,
955                      IMG_UINT32 ui32PhysicalWidth,
956                      IMG_UINT32 ui32PhysicalHeight,
957                      PDUMP_PIXEL_FORMAT ePixFmt,
958                      IMG_MEMLAYOUT eMemLayout,
959                      IMG_FB_COMPRESSION eFBCompression,
960                      const IMG_UINT32 *paui32FBCClearColour,
961                      PDUMP_FBC_SWIZZLE eFBCSwizzle,
962                      IMG_DEV_VIRTADDR sHeader,
963                      IMG_UINT32 ui32HeaderSize,
964                      IMG_UINT32 ui32PDumpFlags)
965 {
966         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
967         PVR_UNREFERENCED_PARAMETER(ui32MMUContextID);
968         PVR_UNREFERENCED_PARAMETER(pszSABFileName);
969         PVR_UNREFERENCED_PARAMETER(sData);
970         PVR_UNREFERENCED_PARAMETER(ui32DataSize);
971         PVR_UNREFERENCED_PARAMETER(ui32LogicalWidth);
972         PVR_UNREFERENCED_PARAMETER(ui32LogicalHeight);
973         PVR_UNREFERENCED_PARAMETER(ui32PhysicalWidth);
974         PVR_UNREFERENCED_PARAMETER(ui32PhysicalHeight);
975         PVR_UNREFERENCED_PARAMETER(ePixFmt);
976         PVR_UNREFERENCED_PARAMETER(eMemLayout);
977         PVR_UNREFERENCED_PARAMETER(eFBCompression);
978         PVR_UNREFERENCED_PARAMETER(paui32FBCClearColour);
979         PVR_UNREFERENCED_PARAMETER(eFBCSwizzle);
980         PVR_UNREFERENCED_PARAMETER(sHeader);
981         PVR_UNREFERENCED_PARAMETER(ui32HeaderSize);
982         PVR_UNREFERENCED_PARAMETER(ui32PDumpFlags);
983         return PVRSRV_OK;
984 }
985
986 #ifdef INLINE_IS_PRAGMA
987 #pragma inline(PDumpDataDescriptor)
988 #endif
989 static INLINE PVRSRV_ERROR
990 PDumpDataDescriptor(PVRSRV_DEVICE_NODE *psDeviceNode,
991                     IMG_UINT32 ui32MMUContextID,
992                     IMG_CHAR *pszSABFileName,
993                     IMG_DEV_VIRTADDR sData,
994                     IMG_UINT32 ui32DataSize,
995                     IMG_UINT32 ui32ElementType,
996                     IMG_UINT32 ui32ElementCount,
997                     IMG_UINT32 ui32PDumpFlags)
998 {
999         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
1000         PVR_UNREFERENCED_PARAMETER(ui32MMUContextID);
1001         PVR_UNREFERENCED_PARAMETER(pszSABFileName);
1002         PVR_UNREFERENCED_PARAMETER(sData);
1003         PVR_UNREFERENCED_PARAMETER(ui32DataSize);
1004         PVR_UNREFERENCED_PARAMETER(ui32ElementType);
1005         PVR_UNREFERENCED_PARAMETER(ui32ElementCount);
1006         PVR_UNREFERENCED_PARAMETER(ui32PDumpFlags);
1007         return PVRSRV_OK;
1008 }
1009
1010 #ifdef INLINE_IS_PRAGMA
1011 #pragma inline(PDumpRegisterConnection)
1012 #endif
1013 static INLINE PVRSRV_ERROR
1014 PDumpRegisterConnection(void *hSyncPrivData,
1015                         PFN_PDUMP_SYNCBLOCKS pfnPDumpSyncBlocks,
1016                         PDUMP_CONNECTION_DATA **ppsPDumpConnectionData)
1017 {
1018         PVR_UNREFERENCED_PARAMETER(hSyncPrivData);
1019         PVR_UNREFERENCED_PARAMETER(pfnPDumpSyncBlocks);
1020         PVR_UNREFERENCED_PARAMETER(ppsPDumpConnectionData);
1021
1022         return PVRSRV_OK;
1023 }
1024
1025 #ifdef INLINE_IS_PRAGMA
1026 #pragma inline(PDumpUnregisterConnection)
1027 #endif
1028 static INLINE void
1029 PDumpUnregisterConnection(PDUMP_CONNECTION_DATA *psPDumpConnectionData)
1030 {
1031         PVR_UNREFERENCED_PARAMETER(psPDumpConnectionData);
1032 }
1033
1034 #ifdef INLINE_IS_PRAGMA
1035 #pragma inline(PDumpRegisterTransitionCallback)
1036 #endif
1037 static INLINE PVRSRV_ERROR
1038 PDumpRegisterTransitionCallback(PDUMP_CONNECTION_DATA *psPDumpConnectionData,
1039                                 PFN_PDUMP_TRANSITION pfnCallback,
1040                                 void *hPrivData,
1041                                 void *pvDevice,
1042                                 void **ppvHandle)
1043 {
1044         PVR_UNREFERENCED_PARAMETER(psPDumpConnectionData);
1045         PVR_UNREFERENCED_PARAMETER(pfnCallback);
1046         PVR_UNREFERENCED_PARAMETER(hPrivData);
1047         PVR_UNREFERENCED_PARAMETER(pvDevice);
1048         PVR_UNREFERENCED_PARAMETER(ppvHandle);
1049
1050         return PVRSRV_OK;
1051 }
1052
1053 #ifdef INLINE_IS_PRAGMA
1054 #pragma inline(PDumpUnregisterTransitionCallback)
1055 #endif
1056 static INLINE void
1057 PDumpUnregisterTransitionCallback(void *pvHandle)
1058 {
1059         PVR_UNREFERENCED_PARAMETER(pvHandle);
1060 }
1061
1062 #ifdef INLINE_IS_PRAGMA
1063 #pragma inline(PDumpRegisterTransitionCallback)
1064 #endif
1065 static INLINE PVRSRV_ERROR
1066 PDumpRegisterTransitionCallbackFenceSync(void *hPrivData,
1067                                          PFN_PDUMP_TRANSITION_FENCE_SYNC pfnCallback,
1068                                          void **ppvHandle)
1069 {
1070         PVR_UNREFERENCED_PARAMETER(pfnCallback);
1071         PVR_UNREFERENCED_PARAMETER(hPrivData);
1072         PVR_UNREFERENCED_PARAMETER(ppvHandle);
1073
1074         return PVRSRV_OK;
1075 }
1076
1077 #ifdef INLINE_IS_PRAGMA
1078 #pragma inline(PDumpUnregisterTransitionCallbackFenceSync)
1079 #endif
1080 static INLINE void
1081 PDumpUnregisterTransitionCallbackFenceSync(void *pvHandle)
1082 {
1083         PVR_UNREFERENCED_PARAMETER(pvHandle);
1084 }
1085
1086 #ifdef INLINE_IS_PRAGMA
1087 #pragma inline(PDumpTransition)
1088 #endif
1089 static INLINE PVRSRV_ERROR
1090 PDumpTransition(PVRSRV_DEVICE_NODE *psDeviceNode,
1091                 PDUMP_CONNECTION_DATA *psPDumpConnectionData,
1092                 PDUMP_TRANSITION_EVENT eEvent,
1093                 IMG_UINT32 ui32PDumpFlags)
1094 {
1095         PVR_UNREFERENCED_PARAMETER(psDeviceNode);
1096         PVR_UNREFERENCED_PARAMETER(psPDumpConnectionData);
1097         PVR_UNREFERENCED_PARAMETER(eEvent);
1098         PVR_UNREFERENCED_PARAMETER(ui32PDumpFlags);
1099         return PVRSRV_OK;
1100 }
1101
1102 #if defined(__linux__) || defined(GCC_IA32) || defined(GCC_ARM) || defined(__QNXNTO__) || defined(INTEGRITY_OS)
1103         #define PDUMPINIT       PDumpInitCommon
1104         #define PDUMPDEINIT(args...)
1105         #define PDUMPREG32(args...)
1106         #define PDUMPREG64(args...)
1107         #define PDUMPREGREAD32(args...)
1108         #define PDUMPREGREAD64(args...)
1109         #define PDUMPCOMMENT(args...)
1110         #define PDUMPREGPOL(args...)
1111         #define PDUMPSYNC(args...)
1112         #define PDUMPCOPYTOMEM(args...)
1113         #define PDUMPWRITE(args...)
1114         #define PDUMPREGBASEDCBP(args...)
1115         #define PDUMPCOMMENTWITHFLAGS(args...)
1116         #define PDUMPENDINITPHASE(args...)
1117         #define PDUMPIDLWITHFLAGS(args...)
1118         #define PDUMPIDL(args...)
1119         #define PDUMPPOWCMDSTART(args...)
1120         #define PDUMPPOWCMDEND(args...)
1121         #define PDUMP_LOCK(args...)
1122         #define PDUMP_UNLOCK(args...)
1123         #define PDUMPIF(args...)
1124         #define PDUMPFI(args...)
1125         #define PDUMPCOM(args...)
1126 #else
1127         #error Compiler not specified
1128 #endif
1129
1130 #endif /* PDUMP */
1131
1132 #endif /* PDUMP_KM_H */
1133
1134 /******************************************************************************
1135  End of file (pdump_km.h)
1136 ******************************************************************************/