Change the kernel dev_t, representing a pointer to a specinfo structure,
[dragonfly.git] / sys / dev / drm / drmP.h
CommitLineData
984263bc
MD
1/* drmP.h -- Private header for Direct Rendering Manager -*- linux-c -*-
2 * Created: Mon Jan 4 10:05:05 1999 by faith@precisioninsight.com
3 *
4 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
6 * All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
17 * Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 *
27 * Authors:
28 * Rickard E. (Rik) Faith <faith@valinux.com>
29 * Gareth Hughes <gareth@valinux.com>
30 * $FreeBSD: src/sys/dev/drm/drmP.h,v 1.4.2.1 2003/04/26 07:05:27 anholt Exp $
b13267a5 31 * $DragonFly: src/sys/dev/drm/drmP.h,v 1.4 2006/09/10 01:26:34 dillon Exp $
984263bc
MD
32 */
33
34#ifndef _DRM_P_H_
35#define _DRM_P_H_
36
37#if defined(_KERNEL) || defined(__KERNEL__)
38
39/* DRM template customization defaults
40 */
41#ifndef __HAVE_AGP
42#define __HAVE_AGP 0
43#endif
44#ifndef __HAVE_MTRR
45#define __HAVE_MTRR 0
46#endif
47#ifndef __HAVE_CTX_BITMAP
48#define __HAVE_CTX_BITMAP 0
49#endif
50#ifndef __HAVE_DMA
51#define __HAVE_DMA 0
52#endif
53#ifndef __HAVE_DMA_IRQ
54#define __HAVE_DMA_IRQ 0
55#endif
56
57#define DRM_DEBUG_CODE 0 /* Include debugging code (if > 1, then
58 also include looping detection. */
59
60typedef struct drm_device drm_device_t;
61typedef struct drm_file drm_file_t;
62
63/* There's undoubtably more of this file to go into these OS dependent ones. */
64
4637ddfb 65#if defined(__DragonFly__) || defined(__FreeBSD__)
984263bc
MD
66#include "dev/drm/drm_os_freebsd.h"
67#elif defined __NetBSD__
68#include "dev/drm/drm_os_netbsd.h"
69#endif
70
71#include "dev/drm/drm.h"
72
73/* Begin the DRM... */
74
75#define DRM_HASH_SIZE 16 /* Size of key hash table */
76#define DRM_KERNEL_CONTEXT 0 /* Change drm_resctx if changed */
77#define DRM_RESERVED_CONTEXTS 1 /* Change drm_resctx if changed */
78
79#define DRM_FLAG_DEBUG 0x01
80
81#define DRM_MEM_DMA 0
82#define DRM_MEM_SAREA 1
83#define DRM_MEM_DRIVER 2
84#define DRM_MEM_MAGIC 3
85#define DRM_MEM_IOCTLS 4
86#define DRM_MEM_MAPS 5
87#define DRM_MEM_BUFS 6
88#define DRM_MEM_SEGS 7
89#define DRM_MEM_PAGES 8
90#define DRM_MEM_FILES 9
91#define DRM_MEM_QUEUES 10
92#define DRM_MEM_CMDS 11
93#define DRM_MEM_MAPPINGS 12
94#define DRM_MEM_BUFLISTS 13
95#define DRM_MEM_AGPLISTS 14
96#define DRM_MEM_TOTALAGP 15
97#define DRM_MEM_BOUNDAGP 16
98#define DRM_MEM_CTXBITMAP 17
99#define DRM_MEM_STUB 18
100#define DRM_MEM_SGLISTS 19
101
102#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
103
104 /* Mapping helper macros */
105#define DRM_IOREMAP(map) \
106 (map)->handle = DRM(ioremap)( dev, map )
107
108#define DRM_IOREMAP_NOCACHE(map) \
109 (map)->handle = DRM(ioremap_nocache)( dev, map )
110
111#define DRM_IOREMAPFREE(map) \
112 do { \
113 if ( (map)->handle && (map)->size ) \
114 DRM(ioremapfree)( map ); \
115 } while (0)
116
117 /* Internal types and structures */
118#define DRM_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
119#define DRM_MIN(a,b) ((a)<(b)?(a):(b))
120#define DRM_MAX(a,b) ((a)>(b)?(a):(b))
121
122#define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1))
123#define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
124#define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist)
125
126#define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do { \
127 (_map) = (_dev)->context_sareas[_ctx]; \
128} while(0)
129
130
131typedef struct drm_ioctl_desc {
132 int (*func)(DRM_IOCTL_ARGS);
133 int auth_needed;
134 int root_only;
135} drm_ioctl_desc_t;
136
137typedef struct drm_magic_entry {
138 drm_magic_t magic;
139 struct drm_file *priv;
140 struct drm_magic_entry *next;
141} drm_magic_entry_t;
142
143typedef struct drm_magic_head {
144 struct drm_magic_entry *head;
145 struct drm_magic_entry *tail;
146} drm_magic_head_t;
147
148typedef struct drm_buf {
149 int idx; /* Index into master buflist */
150 int total; /* Buffer size */
151 int order; /* log-base-2(total) */
152 int used; /* Amount of buffer in use (for DMA) */
153 unsigned long offset; /* Byte offset (used internally) */
154 void *address; /* Address of buffer */
155 unsigned long bus_address; /* Bus address of buffer */
156 struct drm_buf *next; /* Kernel-only: used for free list */
157 __volatile__ int pending; /* On hardware DMA queue */
158 DRMFILE filp; /* Unique identifier of holding process */
159 int context; /* Kernel queue for this buffer */
160 enum {
161 DRM_LIST_NONE = 0,
162 DRM_LIST_FREE = 1,
163 DRM_LIST_WAIT = 2,
164 DRM_LIST_PEND = 3,
165 DRM_LIST_PRIO = 4,
166 DRM_LIST_RECLAIM = 5
167 } list; /* Which list we're on */
168
169 int dev_priv_size; /* Size of buffer private stoarge */
170 void *dev_private; /* Per-buffer private storage */
171} drm_buf_t;
172
173 /* bufs is one longer than it has to be */
174typedef struct drm_waitlist {
175 int count; /* Number of possible buffers */
176 drm_buf_t **bufs; /* List of pointers to buffers */
177 drm_buf_t **rp; /* Read pointer */
178 drm_buf_t **wp; /* Write pointer */
179 drm_buf_t **end; /* End pointer */
180 DRM_SPINTYPE read_lock;
181 DRM_SPINTYPE write_lock;
182} drm_waitlist_t;
183
184typedef struct drm_freelist {
185 int initialized; /* Freelist in use */
186 atomic_t count; /* Number of free buffers */
187 drm_buf_t *next; /* End pointer */
188
189 int low_mark; /* Low water mark */
190 int high_mark; /* High water mark */
191 DRM_SPINTYPE lock;
192} drm_freelist_t;
193
194typedef struct drm_buf_entry {
195 int buf_size;
196 int buf_count;
197 drm_buf_t *buflist;
198 int seg_count;
199 int page_order;
200 unsigned long *seglist;
201
202 drm_freelist_t freelist;
203} drm_buf_entry_t;
204
205typedef struct drm_hw_lock {
206 __volatile__ unsigned int lock;
207 char padding[60]; /* Pad to cache line */
208} drm_hw_lock_t;
209
210typedef TAILQ_HEAD(drm_file_list, drm_file) drm_file_list_t;
211struct drm_file {
212 TAILQ_ENTRY(drm_file) link;
213 int authenticated;
214 int minor;
215 pid_t pid;
216 uid_t uid;
217 int refs;
218 drm_magic_t magic;
219 unsigned long ioctl_count;
220 struct drm_device *devXX;
221};
222
223typedef struct drm_lock_data {
224 drm_hw_lock_t *hw_lock; /* Hardware lock */
225 DRMFILE filp; /* Unique identifier of holding process (NULL is kernel)*/
226 wait_queue_head_t lock_queue; /* Queue of blocked processes */
227 unsigned long lock_time; /* Time of last lock in jiffies */
228} drm_lock_data_t;
229
230typedef struct drm_device_dma {
231 drm_buf_entry_t bufs[DRM_MAX_ORDER+1];
232 int buf_count;
233 drm_buf_t **buflist; /* Vector of pointers info bufs */
234 int seg_count;
235 int page_count;
236 unsigned long *pagelist;
237 unsigned long byte_count;
238 enum {
239 _DRM_DMA_USE_AGP = 0x01,
240 _DRM_DMA_USE_SG = 0x02
241 } flags;
242
243 /* DMA support */
244 drm_buf_t *this_buffer; /* Buffer being sent */
245 drm_buf_t *next_buffer; /* Selected buffer to send */
246} drm_device_dma_t;
247
248#if __REALLY_HAVE_AGP
249typedef struct drm_agp_mem {
250 void *handle;
251 unsigned long bound; /* address */
252 int pages;
253 struct drm_agp_mem *prev;
254 struct drm_agp_mem *next;
255} drm_agp_mem_t;
256
257typedef struct drm_agp_head {
258 device_t agpdev;
259 struct agp_info info;
260 const char *chipset;
261 drm_agp_mem_t *memory;
262 unsigned long mode;
263 int enabled;
264 int acquired;
265 unsigned long base;
266 int agp_mtrr;
267 int cant_use_aperture;
268 unsigned long page_mask;
269} drm_agp_head_t;
270#endif
271
272typedef struct drm_sg_mem {
273 unsigned long handle;
274 void *virtual;
275 int pages;
276 dma_addr_t *busaddr;
277} drm_sg_mem_t;
278
279typedef struct drm_local_map {
280 unsigned long offset; /* Physical address (0 for SAREA)*/
281 unsigned long size; /* Physical size (bytes) */
282 drm_map_type_t type; /* Type of memory mapped */
283 drm_map_flags_t flags; /* Flags */
284 void *handle; /* User-space: "Handle" to pass to mmap */
285 /* Kernel-space: kernel-virtual address */
286 int mtrr; /* MTRR slot used */
287 /* Private data */
288 bus_space_tag_t iot;
289 bus_space_handle_t ioh;
290} drm_local_map_t;
291
292typedef TAILQ_HEAD(drm_map_list, drm_map_list_entry) drm_map_list_t;
293typedef struct drm_map_list_entry {
294 TAILQ_ENTRY(drm_map_list_entry) link;
295 drm_local_map_t *map;
296} drm_map_list_entry_t;
297
298TAILQ_HEAD(drm_vbl_sig_list, drm_vbl_sig);
299typedef struct drm_vbl_sig {
300 TAILQ_ENTRY(drm_vbl_sig) link;
301 unsigned int sequence;
302 int signo;
303 int pid;
304} drm_vbl_sig_t;
305
306struct drm_device {
307#ifdef __NetBSD__
308 struct device device; /* NetBSD's softc is an extension of struct device */
309#endif
310 const char *name; /* Simple driver name */
311 char *unique; /* Unique identifier: e.g., busid */
312 int unique_len; /* Length of unique field */
4637ddfb 313#if defined(__DragonFly__) || defined(__FreeBSD__)
984263bc
MD
314 device_t device; /* Device instance from newbus */
315#endif
b13267a5 316 cdev_t devnode; /* Device number for mknod */
984263bc
MD
317
318 int flags; /* Flags to open(2) */
319
320 /* Locks */
321 DRM_SPINTYPE count_lock; /* For open_count, buf_use, buf_alloc */
322 struct lock dev_lock; /* For others */
323 /* Usage Counters */
324 int open_count; /* Outstanding files open */
325 int buf_use; /* Buffers in use -- cannot alloc */
326 int buf_alloc; /* Buffer allocation in progress */
327
328 /* Performance counters */
329 unsigned long counters;
330 drm_stat_type_t types[15];
331 atomic_t counts[15];
332
333 /* Authentication */
334 drm_file_list_t files;
335 drm_magic_head_t magiclist[DRM_HASH_SIZE];
336
337 /* Memory management */
338 drm_map_list_t *maplist; /* Linked list of regions */
339
340 drm_local_map_t **context_sareas;
341 int max_context;
342
343 drm_lock_data_t lock; /* Information on hardware lock */
344
345 /* DMA queues (contexts) */
346 drm_device_dma_t *dma; /* Optional pointer for DMA support */
347
348 /* Context support */
349 int irq; /* Interrupt used by board */
350 int irqrid; /* Interrupt used by board */
4637ddfb 351#if defined(__DragonFly__) || defined(__FreeBSD__)
984263bc
MD
352 struct resource *irqr; /* Resource for interrupt used by board */
353#elif defined(__NetBSD__)
354 struct pci_attach_args pa;
355 pci_intr_handle_t ih;
356#endif
357 void *irqh; /* Handle from bus_setup_intr */
358 atomic_t context_flag; /* Context swapping flag */
359 struct callout timer; /* Timer for delaying ctx switch */
360 int last_context; /* Last current context */
4637ddfb 361#if defined(__DragonFly__) || __FreeBSD_version >= 400005
984263bc
MD
362 struct task task;
363#endif
364#if __HAVE_VBL_IRQ
365 wait_queue_head_t vbl_queue; /* vbl wait channel */
366 atomic_t vbl_received;
367#if 0 /* vbl signals are untested */
368 struct drm_vbl_sig_list vbl_sig_list;
369 DRM_SPINTYPE vbl_lock;
370#endif
371#endif
372
4637ddfb 373#if defined(__DragonFly__) || defined(__FreeBSD__)
984263bc
MD
374 struct sigio *buf_sigio; /* Processes waiting for SIGIO */
375#elif defined(__NetBSD__)
376 pid_t buf_pgid;
377#endif
378
379 /* Sysctl support */
380 struct drm_sysctl_info *sysctl;
381
382#if __REALLY_HAVE_AGP
383 drm_agp_head_t *agp;
384#endif
385 drm_sg_mem_t *sg; /* Scatter gather memory */
386 atomic_t *ctx_bitmap;
387 void *dev_private;
388};
389
390extern int DRM(flags);
391
392 /* Authentication (drm_auth.h) */
393extern int DRM(add_magic)(drm_device_t *dev, drm_file_t *priv,
394 drm_magic_t magic);
395extern int DRM(remove_magic)(drm_device_t *dev, drm_magic_t magic);
396
397 /* Driver support (drm_drv.h) */
398extern int DRM(version)( DRM_IOCTL_ARGS );
399
400 /* Memory management support (drm_memory.h) */
401extern void DRM(mem_init)(void);
402extern void DRM(mem_uninit)(void);
403extern void *DRM(alloc)(size_t size, int area);
404extern void *DRM(realloc)(void *oldpt, size_t oldsize, size_t size,
405 int area);
406extern char *DRM(strdup)(const char *s, int area);
407extern void DRM(strfree)(char *s, int area);
408extern void DRM(free)(void *pt, size_t size, int area);
409extern void *DRM(ioremap)(drm_device_t *dev, drm_local_map_t *map);
410extern void *DRM(ioremap_nocache)(drm_device_t *dev, drm_local_map_t *map);
411extern void DRM(ioremapfree)(drm_local_map_t *map);
412
413#if __REALLY_HAVE_AGP
414extern agp_memory *DRM(alloc_agp)(int pages, u32 type);
415extern int DRM(free_agp)(agp_memory *handle, int pages);
416extern int DRM(bind_agp)(agp_memory *handle, unsigned int start);
417extern int DRM(unbind_agp)(agp_memory *handle);
418#endif
419
420extern int DRM(context_switch)(drm_device_t *dev, int old, int new);
421extern int DRM(context_switch_complete)(drm_device_t *dev, int new);
422
423#if __HAVE_CTX_BITMAP
424extern int DRM(ctxbitmap_init)( drm_device_t *dev );
425extern void DRM(ctxbitmap_cleanup)( drm_device_t *dev );
426extern void DRM(ctxbitmap_free)( drm_device_t *dev, int ctx_handle );
427extern int DRM(ctxbitmap_next)( drm_device_t *dev );
428#endif
429
430 /* Locking IOCTL support (drm_lock.h) */
431extern int DRM(lock_take)(__volatile__ unsigned int *lock,
432 unsigned int context);
433extern int DRM(lock_transfer)(drm_device_t *dev,
434 __volatile__ unsigned int *lock,
435 unsigned int context);
436extern int DRM(lock_free)(drm_device_t *dev,
437 __volatile__ unsigned int *lock,
438 unsigned int context);
439
440 /* Buffer management support (drm_bufs.h) */
441extern int DRM(order)( unsigned long size );
442
443#if __HAVE_DMA
444 /* DMA support (drm_dma.h) */
445extern int DRM(dma_setup)(drm_device_t *dev);
446extern void DRM(dma_takedown)(drm_device_t *dev);
447extern void DRM(free_buffer)(drm_device_t *dev, drm_buf_t *buf);
448extern void DRM(reclaim_buffers)(drm_device_t *dev, DRMFILE filp);
449#if __HAVE_DMA_IRQ
450extern int DRM(irq_install)( drm_device_t *dev, int irq );
451extern int DRM(irq_uninstall)( drm_device_t *dev );
452extern void DRM(dma_service)( DRM_IRQ_ARGS );
453extern void DRM(driver_irq_preinstall)( drm_device_t *dev );
454extern void DRM(driver_irq_postinstall)( drm_device_t *dev );
455extern void DRM(driver_irq_uninstall)( drm_device_t *dev );
456#if __HAVE_DMA_IRQ_BH
457extern void DRM(dma_immediate_bh)( DRM_TASKQUEUE_ARGS );
458#endif
459#endif
460
461 /* Buffer list support (drm_lists.h) */
462#if __HAVE_DMA_WAITLIST
463extern int DRM(waitlist_create)(drm_waitlist_t *bl, int count);
464extern int DRM(waitlist_destroy)(drm_waitlist_t *bl);
465extern int DRM(waitlist_put)(drm_waitlist_t *bl, drm_buf_t *buf);
466extern drm_buf_t *DRM(waitlist_get)(drm_waitlist_t *bl);
467#endif
468#endif /* __HAVE_DMA */
469#if __HAVE_VBL_IRQ
470extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
471extern void DRM(vbl_send_signals)( drm_device_t *dev );
472#endif
473
474#if __REALLY_HAVE_AGP
475 /* AGP/GART support (drm_agpsupport.h) */
476extern drm_agp_head_t *DRM(agp_init)(void);
477extern void DRM(agp_uninit)(void);
478extern void DRM(agp_do_release)(void);
479extern agp_memory *DRM(agp_allocate_memory)(size_t pages, u32 type);
480extern int DRM(agp_free_memory)(agp_memory *handle);
481extern int DRM(agp_bind_memory)(agp_memory *handle, off_t start);
482extern int DRM(agp_unbind_memory)(agp_memory *handle);
483#endif
484
485#if __HAVE_SG
486 /* Scatter Gather Support (drm_scatter.h) */
487extern void DRM(sg_cleanup)(drm_sg_mem_t *entry);
488#endif
489
490#if __REALLY_HAVE_SG
491 /* ATI PCIGART support (ati_pcigart.h) */
492extern int DRM(ati_pcigart_init)(drm_device_t *dev,
493 unsigned long *addr,
494 dma_addr_t *bus_addr);
495extern int DRM(ati_pcigart_cleanup)(drm_device_t *dev,
496 unsigned long addr,
497 dma_addr_t bus_addr);
498#endif
499
500/* Locking IOCTL support (drm_drv.h) */
501extern int DRM(lock)(DRM_IOCTL_ARGS);
502extern int DRM(unlock)(DRM_IOCTL_ARGS);
503
504/* Misc. IOCTL support (drm_ioctl.h) */
505extern int DRM(irq_busid)(DRM_IOCTL_ARGS);
506extern int DRM(getunique)(DRM_IOCTL_ARGS);
507extern int DRM(setunique)(DRM_IOCTL_ARGS);
508extern int DRM(getmap)(DRM_IOCTL_ARGS);
509extern int DRM(getclient)(DRM_IOCTL_ARGS);
510extern int DRM(getstats)(DRM_IOCTL_ARGS);
511extern int DRM(noop)(DRM_IOCTL_ARGS);
512
513/* Context IOCTL support (drm_context.h) */
514extern int DRM(resctx)(DRM_IOCTL_ARGS);
515extern int DRM(addctx)(DRM_IOCTL_ARGS);
516extern int DRM(modctx)(DRM_IOCTL_ARGS);
517extern int DRM(getctx)(DRM_IOCTL_ARGS);
518extern int DRM(switchctx)(DRM_IOCTL_ARGS);
519extern int DRM(newctx)(DRM_IOCTL_ARGS);
520extern int DRM(rmctx)(DRM_IOCTL_ARGS);
521extern int DRM(setsareactx)(DRM_IOCTL_ARGS);
522extern int DRM(getsareactx)(DRM_IOCTL_ARGS);
523
524/* Drawable IOCTL support (drm_drawable.h) */
525extern int DRM(adddraw)(DRM_IOCTL_ARGS);
526extern int DRM(rmdraw)(DRM_IOCTL_ARGS);
527
528/* Authentication IOCTL support (drm_auth.h) */
529extern int DRM(getmagic)(DRM_IOCTL_ARGS);
530extern int DRM(authmagic)(DRM_IOCTL_ARGS);
531
532/* Buffer management support (drm_bufs.h) */
533extern int DRM(addmap)(DRM_IOCTL_ARGS);
534extern int DRM(rmmap)(DRM_IOCTL_ARGS);
535#if __HAVE_DMA
536extern int DRM(addbufs)(DRM_IOCTL_ARGS);
537extern int DRM(infobufs)(DRM_IOCTL_ARGS);
538extern int DRM(markbufs)(DRM_IOCTL_ARGS);
539extern int DRM(freebufs)(DRM_IOCTL_ARGS);
540extern int DRM(mapbufs)(DRM_IOCTL_ARGS);
541#endif
542
543/* DMA support (drm_dma.h) */
544#if __HAVE_DMA
545extern int DRM(control)(DRM_IOCTL_ARGS);
546#endif
547#if __HAVE_VBL_IRQ
548extern int DRM(wait_vblank)(DRM_IOCTL_ARGS);
549#endif
550
551/* AGP/GART support (drm_agpsupport.h) */
552#if __REALLY_HAVE_AGP
553extern int DRM(agp_acquire)(DRM_IOCTL_ARGS);
554extern int DRM(agp_release)(DRM_IOCTL_ARGS);
555extern int DRM(agp_enable)(DRM_IOCTL_ARGS);
556extern int DRM(agp_info)(DRM_IOCTL_ARGS);
557extern int DRM(agp_alloc)(DRM_IOCTL_ARGS);
558extern int DRM(agp_free)(DRM_IOCTL_ARGS);
559extern int DRM(agp_unbind)(DRM_IOCTL_ARGS);
560extern int DRM(agp_bind)(DRM_IOCTL_ARGS);
561#endif
562
563/* Scatter Gather Support (drm_scatter.h) */
564#if __HAVE_SG
565extern int DRM(sg_alloc)(DRM_IOCTL_ARGS);
566extern int DRM(sg_free)(DRM_IOCTL_ARGS);
567#endif
568
569
570#endif /* __KERNEL__ */
571#endif /* _DRM_P_H_ */