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#include <linux/module.h>
27
28#include <drm/drmP.h>
29#include <drm/savage_drm.h>
30#include "savage_drv.h"
31
32#include <drm/drm_pciids.h>
33
34static struct pci_device_id pciidlist[] = {
35 savage_PCI_IDS
36};
37
38static const struct file_operations savage_driver_fops = {
39 .owner = THIS_MODULE,
40 .open = drm_open,
41 .release = drm_release,
42 .unlocked_ioctl = drm_ioctl,
43 .mmap = drm_legacy_mmap,
44 .poll = drm_poll,
45#ifdef CONFIG_COMPAT
46 .compat_ioctl = drm_compat_ioctl,
47#endif
48 .llseek = noop_llseek,
49};
50
51static struct drm_driver driver = {
52 .driver_features =
53 DRIVER_USE_AGP | DRIVER_HAVE_DMA | DRIVER_PCI_DMA,
54 .dev_priv_size = sizeof(drm_savage_buf_priv_t),
55 .load = savage_driver_load,
56 .firstopen = savage_driver_firstopen,
57 .preclose = savage_reclaim_buffers,
58 .lastclose = savage_driver_lastclose,
59 .unload = savage_driver_unload,
60 .set_busid = drm_pci_set_busid,
61 .ioctls = savage_ioctls,
62 .dma_ioctl = savage_bci_buffers,
63 .fops = &savage_driver_fops,
64 .name = DRIVER_NAME,
65 .desc = DRIVER_DESC,
66 .date = DRIVER_DATE,
67 .major = DRIVER_MAJOR,
68 .minor = DRIVER_MINOR,
69 .patchlevel = DRIVER_PATCHLEVEL,
70};
71
72static struct pci_driver savage_pci_driver = {
73 .name = DRIVER_NAME,
74 .id_table = pciidlist,
75};
76
77static int __init savage_init(void)
78{
79 driver.num_ioctls = savage_max_ioctl;
80 return drm_pci_init(&driver, &savage_pci_driver);
81}
82
83static void __exit savage_exit(void)
84{
85 drm_pci_exit(&driver, &savage_pci_driver);
86}
87
88module_init(savage_init);
89module_exit(savage_exit);
90
91MODULE_AUTHOR(DRIVER_AUTHOR);
92MODULE_DESCRIPTION(DRIVER_DESC);
93MODULE_LICENSE("GPL and additional rights");
94