This source file includes following definitions.
- r128_driver_load
- r128_init
- r128_exit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #include <linux/module.h>
33
34 #include <drm/drm_drv.h>
35 #include <drm/drm_file.h>
36 #include <drm/drm_pci.h>
37 #include <drm/drm_pciids.h>
38 #include <drm/drm_vblank.h>
39 #include <drm/r128_drm.h>
40
41 #include "r128_drv.h"
42
43 static struct pci_device_id pciidlist[] = {
44 r128_PCI_IDS
45 };
46
47 static const struct file_operations r128_driver_fops = {
48 .owner = THIS_MODULE,
49 .open = drm_open,
50 .release = drm_release,
51 .unlocked_ioctl = drm_ioctl,
52 .mmap = drm_legacy_mmap,
53 .poll = drm_poll,
54 #ifdef CONFIG_COMPAT
55 .compat_ioctl = r128_compat_ioctl,
56 #endif
57 .llseek = noop_llseek,
58 };
59
60 static struct drm_driver driver = {
61 .driver_features =
62 DRIVER_USE_AGP | DRIVER_PCI_DMA | DRIVER_SG | DRIVER_LEGACY |
63 DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ,
64 .dev_priv_size = sizeof(drm_r128_buf_priv_t),
65 .load = r128_driver_load,
66 .preclose = r128_driver_preclose,
67 .lastclose = r128_driver_lastclose,
68 .get_vblank_counter = r128_get_vblank_counter,
69 .enable_vblank = r128_enable_vblank,
70 .disable_vblank = r128_disable_vblank,
71 .irq_preinstall = r128_driver_irq_preinstall,
72 .irq_postinstall = r128_driver_irq_postinstall,
73 .irq_uninstall = r128_driver_irq_uninstall,
74 .irq_handler = r128_driver_irq_handler,
75 .ioctls = r128_ioctls,
76 .dma_ioctl = r128_cce_buffers,
77 .fops = &r128_driver_fops,
78 .name = DRIVER_NAME,
79 .desc = DRIVER_DESC,
80 .date = DRIVER_DATE,
81 .major = DRIVER_MAJOR,
82 .minor = DRIVER_MINOR,
83 .patchlevel = DRIVER_PATCHLEVEL,
84 };
85
86 int r128_driver_load(struct drm_device *dev, unsigned long flags)
87 {
88 pci_set_master(dev->pdev);
89 return drm_vblank_init(dev, 1);
90 }
91
92 static struct pci_driver r128_pci_driver = {
93 .name = DRIVER_NAME,
94 .id_table = pciidlist,
95 };
96
97 static int __init r128_init(void)
98 {
99 driver.num_ioctls = r128_max_ioctl;
100
101 return drm_legacy_pci_init(&driver, &r128_pci_driver);
102 }
103
104 static void __exit r128_exit(void)
105 {
106 drm_legacy_pci_exit(&driver, &r128_pci_driver);
107 }
108
109 module_init(r128_init);
110 module_exit(r128_exit);
111
112 MODULE_AUTHOR(DRIVER_AUTHOR);
113 MODULE_DESCRIPTION(DRIVER_DESC);
114 MODULE_LICENSE("GPL and additional rights");