2 * Copyright 2007 Jerome Glisse.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
26 * Jerome Glisse <glisse@freedesktop.org>
28 #include "drm_pciids.h"
29 #include "radeon_ms.h"
31 extern struct drm_fence_driver r3xx_fence_driver;
32 extern struct drm_bo_driver radeon_ms_bo_driver;
33 extern struct drm_ioctl_desc radeon_ms_ioctls[];
34 extern int radeon_ms_num_ioctls;
36 static int radeon_ms_driver_dri_library_name(struct drm_device * dev,
38 static int radeon_ms_driver_probe(struct pci_dev *pdev,
39 const struct pci_device_id *ent);
41 static struct pci_device_id pciidlist[] = {
45 static struct drm_driver driver = {
46 .load = radeon_ms_driver_load,
48 .open = radeon_ms_driver_open,
51 .lastclose = radeon_ms_driver_lastclose,
52 .unload = radeon_ms_driver_unload,
53 .dma_ioctl = radeon_ms_driver_dma_ioctl,
55 .dma_quiescent = NULL,
58 .kernel_context_switch = NULL,
59 .kernel_context_switch_unlock = NULL,
60 .dri_library_name = radeon_ms_driver_dri_library_name,
61 .device_is_agp = NULL,
62 .irq_handler = radeon_ms_irq_handler,
63 .irq_preinstall = radeon_ms_irq_preinstall,
64 .irq_postinstall = radeon_ms_irq_postinstall,
65 .irq_uninstall = radeon_ms_irq_uninstall,
66 .reclaim_buffers = drm_core_reclaim_buffers,
67 .reclaim_buffers_locked = NULL,
68 .reclaim_buffers_idlelocked = NULL,
69 .get_map_ofs = drm_core_get_map_ofs,
70 .get_reg_ofs = drm_core_get_reg_ofs,
72 .fb_probe = radeonfb_probe,
73 .fb_remove = radeonfb_remove,
74 .fence_driver = &r3xx_fence_driver,
75 .bo_driver = &radeon_ms_bo_driver,
76 .major = DRIVER_MAJOR,
77 .minor = DRIVER_MINOR,
78 .patchlevel = DRIVER_PATCHLEVEL,
83 DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG |
84 DRIVER_HAVE_IRQ | DRIVER_HAVE_DMA | DRIVER_IRQ_SHARED,
86 .ioctls = radeon_ms_ioctls,
91 .release = drm_release,
96 #if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
97 .compat_ioctl = radeon_ms_compat_ioctl,
102 .id_table = pciidlist,
103 .probe = radeon_ms_driver_probe,
104 .remove = __devexit_p(drm_cleanup_pci),
108 static int radeon_ms_driver_probe(struct pci_dev *pdev,
109 const struct pci_device_id *ent)
111 return drm_get_dev(pdev, ent, &driver);
114 static int radeon_ms_driver_dri_library_name(struct drm_device * dev,
117 struct drm_radeon_private *dev_priv = dev->dev_private;
120 switch (dev_priv->family) {
122 ret = snprintf(buf, PAGE_SIZE, "\n");
127 static void __exit radeon_ms_driver_exit(void)
132 static int __init radeon_ms_driver_init(void)
134 driver.num_ioctls = radeon_ms_num_ioctls;
135 driver.driver_features |= DRIVER_MODESET;
136 return drm_init(&driver, pciidlist);
139 module_init(radeon_ms_driver_init);
140 module_exit(radeon_ms_driver_exit);
142 MODULE_AUTHOR(DRIVER_AUTHOR);
143 MODULE_DESCRIPTION(DRIVER_DESC);
144 MODULE_LICENSE("GPL and additional rights");