OSDN Git Service

34145070ce783fc9e80fc00c9057165061e145a9
[android-x86/external-libdrm.git] / linux / radeon_drv.c
1 /* radeon_drv.c -- ATI Radeon driver -*- linux-c -*-
2  * Created: Wed Feb 14 17:10:04 2001 by gareth@valinux.com
3  *
4  * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
5  * All Rights Reserved.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation
10  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  * and/or sell copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the next
15  * paragraph) shall be included in all copies or substantial portions of the
16  * Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
21  * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24  * OTHER DEALINGS IN THE SOFTWARE.
25  *
26  * Authors:
27  *    Gareth Hughes <gareth@valinux.com>
28  */
29
30 #include <linux/config.h>
31 #include "radeon.h"
32 #include "drmP.h"
33 #include "radeon_drv.h"
34 #include "ati_pcigart.h"
35
36 #define DRIVER_AUTHOR           "Gareth Hughes, VA Linux Systems Inc."
37
38 #define DRIVER_NAME             "radeon"##CONFIG_XFREE86_VERSION_STR
39 #define DRIVER_DESC             "ATI Radeon"
40 #define DRIVER_DATE             "20010405"
41
42 #define DRIVER_MAJOR            1
43 #define DRIVER_MINOR            1
44 #define DRIVER_PATCHLEVEL       1
45
46 #define DRIVER_IOCTLS                                                        \
47  [DRM_IOCTL_NR(DRM_IOCTL_DMA)]               = { radeon_cp_buffers,  1, 0 }, \
48  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_INIT)]    = { radeon_cp_init,     1, 1 }, \
49  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_START)]   = { radeon_cp_start,    1, 1 }, \
50  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_STOP)]    = { radeon_cp_stop,     1, 1 }, \
51  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_RESET)]   = { radeon_cp_reset,    1, 1 }, \
52  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CP_IDLE)]    = { radeon_cp_idle,     1, 0 }, \
53  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_RESET)]    = { radeon_engine_reset,  1, 0 }, \
54  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_FULLSCREEN)] = { radeon_fullscreen,  1, 0 }, \
55  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_SWAP)]       = { radeon_cp_swap,     1, 0 }, \
56  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_CLEAR)]      = { radeon_cp_clear,    1, 0 }, \
57  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_VERTEX)]     = { radeon_cp_vertex,   1, 0 }, \
58  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_INDICES)]    = { radeon_cp_indices,  1, 0 }, \
59  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_TEXTURE)]    = { radeon_cp_texture,  1, 0 }, \
60  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_STIPPLE)]    = { radeon_cp_stipple,  1, 0 }, \
61  [DRM_IOCTL_NR(DRM_IOCTL_RADEON_INDIRECT)]   = { radeon_cp_indirect, 1, 1 },
62
63
64 #if 0
65 /* GH: Count data sent to card via ring or vertex/indirect buffers.
66  */
67 #define __HAVE_COUNTERS         3
68 #define __HAVE_COUNTER6         _DRM_STAT_IRQ
69 #define __HAVE_COUNTER7         _DRM_STAT_PRIMARY
70 #define __HAVE_COUNTER8         _DRM_STAT_SECONDARY
71 #endif
72
73
74 #include "drm_agpsupport.h"
75 #include "drm_auth.h"
76 #include "drm_bufs.h"
77 #include "drm_context.h"
78 #include "drm_dma.h"
79 #include "drm_drawable.h"
80 #include "drm_drv.h"
81 #include "drm_fops.h"
82 #include "drm_init.h"
83 #include "drm_ioctl.h"
84 #include "drm_lock.h"
85 #include "drm_memory.h"
86 #include "drm_proc.h"
87 #include "drm_vm.h"
88 #include "drm_stub.h"
89 #include "drm_scatter.h"