diff options
Diffstat (limited to 'drivers/char/drm/mga_drv.c')
-rw-r--r-- | drivers/char/drm/mga_drv.c | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/drivers/char/drm/mga_drv.c b/drivers/char/drm/mga_drv.c index daabbba3b297..220037a91c09 100644 --- a/drivers/char/drm/mga_drv.c +++ b/drivers/char/drm/mga_drv.c | |||
@@ -35,14 +35,13 @@ | |||
35 | #include "mga_drm.h" | 35 | #include "mga_drm.h" |
36 | #include "mga_drv.h" | 36 | #include "mga_drv.h" |
37 | 37 | ||
38 | |||
39 | #include "drm_pciids.h" | 38 | #include "drm_pciids.h" |
40 | 39 | ||
41 | static int mga_driver_device_is_agp(drm_device_t * dev); | 40 | static int mga_driver_device_is_agp(drm_device_t * dev); |
42 | static int postinit( struct drm_device *dev, unsigned long flags ) | 41 | static int postinit(struct drm_device *dev, unsigned long flags) |
43 | { | 42 | { |
44 | drm_mga_private_t * const dev_priv = | 43 | drm_mga_private_t *const dev_priv = |
45 | (drm_mga_private_t *) dev->dev_private; | 44 | (drm_mga_private_t *) dev->dev_private; |
46 | 45 | ||
47 | dev_priv->mmio_base = pci_resource_start(dev->pdev, 1); | 46 | dev_priv->mmio_base = pci_resource_start(dev->pdev, 1); |
48 | dev_priv->mmio_size = pci_resource_len(dev->pdev, 1); | 47 | dev_priv->mmio_size = pci_resource_len(dev->pdev, 1); |
@@ -52,28 +51,26 @@ static int postinit( struct drm_device *dev, unsigned long flags ) | |||
52 | dev->types[7] = _DRM_STAT_PRIMARY; | 51 | dev->types[7] = _DRM_STAT_PRIMARY; |
53 | dev->types[8] = _DRM_STAT_SECONDARY; | 52 | dev->types[8] = _DRM_STAT_SECONDARY; |
54 | 53 | ||
55 | DRM_INFO( "Initialized %s %d.%d.%d %s on minor %d: %s\n", | 54 | DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n", |
56 | DRIVER_NAME, | 55 | DRIVER_NAME, |
57 | DRIVER_MAJOR, | 56 | DRIVER_MAJOR, |
58 | DRIVER_MINOR, | 57 | DRIVER_MINOR, |
59 | DRIVER_PATCHLEVEL, | 58 | DRIVER_PATCHLEVEL, |
60 | DRIVER_DATE, | 59 | DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev) |
61 | dev->primary.minor, | 60 | ); |
62 | pci_pretty_name(dev->pdev) | ||
63 | ); | ||
64 | return 0; | 61 | return 0; |
65 | } | 62 | } |
66 | 63 | ||
67 | static int version( drm_version_t *version ) | 64 | static int version(drm_version_t * version) |
68 | { | 65 | { |
69 | int len; | 66 | int len; |
70 | 67 | ||
71 | version->version_major = DRIVER_MAJOR; | 68 | version->version_major = DRIVER_MAJOR; |
72 | version->version_minor = DRIVER_MINOR; | 69 | version->version_minor = DRIVER_MINOR; |
73 | version->version_patchlevel = DRIVER_PATCHLEVEL; | 70 | version->version_patchlevel = DRIVER_PATCHLEVEL; |
74 | DRM_COPY( version->name, DRIVER_NAME ); | 71 | DRM_COPY(version->name, DRIVER_NAME); |
75 | DRM_COPY( version->date, DRIVER_DATE ); | 72 | DRM_COPY(version->date, DRIVER_DATE); |
76 | DRM_COPY( version->desc, DRIVER_DESC ); | 73 | DRM_COPY(version->desc, DRIVER_DESC); |
77 | return 0; | 74 | return 0; |
78 | } | 75 | } |
79 | 76 | ||
@@ -85,7 +82,10 @@ extern drm_ioctl_desc_t mga_ioctls[]; | |||
85 | extern int mga_max_ioctl; | 82 | extern int mga_max_ioctl; |
86 | 83 | ||
87 | static struct drm_driver driver = { | 84 | static struct drm_driver driver = { |
88 | .driver_features = DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL, | 85 | .driver_features = |
86 | DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | DRIVER_USE_MTRR | | ||
87 | DRIVER_HAVE_DMA | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | | ||
88 | DRIVER_IRQ_VBL, | ||
89 | .preinit = mga_driver_preinit, | 89 | .preinit = mga_driver_preinit, |
90 | .postcleanup = mga_driver_postcleanup, | 90 | .postcleanup = mga_driver_postcleanup, |
91 | .pretakedown = mga_driver_pretakedown, | 91 | .pretakedown = mga_driver_pretakedown, |
@@ -104,21 +104,21 @@ static struct drm_driver driver = { | |||
104 | .ioctls = mga_ioctls, | 104 | .ioctls = mga_ioctls, |
105 | .dma_ioctl = mga_dma_buffers, | 105 | .dma_ioctl = mga_dma_buffers, |
106 | .fops = { | 106 | .fops = { |
107 | .owner = THIS_MODULE, | 107 | .owner = THIS_MODULE, |
108 | .open = drm_open, | 108 | .open = drm_open, |
109 | .release = drm_release, | 109 | .release = drm_release, |
110 | .ioctl = drm_ioctl, | 110 | .ioctl = drm_ioctl, |
111 | .mmap = drm_mmap, | 111 | .mmap = drm_mmap, |
112 | .poll = drm_poll, | 112 | .poll = drm_poll, |
113 | .fasync = drm_fasync, | 113 | .fasync = drm_fasync, |
114 | #ifdef CONFIG_COMPAT | 114 | #ifdef CONFIG_COMPAT |
115 | .compat_ioctl = mga_compat_ioctl, | 115 | .compat_ioctl = mga_compat_ioctl, |
116 | #endif | 116 | #endif |
117 | }, | 117 | }, |
118 | .pci_driver = { | 118 | .pci_driver = { |
119 | .name = DRIVER_NAME, | 119 | .name = DRIVER_NAME, |
120 | .id_table = pciidlist, | 120 | .id_table = pciidlist, |
121 | } | 121 | } |
122 | }; | 122 | }; |
123 | 123 | ||
124 | static int __init mga_init(void) | 124 | static int __init mga_init(void) |
@@ -135,8 +135,8 @@ static void __exit mga_exit(void) | |||
135 | module_init(mga_init); | 135 | module_init(mga_init); |
136 | module_exit(mga_exit); | 136 | module_exit(mga_exit); |
137 | 137 | ||
138 | MODULE_AUTHOR( DRIVER_AUTHOR ); | 138 | MODULE_AUTHOR(DRIVER_AUTHOR); |
139 | MODULE_DESCRIPTION( DRIVER_DESC ); | 139 | MODULE_DESCRIPTION(DRIVER_DESC); |
140 | MODULE_LICENSE("GPL and additional rights"); | 140 | MODULE_LICENSE("GPL and additional rights"); |
141 | 141 | ||
142 | /** | 142 | /** |
@@ -153,8 +153,7 @@ MODULE_LICENSE("GPL and additional rights"); | |||
153 | */ | 153 | */ |
154 | int mga_driver_device_is_agp(drm_device_t * dev) | 154 | int mga_driver_device_is_agp(drm_device_t * dev) |
155 | { | 155 | { |
156 | const struct pci_dev * const pdev = dev->pdev; | 156 | const struct pci_dev *const pdev = dev->pdev; |
157 | |||
158 | 157 | ||
159 | /* There are PCI versions of the G450. These cards have the | 158 | /* There are PCI versions of the G450. These cards have the |
160 | * same PCI ID as the AGP G450, but have an additional PCI-to-PCI | 159 | * same PCI ID as the AGP G450, but have an additional PCI-to-PCI |
@@ -164,10 +163,10 @@ int mga_driver_device_is_agp(drm_device_t * dev) | |||
164 | * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the | 163 | * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the |
165 | * device. | 164 | * device. |
166 | */ | 165 | */ |
167 | 166 | ||
168 | if ( (pdev->device == 0x0525) | 167 | if ((pdev->device == 0x0525) |
169 | && (pdev->bus->self->vendor == 0x3388) | 168 | && (pdev->bus->self->vendor == 0x3388) |
170 | && (pdev->bus->self->device == 0x0021) ) { | 169 | && (pdev->bus->self->device == 0x0021)) { |
171 | return 0; | 170 | return 0; |
172 | } | 171 | } |
173 | 172 | ||