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 | ||
689b9d74 DA |
40 | int radeon_no_wb; |
41 | ||
42 | MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n"); | |
43 | module_param_named(no_wb, radeon_no_wb, int, 0444); | |
44 | ||
1da177e4 LT |
45 | |
46 | static struct pci_device_id pciidlist[] = { | |
47 | radeon_PCI_IDS | |
48 | }; | |
49 | ||
1da177e4 | 50 | static struct drm_driver driver = { |
b5e89ed5 DA |
51 | .driver_features = |
52 | DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | | |
53 | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | | |
54 | DRIVER_IRQ_VBL, | |
1da177e4 | 55 | .dev_priv_size = sizeof(drm_radeon_buf_priv_t), |
22eae947 DA |
56 | .load = radeon_driver_load, |
57 | .firstopen = radeon_driver_firstopen, | |
58 | .open = radeon_driver_open, | |
59 | .preclose = radeon_driver_preclose, | |
60 | .postclose = radeon_driver_postclose, | |
61 | .lastclose = radeon_driver_lastclose, | |
62 | .unload = radeon_driver_unload, | |
1da177e4 LT |
63 | .vblank_wait = radeon_driver_vblank_wait, |
64 | .irq_preinstall = radeon_driver_irq_preinstall, | |
65 | .irq_postinstall = radeon_driver_irq_postinstall, | |
66 | .irq_uninstall = radeon_driver_irq_uninstall, | |
67 | .irq_handler = radeon_driver_irq_handler, | |
1da177e4 LT |
68 | .reclaim_buffers = drm_core_reclaim_buffers, |
69 | .get_map_ofs = drm_core_get_map_ofs, | |
70 | .get_reg_ofs = drm_core_get_reg_ofs, | |
1da177e4 LT |
71 | .ioctls = radeon_ioctls, |
72 | .dma_ioctl = radeon_cp_buffers, | |
73 | .fops = { | |
b5e89ed5 DA |
74 | .owner = THIS_MODULE, |
75 | .open = drm_open, | |
76 | .release = drm_release, | |
77 | .ioctl = drm_ioctl, | |
78 | .mmap = drm_mmap, | |
79 | .poll = drm_poll, | |
80 | .fasync = drm_fasync, | |
9a186645 | 81 | #ifdef CONFIG_COMPAT |
b5e89ed5 | 82 | .compat_ioctl = radeon_compat_ioctl, |
9a186645 | 83 | #endif |
22eae947 DA |
84 | }, |
85 | ||
1da177e4 | 86 | .pci_driver = { |
22eae947 DA |
87 | .name = DRIVER_NAME, |
88 | .id_table = pciidlist, | |
89 | }, | |
90 | ||
91 | .name = DRIVER_NAME, | |
92 | .desc = DRIVER_DESC, | |
93 | .date = DRIVER_DATE, | |
94 | .major = DRIVER_MAJOR, | |
95 | .minor = DRIVER_MINOR, | |
96 | .patchlevel = DRIVER_PATCHLEVEL, | |
1da177e4 LT |
97 | }; |
98 | ||
99 | static int __init radeon_init(void) | |
100 | { | |
101 | driver.num_ioctls = radeon_max_ioctl; | |
102 | return drm_init(&driver); | |
103 | } | |
104 | ||
105 | static void __exit radeon_exit(void) | |
106 | { | |
107 | drm_exit(&driver); | |
108 | } | |
109 | ||
110 | module_init(radeon_init); | |
111 | module_exit(radeon_exit); | |
112 | ||
b5e89ed5 DA |
113 | MODULE_AUTHOR(DRIVER_AUTHOR); |
114 | MODULE_DESCRIPTION(DRIVER_DESC); | |
1da177e4 | 115 | MODULE_LICENSE("GPL and additional rights"); |