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 | #else |
247 | #define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0) |
256 | #define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0) |
248 | #define DRM_DEBUG_KMS(fmt, args...) do { } while (0) |
257 | #define DRM_DEBUG_KMS(fmt, args...) do { } while (0) |
249 | #define DRM_DEBUG_PRIME(fmt, args...) do { } while (0) |
258 | #define DRM_DEBUG(fmt, arg...) do { } while (0) |
250 | #define DRM_DEBUG(fmt, arg...) do { } while (0) |
259 | #define DRM_LOG(fmt, arg...) do { } while (0) |
251 | #define DRM_LOG(fmt, arg...) do { } while (0) |
Line 291... | Line 283... | ||
291 | _file_priv->master->lock.file_priv, _file_priv); \ |
283 | _file_priv->master->lock.file_priv, _file_priv); \ |
292 | return -EINVAL; \ |
284 | return -EINVAL; \ |
293 | } \ |
285 | } \ |
294 | } while (0) |
286 | } while (0) |
Line -... | Line 287... | ||
- | 287 | ||
295 | 288 | #if 0 |
|
296 | /** |
289 | /** |
297 | * Ioctl function type. |
290 | * Ioctl function type. |
298 | * |
291 | * |
299 | * \param inode device inode. |
292 | * \param inode device inode. |
Line 355... | Line 348... | ||
355 | void *address; /**< Address of buffer */ |
348 | void *address; /**< Address of buffer */ |
356 | unsigned long bus_address; /**< Bus address of buffer */ |
349 | unsigned long bus_address; /**< Bus address of buffer */ |
357 | struct drm_buf *next; /**< Kernel-only: used for free list */ |
350 | struct drm_buf *next; /**< Kernel-only: used for free list */ |
358 | __volatile__ int waiting; /**< On kernel DMA queue */ |
351 | __volatile__ int waiting; /**< On kernel DMA queue */ |
359 | __volatile__ int pending; /**< On hardware DMA queue */ |
352 | __volatile__ int pending; /**< On hardware DMA queue */ |
360 | wait_queue_head_t dma_wait; /**< Processes waiting */ |
- | |
361 | struct drm_file *file_priv; /**< Private of holding file descr */ |
353 | struct drm_file *file_priv; /**< Private of holding file descr */ |
362 | int context; /**< Kernel queue for this buffer */ |
354 | int context; /**< Kernel queue for this buffer */ |
363 | int while_locked; /**< Dispatch this buffer while locked */ |
355 | int while_locked; /**< Dispatch this buffer while locked */ |
364 | enum { |
356 | enum { |
365 | DRM_LIST_NONE = 0, |
357 | DRM_LIST_NONE = 0, |
Line 427... | Line 419... | ||
427 | pid_t pid; /* pid of requester, no guarantee it's valid by the time |
419 | pid_t pid; /* pid of requester, no guarantee it's valid by the time |
428 | we deliver the event, for tracing only */ |
420 | we deliver the event, for tracing only */ |
429 | void (*destroy)(struct drm_pending_event *event); |
421 | void (*destroy)(struct drm_pending_event *event); |
430 | }; |
422 | }; |
Line -... | Line 423... | ||
- | 423 | ||
- | 424 | /* initial implementaton using a linked list - todo hashtab */ |
|
- | 425 | struct drm_prime_file_private { |
|
- | 426 | struct list_head head; |
|
- | 427 | struct mutex lock; |
|
- | 428 | }; |
|
431 | 429 | ||
432 | /** File private data */ |
430 | /** File private data */ |
433 | struct drm_file { |
431 | struct drm_file { |
434 | int authenticated; |
432 | int authenticated; |
435 | pid_t pid; |
433 | struct pid *pid; |
436 | uid_t uid; |
434 | kuid_t uid; |
437 | drm_magic_t magic; |
435 | drm_magic_t magic; |
438 | unsigned long ioctl_count; |
436 | unsigned long ioctl_count; |
439 | struct list_head lhead; |
437 | struct list_head lhead; |
440 | struct drm_minor *minor; |
438 | struct drm_minor *minor; |
Line 454... | Line 452... | ||
454 | struct list_head fbs; |
452 | struct list_head fbs; |
Line 455... | Line 453... | ||
455 | 453 | ||
456 | wait_queue_head_t event_wait; |
454 | wait_queue_head_t event_wait; |
457 | struct list_head event_list; |
455 | struct list_head event_list; |
- | 456 | int event_space; |
|
- | 457 | ||
458 | int event_space; |
458 | struct drm_prime_file_private prime; |
Line 459... | Line 459... | ||
459 | }; |
459 | }; |
460 | 460 | ||
461 | /** Wait queue */ |
461 | /** Wait queue */ |
Line 675... | Line 675... | ||
675 | uint32_t pending_write_domain; |
675 | uint32_t pending_write_domain; |
Line 676... | Line 676... | ||
676 | 676 | ||
677 | void *driver_private; |
677 | void *driver_private; |
Line 678... | Line 678... | ||
678 | }; |
678 | }; |
Line 679... | Line 679... | ||
679 | 679 | ||
680 | #include "drm_crtc.h" |
680 | #include |
Line 681... | Line 681... | ||
681 | 681 | ||
Line 756... | Line 756... | ||
756 | /** |
756 | /** |
757 | * get_vblank_counter - get raw hardware vblank counter |
757 | * get_vblank_counter - get raw hardware vblank counter |
758 | * @dev: DRM device |
758 | * @dev: DRM device |
759 | * @crtc: counter to fetch |
759 | * @crtc: counter to fetch |
760 | * |
760 | * |
761 | * Driver callback for fetching a raw hardware vblank counter |
761 | * Driver callback for fetching a raw hardware vblank counter for @crtc. |
762 | * for @crtc. If a device doesn't have a hardware counter, the |
762 | * If a device doesn't have a hardware counter, the driver can simply |
763 | * driver can simply return the value of drm_vblank_count and |
763 | * return the value of drm_vblank_count. The DRM core will account for |
764 | * make the enable_vblank() and disable_vblank() hooks into no-ops, |
764 | * missed vblank events while interrupts where disabled based on system |
765 | * leaving interrupts enabled at all times. |
765 | * timestamps. |
766 | * |
766 | * |
767 | * Wraparound handling and loss of events due to modesetting is dealt |
767 | * Wraparound handling and loss of events due to modesetting is dealt |
768 | * with in the DRM core code. |
768 | * with in the DRM core code. |
769 | * |
769 | * |
770 | * RETURNS |
770 | * RETURNS |
Line 877... | Line 877... | ||
877 | 877 | ||
878 | irqreturn_t(*irq_handler) (DRM_IRQ_ARGS); |
878 | irqreturn_t(*irq_handler) (DRM_IRQ_ARGS); |
879 | void (*irq_preinstall) (struct drm_device *dev); |
879 | void (*irq_preinstall) (struct drm_device *dev); |
880 | int (*irq_postinstall) (struct drm_device *dev); |
880 | int (*irq_postinstall) (struct drm_device *dev); |
881 | void (*irq_uninstall) (struct drm_device *dev); |
- | |
882 | void (*reclaim_buffers) (struct drm_device *dev, |
- | |
883 | struct drm_file * file_priv); |
- | |
884 | void (*reclaim_buffers_locked) (struct drm_device *dev, |
- | |
885 | struct drm_file *file_priv); |
- | |
886 | void (*reclaim_buffers_idlelocked) (struct drm_device *dev, |
- | |
887 | struct drm_file *file_priv); |
881 | void (*irq_uninstall) (struct drm_device *dev); |
888 | void (*set_version) (struct drm_device *dev, |
882 | void (*set_version) (struct drm_device *dev, |
Line 889... | Line 883... | ||
889 | struct drm_set_version *sv); |
883 | struct drm_set_version *sv); |
890 | 884 | ||
Line 913... | Line 907... | ||
913 | int (*gem_init_object) (struct drm_gem_object *obj); |
907 | int (*gem_init_object) (struct drm_gem_object *obj); |
914 | void (*gem_free_object) (struct drm_gem_object *obj); |
908 | void (*gem_free_object) (struct drm_gem_object *obj); |
915 | int (*gem_open_object) (struct drm_gem_object *, struct drm_file *); |
909 | int (*gem_open_object) (struct drm_gem_object *, struct drm_file *); |
916 | void (*gem_close_object) (struct drm_gem_object *, struct drm_file *); |
910 | void (*gem_close_object) (struct drm_gem_object *, struct drm_file *); |
Line -... | Line 911... | ||
- | 911 | ||
- | 912 | /* prime: */ |
|
- | 913 | /* export handle -> fd (see drm_gem_prime_handle_to_fd() helper) */ |
|
- | 914 | int (*prime_handle_to_fd)(struct drm_device *dev, struct drm_file *file_priv, |
|
- | 915 | uint32_t handle, uint32_t flags, int *prime_fd); |
|
- | 916 | /* import fd -> handle (see drm_gem_prime_fd_to_handle() helper) */ |
|
- | 917 | int (*prime_fd_to_handle)(struct drm_device *dev, struct drm_file *file_priv, |
|
- | 918 | int prime_fd, uint32_t *handle); |
|
- | 919 | /* export GEM -> dmabuf */ |
|
- | 920 | struct dma_buf * (*gem_prime_export)(struct drm_device *dev, |
|
- | 921 | struct drm_gem_object *obj, int flags); |
|
- | 922 | /* import dmabuf -> GEM */ |
|
- | 923 | struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev, |
|
- | 924 | struct dma_buf *dma_buf); |
|
917 | 925 | ||
918 | /* vga arb irq handler */ |
926 | /* vga arb irq handler */ |
Line 919... | Line 927... | ||
919 | void (*vgaarb_irq)(struct drm_device *dev, bool state); |
927 | void (*vgaarb_irq)(struct drm_device *dev, bool state); |
920 | 928 | ||
Line 928... | Line 936... | ||
928 | int (*dumb_destroy)(struct drm_file *file_priv, |
936 | int (*dumb_destroy)(struct drm_file *file_priv, |
929 | struct drm_device *dev, |
937 | struct drm_device *dev, |
930 | uint32_t handle); |
938 | uint32_t handle); |
Line 931... | Line 939... | ||
931 | 939 | ||
932 | /* Driver private ops for this object */ |
940 | /* Driver private ops for this object */ |
Line 933... | Line 941... | ||
933 | struct vm_operations_struct *gem_vm_ops; |
941 | const struct vm_operations_struct *gem_vm_ops; |
934 | 942 | ||
935 | int major; |
943 | int major; |
936 | int minor; |
944 | int minor; |
Line 1090... | Line 1098... | ||
1090 | 1098 | ||
Line 1091... | Line 1099... | ||
1091 | struct list_head vmalist; /**< List of vmas (for debugging) */ |
1099 | struct list_head vmalist; /**< List of vmas (for debugging) */ |
Line 1092... | Line 1100... | ||
1092 | 1100 | ||
1093 | /*@} */ |
1101 | /*@} */ |
1094 | - | ||
1095 | /** \name DMA queues (contexts) */ |
- | |
1096 | /*@{ */ |
- | |
1097 | int queue_count; /**< Number of active DMA queues */ |
- | |
1098 | int queue_reserved; /**< Number of reserved DMA queues */ |
1102 | |
1099 | int queue_slots; /**< Actual length of queuelist */ |
1103 | /** \name DMA support */ |
Line 1100... | Line 1104... | ||
1100 | // struct drm_queue **queuelist; /**< Vector of pointers to DMA queues */ |
1104 | /*@{ */ |
1101 | // struct drm_device_dma *dma; /**< Optional pointer for DMA support */ |
1105 | // struct drm_device_dma *dma; /**< Optional pointer for DMA support */ |
Line 1180... | Line 1184... | ||
1180 | /*@{ */ |
1184 | /*@{ */ |
1181 | spinlock_t object_name_lock; |
1185 | spinlock_t object_name_lock; |
1182 | struct idr object_name_idr; |
1186 | struct idr object_name_idr; |
1183 | /*@} */ |
1187 | /*@} */ |
1184 | int switch_power_state; |
1188 | int switch_power_state; |
- | 1189 | ||
- | 1190 | atomic_t unplugged; /* device has been unplugged or gone away */ |
|
1185 | }; |
1191 | }; |
Line 1186... | Line 1192... | ||
1186 | 1192 | ||
1187 | #define DRM_SWITCH_POWER_ON 0 |
1193 | #define DRM_SWITCH_POWER_ON 0 |
1188 | #define DRM_SWITCH_POWER_OFF 1 |
1194 | #define DRM_SWITCH_POWER_OFF 1 |
Line 1270... | Line 1276... | ||
1270 | extern int drm_release(struct inode *inode, struct file *filp); |
1276 | extern int drm_release(struct inode *inode, struct file *filp); |
Line 1271... | Line 1277... | ||
1271 | 1277 | ||
1272 | /* Mapping support (drm_vm.h) */ |
1278 | /* Mapping support (drm_vm.h) */ |
1273 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); |
1279 | extern int drm_mmap(struct file *filp, struct vm_area_struct *vma); |
1274 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); |
1280 | extern int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma); |
1275 | extern void drm_vm_open_locked(struct vm_area_struct *vma); |
1281 | extern void drm_vm_open_locked(struct drm_device *dev, struct vm_area_struct *vma); |
1276 | extern void drm_vm_close_locked(struct vm_area_struct *vma); |
1282 | extern void drm_vm_close_locked(struct drm_device *dev, struct vm_area_struct *vma); |
Line 1277... | Line 1283... | ||
1277 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
1283 | extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); |
1278 | 1284 | ||
1279 | /* Memory management support (drm_memory.h) */ |
- | |
1280 | #include "drm_memory.h" |
- | |
1281 | extern void drm_mem_init(void); |
- | |
1282 | extern int drm_mem_info(char *buf, char **start, off_t offset, |
- | |
1283 | int request, int *eof, void *data); |
- | |
1284 | extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); |
1285 | /* Memory management support (drm_memory.h) */ |
1285 | 1286 | #include |
|
1286 | extern void drm_free_agp(DRM_AGP_MEM * handle, int pages); |
1287 | extern void drm_free_agp(DRM_AGP_MEM * handle, int pages); |
1287 | extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); |
1288 | extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); |
1288 | extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, |
1289 | extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, |
Line 1344... | Line 1345... | ||
1344 | struct drm_file *file_priv); |
1345 | struct drm_file *file_priv); |
1345 | extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic); |
1346 | extern int drm_remove_magic(struct drm_master *master, drm_magic_t magic); |
Line 1346... | Line 1347... | ||
1346 | 1347 | ||
1347 | /* Cache management (drm_cache.c) */ |
1348 | /* Cache management (drm_cache.c) */ |
- | 1349 | void drm_clflush_pages(struct page *pages[], unsigned long num_pages); |
|
- | 1350 | void drm_clflush_sg(struct sg_table *st); |
|
Line 1348... | Line 1351... | ||
1348 | void drm_clflush_pages(struct page *pages[], unsigned long num_pages); |
1351 | void drm_clflush_virt_range(char *addr, unsigned long length); |
1349 | 1352 | ||
1350 | /* Locking IOCTL support (drm_lock.h) */ |
1353 | /* Locking IOCTL support (drm_lock.h) */ |
1351 | extern int drm_lock(struct drm_device *dev, void *data, |
1354 | extern int drm_lock(struct drm_device *dev, void *data, |
Line 1395... | Line 1398... | ||
1395 | struct drm_file *filp); |
1398 | struct drm_file *filp); |
Line 1396... | Line 1399... | ||
1396 | 1399 | ||
1397 | /* IRQ support (drm_irq.h) */ |
1400 | /* IRQ support (drm_irq.h) */ |
1398 | extern int drm_control(struct drm_device *dev, void *data, |
1401 | extern int drm_control(struct drm_device *dev, void *data, |
1399 | struct drm_file *file_priv); |
- | |
1400 | extern irqreturn_t drm_irq_handler(DRM_IRQ_ARGS); |
1402 | struct drm_file *file_priv); |
1401 | extern int drm_irq_install(struct drm_device *dev); |
1403 | extern int drm_irq_install(struct drm_device *dev); |
1402 | extern int drm_irq_uninstall(struct drm_device *dev); |
- | |
1403 | extern void drm_driver_irq_preinstall(struct drm_device *dev); |
- | |
1404 | extern void drm_driver_irq_postinstall(struct drm_device *dev); |
- | |
Line 1405... | Line 1404... | ||
1405 | extern void drm_driver_irq_uninstall(struct drm_device *dev); |
1404 | extern int drm_irq_uninstall(struct drm_device *dev); |
1406 | 1405 | ||
1407 | extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); |
1406 | extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); |
1408 | extern int drm_wait_vblank(struct drm_device *dev, void *data, |
1407 | extern int drm_wait_vblank(struct drm_device *dev, void *data, |
Line 1476... | Line 1475... | ||
1476 | extern struct drm_master *drm_master_get(struct drm_master *master); |
1475 | extern struct drm_master *drm_master_get(struct drm_master *master); |
1477 | extern void drm_master_put(struct drm_master **master); |
1476 | extern void drm_master_put(struct drm_master **master); |
Line 1478... | Line 1477... | ||
1478 | 1477 | ||
1479 | extern void drm_put_dev(struct drm_device *dev); |
1478 | extern void drm_put_dev(struct drm_device *dev); |
- | 1479 | extern int drm_put_minor(struct drm_minor **minor); |
|
- | 1480 | extern void drm_unplug_dev(struct drm_device *dev); |
|
- | 1481 | #endif |
|
1480 | extern int drm_put_minor(struct drm_minor **minor); |
1482 | |
Line -... | Line 1483... | ||
- | 1483 | extern unsigned int drm_debug; |
|
1481 | extern unsigned int drm_debug; |
1484 | |
1482 | 1485 | #if 0 |
|
Line 1483... | Line 1486... | ||
1483 | extern unsigned int drm_vblank_offdelay; |
1486 | extern unsigned int drm_vblank_offdelay; |
1484 | extern unsigned int drm_timestamp_precision; |
1487 | extern unsigned int drm_timestamp_precision; |
Line 1508... | Line 1511... | ||
1508 | #endif |
1511 | #endif |
Line 1509... | Line 1512... | ||
1509 | 1512 | ||
1510 | /* Info file support */ |
1513 | /* Info file support */ |
1511 | extern int drm_name_info(struct seq_file *m, void *data); |
1514 | extern int drm_name_info(struct seq_file *m, void *data); |
1512 | extern int drm_vm_info(struct seq_file *m, void *data); |
- | |
1513 | extern int drm_queues_info(struct seq_file *m, void *data); |
1515 | extern int drm_vm_info(struct seq_file *m, void *data); |
1514 | extern int drm_bufs_info(struct seq_file *m, void *data); |
1516 | extern int drm_bufs_info(struct seq_file *m, void *data); |
1515 | extern int drm_vblank_info(struct seq_file *m, void *data); |
1517 | extern int drm_vblank_info(struct seq_file *m, void *data); |
1516 | extern int drm_clients_info(struct seq_file *m, void* data); |
1518 | extern int drm_clients_info(struct seq_file *m, void* data); |
Line 1531... | Line 1533... | ||
1531 | /* ATI PCIGART support (ati_pcigart.h) */ |
1533 | /* ATI PCIGART support (ati_pcigart.h) */ |
1532 | extern int drm_ati_pcigart_init(struct drm_device *dev, |
1534 | extern int drm_ati_pcigart_init(struct drm_device *dev, |
1533 | struct drm_ati_pcigart_info * gart_info); |
1535 | struct drm_ati_pcigart_info * gart_info); |
1534 | extern int drm_ati_pcigart_cleanup(struct drm_device *dev, |
1536 | extern int drm_ati_pcigart_cleanup(struct drm_device *dev, |
1535 | struct drm_ati_pcigart_info * gart_info); |
1537 | struct drm_ati_pcigart_info * gart_info); |
- | 1538 | #endif |
|
Line 1536... | Line 1539... | ||
1536 | 1539 | ||
1537 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, |
1540 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, |
1538 | size_t align); |
1541 | size_t align); |
1539 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1542 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
Line -... | Line 1543... | ||
- | 1543 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
|
1540 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1544 | |
1541 | 1545 | #if 0 |
|
1542 | /* sysfs support (drm_sysfs.c) */ |
1546 | /* sysfs support (drm_sysfs.c) */ |
1543 | struct drm_sysfs_class; |
1547 | struct drm_sysfs_class; |
1544 | extern struct class *drm_sysfs_create(struct module *owner, char *name); |
1548 | extern struct class *drm_sysfs_create(struct module *owner, char *name); |
Line 1678... | Line 1682... | ||
1678 | static __inline__ void drm_core_dropmap(struct drm_local_map *map) |
1682 | static __inline__ void drm_core_dropmap(struct drm_local_map *map) |
1679 | { |
1683 | { |
1680 | } |
1684 | } |
Line -... | Line 1685... | ||
- | 1685 | ||
1681 | 1686 | ||
1682 | 1687 | ||
1683 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) |
1688 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) |
1684 | { |
1689 | { |
Line 1700... | Line 1705... | ||
1700 | vfree(ptr); |
1705 | vfree(ptr); |
1701 | } |
1706 | } |
Line 1702... | Line 1707... | ||
1702 | 1707 | ||
Line -... | Line 1708... | ||
- | 1708 | #endif |
|
- | 1709 | ||
- | 1710 | #define DRM_PCIE_SPEED_25 1 |
|
- | 1711 | #define DRM_PCIE_SPEED_50 2 |
|
- | 1712 | #define DRM_PCIE_SPEED_80 4 |
|
Line 1703... | Line 1713... | ||
1703 | #endif |
1713 | |
1704 | 1714 | extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask); |
|
1705 | 1715 | ||
1706 | static __inline__ int drm_device_is_agp(struct drm_device *dev) |
1716 | static __inline__ int drm_device_is_agp(struct drm_device *dev) |
Line 1711... | Line 1721... | ||
1711 | static __inline__ int drm_device_is_pcie(struct drm_device *dev) |
1721 | static __inline__ int drm_device_is_pcie(struct drm_device *dev) |
1712 | { |
1722 | { |
1713 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); |
1723 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); |
1714 | } |
1724 | } |
1715 | #endif /* __KERNEL__ */ |
1725 | #endif /* __KERNEL__ */ |
- | 1726 | ||
- | 1727 | #define drm_sysfs_connector_add(connector) |
|
- | 1728 | #define drm_sysfs_connector_remove(connector) |
|
- | 1729 | ||
1716 | #endif=>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><>><>><>><>><>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><>>>>>>>><>><>><> |
1730 | #endif=>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><>><>><>><>><>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><>>>>>>>><>><>><> |