Subversion Repositories Kolibri OS

Rev

Rev 2967 | Rev 3120 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2967 Rev 3031
Line 34... Line 34...
34
 
34
 
35
#ifndef _DRM_P_H_
35
#ifndef _DRM_P_H_
Line 36... Line 36...
36
#define _DRM_P_H_
36
#define _DRM_P_H_
-
 
37
 
-
 
38
#ifdef __KERNEL__
-
 
39
#ifdef __alpha__
-
 
40
/* add include of current.h so that "current" is defined
-
 
41
 * before static inline funcs in wait.h. Doing this so we
-
 
42
 * can build the DRM (part of PI DRI). 4/21/2000 S + B */
Line 37... Line 43...
37
 
43
#include 
Line 38... Line -...
38
#ifdef __KERNEL__
-
 
39
 
44
#endif				/* __alpha__ */
-
 
45
 
40
#include 
46
#include 
41
 
47
 
42
#include 
48
#include 
43
#include 
49
#include 
-
 
50
#include 
Line 44... Line 51...
44
#include 
51
#include 
45
#include 
52
#include 
46
#include 
53
#include 
47
#include 
54
#include 
Line 70... Line 77...
70
#include 
77
#include 
Line 71... Line 78...
71
 
78
 
72
#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
79
#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
Line 73... Line -...
73
#define __OS_HAS_MTRR (defined(CONFIG_MTRR))
-
 
74
 
-
 
75
 
-
 
76
 
80
#define __OS_HAS_MTRR (defined(CONFIG_MTRR))
77
 
-
 
78
#include 
-
 
Line 79... Line 81...
79
#include 
81
 
80
 
82
struct module;
Line 81... Line 83...
81
 
83
 
82
struct drm_file;
84
struct drm_file;
83
struct drm_device;
85
struct drm_device;
84
 
-
 
85
//#include "drm_os_linux.h"
-
 
86
#include "drm_hashtab.h"
-
 
87
#include "drm_mm.h"
-
 
88
 
-
 
Line 89... Line 86...
89
#define DRM_UT_CORE 		0x01
86
 
Line 90... Line 87...
90
#define DRM_UT_DRIVER		0x02
87
//#include 
91
#define DRM_UT_KMS          0x04
88
#include 
92
#define DRM_UT_MODE         0x08
89
#include 
93
 
90
 
Line -... Line 91...
-
 
91
#define KHZ2PICOS(a) (1000000000UL/(a))
-
 
92
 
-
 
93
/* get_scanout_position() return flags */
-
 
94
#define DRM_SCANOUTPOS_VALID        (1 << 0)
-
 
95
#define DRM_SCANOUTPOS_INVBL        (1 << 1)
-
 
96
#define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
-
 
97
 
-
 
98
 
-
 
99
 
-
 
100
#define DRM_UT_CORE 		0x01
-
 
101
#define DRM_UT_DRIVER		0x02
-
 
102
#define DRM_UT_KMS          0x04
-
 
103
#define DRM_UT_PRIME		0x08
-
 
104
/*
-
 
105
 * Three debug levels are defined.
-
 
106
 * drm_core, drm_driver, drm_kms
-
 
107
 * drm_core level can be used in the generic drm code. For example:
-
 
108
 * 	drm_ioctl, drm_mm, drm_memory
-
 
109
 * The macro definition of DRM_DEBUG is used.
-
 
110
 * 	DRM_DEBUG(fmt, args...)
-
 
111
 * 	The debug info by using the DRM_DEBUG can be obtained by adding
-
 
112
 * 	the boot option of "drm.debug=1".
-
 
113
 *
-
 
114
 * drm_driver level can be used in the specific drm driver. It is used
-
 
115
 * to add the debug info related with the drm driver. For example:
-
 
116
 * i915_drv, i915_dma, i915_gem, radeon_drv,
-
 
117
 * 	The macro definition of DRM_DEBUG_DRIVER can be used.
-
 
118
 * 	DRM_DEBUG_DRIVER(fmt, args...)
-
 
119
 * 	The debug info by using the DRM_DEBUG_DRIVER can be obtained by
-
 
120
 * 	adding the boot option of "drm.debug=0x02"
-
 
121
 *
-
 
122
 * drm_kms level can be used in the KMS code related with specific drm driver.
-
 
123
 * It is used to add the debug info related with KMS mode. For example:
-
 
124
 * the connector/crtc ,
-
 
125
 * 	The macro definition of DRM_DEBUG_KMS can be used.
-
 
126
 * 	DRM_DEBUG_KMS(fmt, args...)
-
 
127
 * 	The debug info by using the DRM_DEBUG_KMS can be obtained by
-
 
128
 * 	adding the boot option of "drm.debug=0x04"
94
#define KHZ2PICOS(a) (1000000000UL/(a))
129
 *
95
 
130
 * If we add the boot option of "drm.debug=0x06", we can get the debug info by
96
/* get_scanout_position() return flags */
131
 * using the DRM_DEBUG_KMS and DRM_DEBUG_DRIVER.
97
#define DRM_SCANOUTPOS_VALID        (1 << 0)
132
 * If we add the boot option of "drm.debug=0x05", we can get the debug info by
98
#define DRM_SCANOUTPOS_INVBL        (1 << 1)
-
 
99
#define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
-
 
100
 
-
 
101
 
-
 
102
extern void drm_ut_debug_printk(unsigned int request_level,
-
 
103
				const char *prefix,
133
 * using the DRM_DEBUG_KMS and DRM_DEBUG.
104
				const char *function_name,
-
 
105
				const char *format, ...);
-
 
106
 
-
 
107
#define DRM_DEBUG_MODE(prefix, fmt, args...)    \
-
 
108
    do {                                        \
-
 
109
        dbgprintf("drm debug: %s" fmt,          \
-
 
110
                     __func__, ##args);         \
-
 
111
    } while (0)
-
 
112
 
-
 
113
#define DRM_DEBUG(fmt, args...)                                 \
-
 
114
    do {                                                        \
-
 
115
        printk("[" DRM_NAME ":%s] " fmt , __func__ , ##args);   \
-
 
116
    } while(0)
-
 
117
 
-
 
118
#define DRM_DEBUG_KMS(fmt, args...)                             \
-
 
119
    do {                                                        \
-
 
120
        printk("[" DRM_NAME ":%s] " fmt , __func__ , ##args);   \
-
 
121
    } while(0)
-
 
122
 
-
 
123
#define DRM_DEBUG_DRIVER(fmt, args...)                          \
-
 
124
    do {                                                        \
-
 
125
        printk("[" DRM_NAME ":%s] " fmt , __func__ , ##args);   \
134
 */
126
    } while (0)
-
 
127
 
-
 
128
#define DRM_LOG_KMS(fmt, args...)      \
-
 
129
    do {                               \
-
 
130
        printk("[" DRM_NAME "]" fmt, ##args);     \
-
 
131
    } while (0)
-
 
Line 132... Line 135...
132
 
135
 
133
static inline int drm_sysfs_connector_add(struct drm_connector *connector)
136
extern __printf(4, 5)
134
{ return 0; };
137
void drm_ut_debug_printk(unsigned int request_level,
Line 155... Line 158...
155
#define DRIVER_DMA_QUEUE   0x200
158
#define DRIVER_DMA_QUEUE   0x200
156
#define DRIVER_FB_DMA      0x400
159
#define DRIVER_FB_DMA      0x400
157
#define DRIVER_IRQ_VBL2    0x800
160
#define DRIVER_IRQ_VBL2    0x800
158
#define DRIVER_GEM         0x1000
161
#define DRIVER_GEM         0x1000
159
#define DRIVER_MODESET     0x2000
162
#define DRIVER_MODESET     0x2000
-
 
163
#define DRIVER_PRIME       0x4000
Line 160... Line 164...
160
 
164
 
161
#define DRIVER_BUS_PCI 0x1
165
#define DRIVER_BUS_PCI 0x1
162
#define DRIVER_BUS_PLATFORM 0x2
166
#define DRIVER_BUS_PLATFORM 0x2
Line 191... Line 195...
191
 * Error output.
195
 * Error output.
192
 *
196
 *
193
 * \param fmt printf() like format string.
197
 * \param fmt printf() like format string.
194
 * \param arg arguments
198
 * \param arg arguments
195
 */
199
 */
196
#define DRM_ERROR(fmt, arg...) \
200
#define DRM_ERROR(fmt, ...)				\
197
	printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* " fmt , __func__ , ##arg)
201
	drm_err(__func__, fmt, ##__VA_ARGS__)
Line 198... Line -...
198
 
-
 
199
/**
-
 
200
 * Memory error output.
-
 
201
 *
-
 
202
 * \param area memory area where the error occurred.
-
 
203
 * \param fmt printf() like format string.
-
 
204
 * \param arg arguments
-
 
205
 */
202
 
206
#define DRM_MEM_ERROR(area, fmt, arg...) \
203
#define DRM_INFO(fmt, ...)				\
207
	printk(KERN_ERR "[" DRM_NAME ":%s:%s] *ERROR* " fmt , __func__, \
-
 
208
	       drm_mem_stats[area].name , ##arg)
-
 
209
 
-
 
Line 210... Line 204...
210
#define DRM_INFO(fmt, arg...)  printk(KERN_INFO "[" DRM_NAME "] " fmt , ##arg)
204
	printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
211
 
205
 
212
/**
206
/**
213
 * Debug output.
207
 * Debug output.
214
 *
208
 *
215
 * \param fmt printf() like format string.
209
 * \param fmt printf() like format string.
216
 * \param arg arguments
210
 * \param arg arguments
217
 */
211
 */
218
#if DRM_DEBUG_CODE
212
#if DRM_DEBUG_CODE
219
#define DRM_DEBUG(fmt, args...)						\
213
#define DRM_DEBUG(fmt, ...)                                 \
220
	do {								\
-
 
221
		drm_ut_debug_printk(DRM_UT_CORE, DRM_NAME, 		\
214
    do {                                                    \
Line -... Line 215...
-
 
215
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
-
 
216
	} while (0)
-
 
217
 
-
 
218
#define DRM_DEBUG_DRIVER(fmt, ...)                          \
222
					__func__, fmt, ##args);		\
219
    do {                                                    \
223
	} while (0)
220
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
224
 
221
	} while (0)
225
#define DRM_DEBUG_DRIVER(fmt, args...)					\
-
 
226
	do {								\
222
#define DRM_DEBUG_KMS(fmt, ...)              \
227
		drm_ut_debug_printk(DRM_UT_DRIVER, DRM_NAME,		\
223
	do {								\
228
					__func__, fmt, ##args);		\
224
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
229
	} while (0)
225
	} while (0)
230
#define DRM_DEBUG_KMS(fmt, args...)				\
-
 
231
	do {								\
226
#define DRM_DEBUG_PRIME(fmt, ...)                    \
232
		drm_ut_debug_printk(DRM_UT_KMS, DRM_NAME, 		\
227
	do {								\
233
					 __func__, fmt, ##args);	\
228
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
234
	} while (0)
229
	} while (0)
235
#define DRM_LOG(fmt, args...)						\
-
 
236
	do {								\
230
#define DRM_LOG(fmt, ...)                        \
237
		drm_ut_debug_printk(DRM_UT_CORE, NULL,			\
231
	do {								\
238
					NULL, fmt, ##args);		\
232
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
239
	} while (0)
233
	} while (0)
240
#define DRM_LOG_KMS(fmt, args...)					\
-
 
241
	do {								\
234
#define DRM_LOG_KMS(fmt, ...)                    \
242
		drm_ut_debug_printk(DRM_UT_KMS, NULL,			\
235
	do {								\
243
					NULL, fmt, ##args);		\
236
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
244
	} while (0)
237
	} while (0)
245
#define DRM_LOG_MODE(fmt, args...)					\
-
 
246
	do {								\
238
#define DRM_LOG_MODE(fmt, ...)                   \
247
		drm_ut_debug_printk(DRM_UT_MODE, NULL,			\
239
	do {								\
248
					NULL, fmt, ##args);		\
240
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
249
	} while (0)
241
	} while (0)
250
#define DRM_LOG_DRIVER(fmt, args...)					\
-
 
251
	do {								\
242
#define DRM_LOG_DRIVER(fmt, ...)                 \
252
		drm_ut_debug_printk(DRM_UT_DRIVER, NULL,		\
243
	do {								\
253
					NULL, fmt, ##args);		\
244
    printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__);  \
254
	} while (0)
245
	} while (0)
-
 
246
#else
255