OSDN Git Service

radeon: Fix type in check for tmds type.
[android-x86/external-libdrm.git] / linux-core / mach64_drv.c
1 /* mach64_drv.c -- mach64 (Rage Pro) driver -*- linux-c -*-
2  * Created: Fri Nov 24 18:34:32 2000 by gareth@valinux.com
3  *
4  * Copyright 2000 Gareth Hughes
5  * All Rights Reserved.
6  *
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:
13  *
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
16  * Software.
17  *
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.
24  *
25  * Authors:
26  *    Gareth Hughes <gareth@valinux.com>
27  *    Leif Delgass <ldelgass@retinalburn.net>
28  */
29
30 #include "drmP.h"
31 #include "drm.h"
32 #include "mach64_drm.h"
33 #include "mach64_drv.h"
34
35 #include "drm_pciids.h"
36
37 static struct pci_device_id pciidlist[] = {
38         mach64_PCI_IDS
39 };
40
41 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent);
42 static struct drm_driver driver = {
43         .driver_features =
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,
59         .fops = {
60                 .owner = THIS_MODULE,
61                 .open = drm_open,
62                 .release = drm_release,
63                 .ioctl = drm_ioctl,
64                 .mmap = drm_mmap,
65                 .poll = drm_poll,
66                 .fasync = drm_fasync,
67                 },
68         .pci_driver = {
69                 .name = DRIVER_NAME,
70                 .id_table = pciidlist,
71                 .probe = probe,
72                 .remove = __devexit_p(drm_cleanup_pci),
73         },
74
75         .name = DRIVER_NAME,
76         .desc = DRIVER_DESC,
77         .date = DRIVER_DATE,
78         .major = DRIVER_MAJOR,
79         .minor = DRIVER_MINOR,
80         .patchlevel = DRIVER_PATCHLEVEL,
81 };
82
83 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
84 {
85         return drm_get_dev(pdev, ent, &driver);
86 }
87
88
89 static int __init mach64_init(void)
90 {
91         driver.num_ioctls = mach64_max_ioctl;
92         return drm_init(&driver, pciidlist);
93 }
94
95 static void __exit mach64_exit(void)
96 {
97         drm_exit(&driver);
98 }
99
100 module_init(mach64_init);
101 module_exit(mach64_exit);
102
103 MODULE_AUTHOR(DRIVER_AUTHOR);
104 MODULE_DESCRIPTION(DRIVER_DESC);
105 MODULE_LICENSE("GPL and additional rights");