diff options
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index b293ef0bae71..d10ec9e5033c 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -42,6 +42,8 @@ module_param_named(modeset, i915_modeset, int, 0400); | |||
42 | unsigned int i915_fbpercrtc = 0; | 42 | unsigned int i915_fbpercrtc = 0; |
43 | module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); | 43 | module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); |
44 | 44 | ||
45 | static struct drm_driver driver; | ||
46 | |||
45 | static struct pci_device_id pciidlist[] = { | 47 | static struct pci_device_id pciidlist[] = { |
46 | i915_PCI_IDS | 48 | i915_PCI_IDS |
47 | }; | 49 | }; |
@@ -117,6 +119,36 @@ static int i915_resume(struct drm_device *dev) | |||
117 | return ret; | 119 | return ret; |
118 | } | 120 | } |
119 | 121 | ||
122 | static int __devinit | ||
123 | i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | ||
124 | { | ||
125 | return drm_get_dev(pdev, ent, &driver); | ||
126 | } | ||
127 | |||
128 | static void | ||
129 | i915_pci_remove(struct pci_dev *pdev) | ||
130 | { | ||
131 | struct drm_device *dev = pci_get_drvdata(pdev); | ||
132 | |||
133 | drm_put_dev(dev); | ||
134 | } | ||
135 | |||
136 | static int | ||
137 | i915_pci_suspend(struct pci_dev *pdev, pm_message_t state) | ||
138 | { | ||
139 | struct drm_device *dev = pci_get_drvdata(pdev); | ||
140 | |||
141 | return i915_suspend(dev, state); | ||
142 | } | ||
143 | |||
144 | static int | ||
145 | i915_pci_resume(struct pci_dev *pdev) | ||
146 | { | ||
147 | struct drm_device *dev = pci_get_drvdata(pdev); | ||
148 | |||
149 | return i915_resume(dev); | ||
150 | } | ||
151 | |||
120 | static struct vm_operations_struct i915_gem_vm_ops = { | 152 | static struct vm_operations_struct i915_gem_vm_ops = { |
121 | .fault = i915_gem_fault, | 153 | .fault = i915_gem_fault, |
122 | .open = drm_gem_vm_open, | 154 | .open = drm_gem_vm_open, |
@@ -172,6 +204,12 @@ static struct drm_driver driver = { | |||
172 | .pci_driver = { | 204 | .pci_driver = { |
173 | .name = DRIVER_NAME, | 205 | .name = DRIVER_NAME, |
174 | .id_table = pciidlist, | 206 | .id_table = pciidlist, |
207 | .probe = i915_pci_probe, | ||
208 | .remove = i915_pci_remove, | ||
209 | #ifdef CONFIG_PM | ||
210 | .resume = i915_pci_resume, | ||
211 | .suspend = i915_pci_suspend, | ||
212 | #endif | ||
175 | }, | 213 | }, |
176 | 214 | ||
177 | .name = DRIVER_NAME, | 215 | .name = DRIVER_NAME, |