aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_drv.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/char/drm/radeon_drv.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/char/drm/radeon_drv.c')
-rw-r--r--drivers/char/drm/radeon_drv.c127
1 files changed, 127 insertions, 0 deletions
diff --git a/drivers/char/drm/radeon_drv.c b/drivers/char/drm/radeon_drv.c
new file mode 100644
index 000000000000..7b983d96e53b
--- /dev/null
+++ b/drivers/char/drm/radeon_drv.c
@@ -0,0 +1,127 @@
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
32
33#include <linux/config.h>
34#include "drmP.h"
35#include "drm.h"
36#include "radeon_drm.h"
37#include "radeon_drv.h"
38
39#include "drm_pciids.h"
40
41static int postinit( struct drm_device *dev, unsigned long flags )
42{
43 DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n",
44 DRIVER_NAME,
45 DRIVER_MAJOR,
46 DRIVER_MINOR,
47 DRIVER_PATCHLEVEL,
48 DRIVER_DATE,
49 dev->primary.minor,
50 pci_pretty_name(dev->pdev)
51 );
52 return 0;
53}
54
55static int version( drm_version_t *version )
56{
57 int len;
58
59 version->version_major = DRIVER_MAJOR;
60 version->version_minor = DRIVER_MINOR;
61 version->version_patchlevel = DRIVER_PATCHLEVEL;
62 DRM_COPY( version->name, DRIVER_NAME );
63 DRM_COPY( version->date, DRIVER_DATE );
64 DRM_COPY( version->desc, DRIVER_DESC );
65 return 0;
66}
67
68static struct pci_device_id pciidlist[] = {
69 radeon_PCI_IDS
70};
71
72extern drm_ioctl_desc_t radeon_ioctls[];
73extern int radeon_max_ioctl;
74
75static struct drm_driver driver = {
76 .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL,
77 .dev_priv_size = sizeof(drm_radeon_buf_priv_t),
78 .preinit = radeon_driver_preinit,
79 .postcleanup = radeon_driver_postcleanup,
80 .prerelease = radeon_driver_prerelease,
81 .pretakedown = radeon_driver_pretakedown,
82 .open_helper = radeon_driver_open_helper,
83 .vblank_wait = radeon_driver_vblank_wait,
84 .irq_preinstall = radeon_driver_irq_preinstall,
85 .irq_postinstall = radeon_driver_irq_postinstall,
86 .irq_uninstall = radeon_driver_irq_uninstall,
87 .irq_handler = radeon_driver_irq_handler,
88 .free_filp_priv = radeon_driver_free_filp_priv,
89 .reclaim_buffers = drm_core_reclaim_buffers,
90 .get_map_ofs = drm_core_get_map_ofs,
91 .get_reg_ofs = drm_core_get_reg_ofs,
92 .postinit = postinit,
93 .version = version,
94 .ioctls = radeon_ioctls,
95 .dma_ioctl = radeon_cp_buffers,
96 .fops = {
97 .owner = THIS_MODULE,
98 .open = drm_open,
99 .release = drm_release,
100 .ioctl = drm_ioctl,
101 .mmap = drm_mmap,
102 .poll = drm_poll,
103 .fasync = drm_fasync,
104 },
105 .pci_driver = {
106 .name = DRIVER_NAME,
107 .id_table = pciidlist,
108 }
109};
110
111static int __init radeon_init(void)
112{
113 driver.num_ioctls = radeon_max_ioctl;
114 return drm_init(&driver);
115}
116
117static void __exit radeon_exit(void)
118{
119 drm_exit(&driver);
120}
121
122module_init(radeon_init);
123module_exit(radeon_exit);
124
125MODULE_AUTHOR( DRIVER_AUTHOR );
126MODULE_DESCRIPTION( DRIVER_DESC );
127MODULE_LICENSE("GPL and additional rights");