diff options
Diffstat (limited to 'drivers/gpu/pvr/pvr_debug.h')
-rw-r--r-- | drivers/gpu/pvr/pvr_debug.h | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/pvr_debug.h b/drivers/gpu/pvr/pvr_debug.h new file mode 100644 index 00000000000..21fa2cdfbe3 --- /dev/null +++ b/drivers/gpu/pvr/pvr_debug.h | |||
@@ -0,0 +1,133 @@ | |||
1 | /********************************************************************** | ||
2 | * | ||
3 | * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. | ||
4 | * | ||
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. | ||
8 | * | ||
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. | ||
13 | * | ||
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. | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in | ||
19 | * the file called "COPYING". | ||
20 | * | ||
21 | * Contact Information: | ||
22 | * Imagination Technologies Ltd. <gpl-support@imgtec.com> | ||
23 | * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK | ||
24 | * | ||
25 | ******************************************************************************/ | ||
26 | |||
27 | #ifndef __PVR_DEBUG_H__ | ||
28 | #define __PVR_DEBUG_H__ | ||
29 | |||
30 | |||
31 | #include "img_types.h" | ||
32 | |||
33 | #if defined (__cplusplus) | ||
34 | extern "C" { | ||
35 | #endif | ||
36 | |||
37 | #define PVR_MAX_DEBUG_MESSAGE_LEN (512) | ||
38 | |||
39 | #define DBGPRIV_FATAL 0x01UL | ||
40 | #define DBGPRIV_ERROR 0x02UL | ||
41 | #define DBGPRIV_WARNING 0x04UL | ||
42 | #define DBGPRIV_MESSAGE 0x08UL | ||
43 | #define DBGPRIV_VERBOSE 0x10UL | ||
44 | #define DBGPRIV_CALLTRACE 0x20UL | ||
45 | #define DBGPRIV_ALLOC 0x40UL | ||
46 | |||
47 | #define DBGPRIV_DBGDRV_MESSAGE 0x1000UL | ||
48 | |||
49 | #define DBGPRIV_ALLLEVELS (DBGPRIV_FATAL | DBGPRIV_ERROR | DBGPRIV_WARNING | DBGPRIV_MESSAGE | DBGPRIV_VERBOSE) | ||
50 | |||
51 | |||
52 | |||
53 | #define PVR_DBG_FATAL DBGPRIV_FATAL,__FILE__, __LINE__ | ||
54 | #define PVR_DBG_ERROR DBGPRIV_ERROR,__FILE__, __LINE__ | ||
55 | #define PVR_DBG_WARNING DBGPRIV_WARNING,__FILE__, __LINE__ | ||
56 | #define PVR_DBG_MESSAGE DBGPRIV_MESSAGE,__FILE__, __LINE__ | ||
57 | #define PVR_DBG_VERBOSE DBGPRIV_VERBOSE,__FILE__, __LINE__ | ||
58 | #define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE,__FILE__, __LINE__ | ||
59 | #define PVR_DBG_ALLOC DBGPRIV_ALLOC,__FILE__, __LINE__ | ||
60 | |||
61 | #define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE, "", 0 | ||
62 | |||
63 | #if !defined(PVRSRV_NEED_PVR_ASSERT) && defined(DEBUG) | ||
64 | #define PVRSRV_NEED_PVR_ASSERT | ||
65 | #endif | ||
66 | |||
67 | #if defined(PVRSRV_NEED_PVR_ASSERT) && !defined(PVRSRV_NEED_PVR_DPF) | ||
68 | #define PVRSRV_NEED_PVR_DPF | ||
69 | #endif | ||
70 | |||
71 | #if !defined(PVRSRV_NEED_PVR_TRACE) && (defined(DEBUG) || defined(TIMING)) | ||
72 | #define PVRSRV_NEED_PVR_TRACE | ||
73 | #endif | ||
74 | |||
75 | |||
76 | #if defined(PVRSRV_NEED_PVR_ASSERT) | ||
77 | |||
78 | #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__); | ||
79 | |||
80 | IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile, | ||
81 | IMG_UINT32 ui32Line); | ||
82 | |||
83 | #if defined(PVR_DBG_BREAK_ASSERT_FAIL) | ||
84 | #define PVR_DBG_BREAK PVRSRVDebugAssertFail("PVR_DBG_BREAK", 0) | ||
85 | #else | ||
86 | #define PVR_DBG_BREAK | ||
87 | #endif | ||
88 | |||
89 | #else | ||
90 | |||
91 | #define PVR_ASSERT(EXPR) | ||
92 | #define PVR_DBG_BREAK | ||
93 | |||
94 | #endif | ||
95 | |||
96 | |||
97 | #if defined(PVRSRV_NEED_PVR_DPF) | ||
98 | |||
99 | #define PVR_DPF(X) PVRSRVDebugPrintf X | ||
100 | |||
101 | IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel, | ||
102 | const IMG_CHAR *pszFileName, | ||
103 | IMG_UINT32 ui32Line, | ||
104 | const IMG_CHAR *pszFormat, | ||
105 | ...) IMG_FORMAT_PRINTF(4, 5); | ||
106 | |||
107 | #else | ||
108 | |||
109 | #define PVR_DPF(X) | ||
110 | |||
111 | #endif | ||
112 | |||
113 | |||
114 | #if defined(PVRSRV_NEED_PVR_TRACE) | ||
115 | |||
116 | #define PVR_TRACE(X) PVRSRVTrace X | ||
117 | |||
118 | IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVTrace(const IMG_CHAR* pszFormat, ... ) | ||
119 | IMG_FORMAT_PRINTF(1, 2); | ||
120 | |||
121 | #else | ||
122 | |||
123 | #define PVR_TRACE(X) | ||
124 | |||
125 | #endif | ||
126 | |||
127 | |||
128 | #if defined (__cplusplus) | ||
129 | } | ||
130 | #endif | ||
131 | |||
132 | #endif | ||
133 | |||