1 /* mach64_drv.c -- mach64 (Rage Pro) driver -*- linux-c -*-
2 * Created: Fri Nov 24 18:34:32 2000 by gareth@valinux.com
4 * Copyright 2000 Gareth Hughes
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:
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
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 * GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 * Gareth Hughes <gareth@valinux.com>
27 * Leif Delgass <ldelgass@retinalburn.net>
32 #include "mach64_drm.h"
33 #include "mach64_drv.h"
35 #include "drm_pciids.h"
37 static struct pci_device_id pciidlist[] = {
41 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent);
42 static struct drm_driver driver = {
44 DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA
45 | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
46 .lastclose = mach64_driver_lastclose,
47 .get_vblank_counter = mach64_get_vblank_counter,
48 .enable_vblank = mach64_enable_vblank,
49 .disable_vblank = mach64_disable_vblank,
50 .irq_preinstall = mach64_driver_irq_preinstall,
51 .irq_postinstall = mach64_driver_irq_postinstall,
52 .irq_uninstall = mach64_driver_irq_uninstall,
53 .irq_handler = mach64_driver_irq_handler,
54 .reclaim_buffers = drm_core_reclaim_buffers,
55 .get_map_ofs = drm_core_get_map_ofs,
56 .get_reg_ofs = drm_core_get_reg_ofs,
57 .ioctls = mach64_ioctls,
58 .dma_ioctl = mach64_dma_buffers,
62 .release = drm_release,
70 .id_table = pciidlist,
72 .remove = __devexit_p(drm_cleanup_pci),
78 .major = DRIVER_MAJOR,
79 .minor = DRIVER_MINOR,
80 .patchlevel = DRIVER_PATCHLEVEL,
83 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
85 return drm_get_dev(pdev, ent, &driver);
89 static int __init mach64_init(void)
91 driver.num_ioctls = mach64_max_ioctl;
92 return drm_init(&driver, pciidlist);
95 static void __exit mach64_exit(void)
100 module_init(mach64_init);
101 module_exit(mach64_exit);
103 MODULE_AUTHOR(DRIVER_AUTHOR);
104 MODULE_DESCRIPTION(DRIVER_DESC);
105 MODULE_LICENSE("GPL and additional rights");