Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /** |
2 | * \file radeon_drv.c | |
3 | * ATI Radeon driver | |
4 | * | |
5 | * \author Gareth Hughes <gareth@valinux.com> | |
6 | */ | |
7 | ||
8 | /* | |
9 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | |
10 | * All Rights Reserved. | |
11 | * | |
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 | ||
1da177e4 LT |
32 | #include <linux/config.h> |
33 | #include "drmP.h" | |
34 | #include "drm.h" | |
35 | #include "radeon_drm.h" | |
36 | #include "radeon_drv.h" | |
37 | ||
38 | #include "drm_pciids.h" | |
39 | ||
b5e89ed5 | 40 | static int postinit(struct drm_device *dev, unsigned long flags) |
1da177e4 | 41 | { |
b5e89ed5 DA |
42 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n", |
43 | DRIVER_NAME, | |
44 | DRIVER_MAJOR, | |
45 | DRIVER_MINOR, | |
46 | DRIVER_PATCHLEVEL, | |
47 | DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev) | |
48 | ); | |
1da177e4 LT |
49 | return 0; |
50 | } | |
51 | ||
b5e89ed5 | 52 | static int version(drm_version_t * version) |
1da177e4 LT |
53 | { |
54 | int len; | |
55 | ||
56 | version->version_major = DRIVER_MAJOR; | |
57 | version->version_minor = DRIVER_MINOR; | |
58 | version->version_patchlevel = DRIVER_PATCHLEVEL; | |
b5e89ed5 DA |
59 | DRM_COPY(version->name, DRIVER_NAME); |
60 | DRM_COPY(version->date, DRIVER_DATE); | |
61 | DRM_COPY(version->desc, DRIVER_DESC); | |
1da177e4 LT |
62 | return 0; |
63 | } | |
64 | ||
65 | static struct pci_device_id pciidlist[] = { | |
66 | radeon_PCI_IDS | |
67 | }; | |
68 | ||
69 | extern drm_ioctl_desc_t radeon_ioctls[]; | |
70 | extern int radeon_max_ioctl; | |
71 | ||
72 | static struct drm_driver driver = { | |
b5e89ed5 DA |
73 | .driver_features = |
74 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | | |
75 | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | | |
76 | DRIVER_IRQ_VBL, | |
1da177e4 LT |
77 | .dev_priv_size = sizeof(drm_radeon_buf_priv_t), |
78 | .preinit = radeon_driver_preinit, | |
836cf046 | 79 | .presetup = radeon_presetup, |
1da177e4 LT |
80 | .postcleanup = radeon_driver_postcleanup, |
81 | .prerelease = radeon_driver_prerelease, | |
82 | .pretakedown = radeon_driver_pretakedown, | |
83 | .open_helper = radeon_driver_open_helper, | |
84 | .vblank_wait = radeon_driver_vblank_wait, | |
85 | .irq_preinstall = radeon_driver_irq_preinstall, | |
86 | .irq_postinstall = radeon_driver_irq_postinstall, | |
87 | .irq_uninstall = radeon_driver_irq_uninstall, | |
88 | .irq_handler = radeon_driver_irq_handler, | |
89 | .free_filp_priv = radeon_driver_free_filp_priv, | |
90 | .reclaim_buffers = drm_core_reclaim_buffers, | |
91 | .get_map_ofs = drm_core_get_map_ofs, | |
92 | .get_reg_ofs = drm_core_get_reg_ofs, | |
93 | .postinit = postinit, | |
94 | .version = version, | |
95 | .ioctls = radeon_ioctls, | |
96 | .dma_ioctl = radeon_cp_buffers, | |
97 | .fops = { | |
b5e89ed5 DA |
98 | .owner = THIS_MODULE, |
99 | .open = drm_open, | |
100 | .release = drm_release, | |
101 | .ioctl = drm_ioctl, | |
102 | .mmap = drm_mmap, | |
103 | .poll = drm_poll, | |
104 | .fasync = drm_fasync, | |
9a186645 | 105 | #ifdef CONFIG_COMPAT |
b5e89ed5 | 106 | .compat_ioctl = radeon_compat_ioctl, |
9a186645 | 107 | #endif |
b5e89ed5 DA |
108 | } |
109 | , | |
1da177e4 | 110 | .pci_driver = { |
b5e89ed5 DA |
111 | .name = DRIVER_NAME, |
112 | .id_table = pciidlist, | |
113 | } | |
1da177e4 LT |
114 | }; |
115 | ||
116 | static int __init radeon_init(void) | |
117 | { | |
118 | driver.num_ioctls = radeon_max_ioctl; | |
119 | return drm_init(&driver); | |
120 | } | |
121 | ||
122 | static void __exit radeon_exit(void) | |
123 | { | |
124 | drm_exit(&driver); | |
125 | } | |
126 | ||
127 | module_init(radeon_init); | |
128 | module_exit(radeon_exit); | |
129 | ||
b5e89ed5 DA |
130 | MODULE_AUTHOR(DRIVER_AUTHOR); |
131 | MODULE_DESCRIPTION(DRIVER_DESC); | |
1da177e4 | 132 | MODULE_LICENSE("GPL and additional rights"); |