Rev 6936 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5270 | serge | 1 | /* |
2 | * Internal Header for the Direct Rendering Manager |
||
1408 | serge | 3 | * |
4 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. |
||
5 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. |
||
1964 | serge | 6 | * Copyright (c) 2009-2010, Code Aurora Forum. |
1408 | serge | 7 | * All rights reserved. |
8 | * |
||
5270 | serge | 9 | * Author: Rickard E. (Rik) Faith |
10 | * Author: Gareth Hughes |
||
11 | * |
||
1408 | serge | 12 | * Permission is hereby granted, free of charge, to any person obtaining a |
13 | * copy of this software and associated documentation files (the "Software"), |
||
14 | * to deal in the Software without restriction, including without limitation |
||
15 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||
16 | * and/or sell copies of the Software, and to permit persons to whom the |
||
17 | * Software is furnished to do so, subject to the following conditions: |
||
18 | * |
||
19 | * The above copyright notice and this permission notice (including the next |
||
20 | * paragraph) shall be included in all copies or substantial portions of the |
||
21 | * Software. |
||
22 | * |
||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||
24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||
25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||
26 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
||
27 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
||
28 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
||
29 | * OTHER DEALINGS IN THE SOFTWARE. |
||
30 | */ |
||
31 | |||
32 | #ifndef _DRM_P_H_ |
||
33 | #define _DRM_P_H_ |
||
34 | |||
2967 | Serge | 35 | #include |
5270 | serge | 36 | #include |
2967 | Serge | 37 | |
5270 | serge | 38 | #include |
39 | #include |
||
40 | #include |
||
41 | #include |
||
6102 | serge | 42 | #include |
43 | #include |
||
5270 | serge | 44 | #include |
1408 | serge | 45 | #include |
46 | #include |
||
5270 | serge | 47 | #include |
48 | #include |
||
49 | #include |
||
3391 | Serge | 50 | #include |
6936 | serge | 51 | #include |
1408 | serge | 52 | |
3763 | Serge | 53 | #include |
54 | #include |
||
55 | |||
5056 | serge | 56 | |
3747 | Serge | 57 | #include |
5056 | serge | 58 | #include |
59 | #include |
||
5270 | serge | 60 | #include |
3482 | Serge | 61 | #include |
62 | |||
7143 | serge | 63 | #include |
64 | |||
5270 | serge | 65 | #include |
66 | #include |
||
3482 | Serge | 67 | |
5270 | serge | 68 | #include |
69 | #include |
||
70 | #include |
||
71 | #include |
||
72 | #include |
||
73 | #include |
||
74 | #include |
||
75 | #include |
||
4103 | Serge | 76 | #include |
1408 | serge | 77 | |
3031 | serge | 78 | struct module; |
1408 | serge | 79 | |
80 | struct drm_file; |
||
81 | struct drm_device; |
||
5270 | serge | 82 | struct drm_agp_head; |
83 | struct drm_local_map; |
||
84 | struct drm_device_dma; |
||
85 | struct drm_dma_handle; |
||
86 | struct drm_gem_object; |
||
1408 | serge | 87 | |
3391 | Serge | 88 | struct device_node; |
89 | struct videomode; |
||
5056 | serge | 90 | struct reservation_object; |
5270 | serge | 91 | struct dma_buf_attachment; |
4103 | Serge | 92 | |
93 | struct inode; |
||
94 | struct poll_table_struct; |
||
95 | struct sg_table; |
||
96 | |||
1408 | serge | 97 | #define KHZ2PICOS(a) (1000000000UL/(a)) |
98 | |||
3031 | serge | 99 | /* |
5056 | serge | 100 | * 4 debug categories are defined: |
3031 | serge | 101 | * |
5056 | serge | 102 | * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ... |
103 | * This is the category used by the DRM_DEBUG() macro. |
||
3031 | serge | 104 | * |
5056 | serge | 105 | * DRIVER: Used in the vendor specific part of the driver: i915, radeon, ... |
106 | * This is the category used by the DRM_DEBUG_DRIVER() macro. |
||
3031 | serge | 107 | * |
5056 | serge | 108 | * KMS: used in the modesetting code. |
109 | * This is the category used by the DRM_DEBUG_KMS() macro. |
||
110 | * |
||
111 | * PRIME: used in the prime code. |
||
112 | * This is the category used by the DRM_DEBUG_PRIME() macro. |
||
113 | * |
||
6082 | serge | 114 | * ATOMIC: used in the atomic code. |
115 | * This is the category used by the DRM_DEBUG_ATOMIC() macro. |
||
116 | * |
||
117 | * VBL: used for verbose debug message in the vblank code |
||
118 | * This is the category used by the DRM_DEBUG_VBL() macro. |
||
119 | * |
||
5056 | serge | 120 | * Enabling verbose debug messages is done through the drm.debug parameter, |
121 | * each category being enabled by a bit. |
||
122 | * |
||
123 | * drm.debug=0x1 will enable CORE messages |
||
124 | * drm.debug=0x2 will enable DRIVER messages |
||
125 | * drm.debug=0x3 will enable CORE and DRIVER messages |
||
126 | * ... |
||
6082 | serge | 127 | * drm.debug=0x3f will enable all messages |
5056 | serge | 128 | * |
129 | * An interesting feature is that it's possible to enable verbose logging at |
||
130 | * run-time by echoing the debug value in its sysfs node: |
||
131 | * # echo 0xf > /sys/module/drm/parameters/debug |
||
3031 | serge | 132 | */ |
5056 | serge | 133 | #define DRM_UT_CORE 0x01 |
134 | #define DRM_UT_DRIVER 0x02 |
||
6082 | serge | 135 | #define DRM_UT_KMS 0x04 |
5056 | serge | 136 | #define DRM_UT_PRIME 0x08 |
6082 | serge | 137 | #define DRM_UT_ATOMIC 0x10 |
138 | #define DRM_UT_VBL 0x20 |
||
3031 | serge | 139 | |
5056 | serge | 140 | extern __printf(2, 3) |
141 | void drm_ut_debug_printk(const char *function_name, |
||
6082 | serge | 142 | const char *format, ...); |
5270 | serge | 143 | extern __printf(1, 2) |
144 | void drm_err(const char *format, ...); |
||
1408 | serge | 145 | |
146 | /***********************************************************************/ |
||
147 | /** \name DRM template customization defaults */ |
||
148 | /*@{*/ |
||
149 | |||
150 | /* driver capabilities and requirements mask */ |
||
6082 | serge | 151 | #define DRIVER_USE_AGP 0x1 |
152 | #define DRIVER_PCI_DMA 0x8 |
||
153 | #define DRIVER_SG 0x10 |
||
154 | #define DRIVER_HAVE_DMA 0x20 |
||
155 | #define DRIVER_HAVE_IRQ 0x40 |
||
156 | #define DRIVER_IRQ_SHARED 0x80 |
||
157 | #define DRIVER_GEM 0x1000 |
||
158 | #define DRIVER_MODESET 0x2000 |
||
159 | #define DRIVER_PRIME 0x4000 |
||
160 | #define DRIVER_RENDER 0x8000 |
||
161 | #define DRIVER_ATOMIC 0x10000 |
||
162 | #define DRIVER_KMS_LEGACY_CONTEXT 0x20000 |
||
1408 | serge | 163 | |
164 | /***********************************************************************/ |
||
165 | /** \name Macros to make printk easier */ |
||
166 | /*@{*/ |
||
167 | |||
168 | /** |
||
169 | * Error output. |
||
170 | * |
||
171 | * \param fmt printf() like format string. |
||
172 | * \param arg arguments |
||
173 | */ |
||
3031 | serge | 174 | #define DRM_ERROR(fmt, ...) \ |
7143 | serge | 175 | printk("DRM Error " fmt, ##__VA_ARGS__) |
1408 | serge | 176 | |
4559 | Serge | 177 | /** |
178 | * Rate limited error output. Like DRM_ERROR() but won't flood the log. |
||
179 | * |
||
180 | * \param fmt printf() like format string. |
||
181 | * \param arg arguments |
||
182 | */ |
||
183 | #define DRM_ERROR_RATELIMITED(fmt, ...) \ |
||
184 | ({ \ |
||
185 | static DEFINE_RATELIMIT_STATE(_rs, \ |
||
186 | DEFAULT_RATELIMIT_INTERVAL, \ |
||
187 | DEFAULT_RATELIMIT_BURST); \ |
||
188 | \ |
||
189 | if (__ratelimit(&_rs)) \ |
||
5270 | serge | 190 | drm_err(fmt, ##__VA_ARGS__); \ |
4559 | Serge | 191 | }) |
192 | |||
7143 | serge | 193 | #if DRM_DEBUG_CODE |
194 | |||
3031 | serge | 195 | #define DRM_INFO(fmt, ...) \ |
196 | printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) |
||
1408 | serge | 197 | |
5056 | serge | 198 | #define DRM_INFO_ONCE(fmt, ...) \ |
199 | printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) |
||
200 | |||
1408 | serge | 201 | /** |
202 | * Debug output. |
||
203 | * |
||
204 | * \param fmt printf() like format string. |
||
205 | * \param arg arguments |
||
206 | */ |
||
5056 | serge | 207 | #define DRM_DEBUG(fmt, args...) \ |
3031 | serge | 208 | do { \ |
5056 | serge | 209 | printk(KERN_INFO "[" DRM_NAME "] " fmt, ##args); \ |
1408 | serge | 210 | } while (0) |
211 | |||
5056 | serge |