aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c38
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 dcb91f5df6e3..2c0167693450 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);
42unsigned int i915_fbpercrtc = 0; 42unsigned int i915_fbpercrtc = 0;
43module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400); 43module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400);
44 44
45static struct drm_driver driver;
46
45static struct pci_device_id pciidlist[] = { 47static 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
122static int __devinit
123i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
124{
125 return drm_get_dev(pdev, ent, &driver);
126}
127
128static void
129i915_pci_remove(struct pci_dev *pdev)
130{
131 struct drm_device *dev = pci_get_drvdata(pdev);
132
133 drm_put_dev(dev);
134}
135
136static int
137i915_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
144static int
145i915_pci_resume(struct pci_dev *pdev)
146{
147 struct drm_device *dev = pci_get_drvdata(pdev);
148
149 return i915_resume(dev);
150}
151
120static struct vm_operations_struct i915_gem_vm_ops = { 152static 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,
@@ -174,6 +206,12 @@ static struct drm_driver driver = {
174 .pci_driver = { 206 .pci_driver = {
175 .name = DRIVER_NAME, 207 .name = DRIVER_NAME,
176 .id_table = pciidlist, 208 .id_table = pciidlist,
209 .probe = i915_pci_probe,
210 .remove = i915_pci_remove,
211#ifdef CONFIG_PM
212 .resume = i915_pci_resume,
213 .suspend = i915_pci_suspend,
214#endif
177 }, 215 },
178 216
179 .name = DRIVER_NAME, 217 .name = DRIVER_NAME,