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.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index a80ead215282..aac12ee31a46 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -33,11 +33,22 @@
33#include "i915_drv.h" 33#include "i915_drv.h"
34 34
35#include "drm_pciids.h" 35#include "drm_pciids.h"
36#include <linux/console.h>
37
38static unsigned int i915_modeset = -1;
39module_param_named(modeset, i915_modeset, int, 0400);
40
41unsigned int i915_fbpercrtc = 0;
42module_param_named(fbpercrtc, i915_fbpercrtc, int, 0400);
36 43
37static struct pci_device_id pciidlist[] = { 44static struct pci_device_id pciidlist[] = {
38 i915_PCI_IDS 45 i915_PCI_IDS
39}; 46};
40 47
48#if defined(CONFIG_DRM_I915_KMS)
49MODULE_DEVICE_TABLE(pci, pciidlist);
50#endif
51
41static int i915_suspend(struct drm_device *dev, pm_message_t state) 52static int i915_suspend(struct drm_device *dev, pm_message_t state)
42{ 53{
43 struct drm_i915_private *dev_priv = dev->dev_private; 54 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -81,6 +92,10 @@ static int i915_resume(struct drm_device *dev)
81 return 0; 92 return 0;
82} 93}
83 94
95static struct vm_operations_struct i915_gem_vm_ops = {
96 .fault = i915_gem_fault,
97};
98
84static struct drm_driver driver = { 99static struct drm_driver driver = {
85 /* don't use mtrr's here, the Xserver or user space app should 100 /* don't use mtrr's here, the Xserver or user space app should
86 * deal with them for intel hardware. 101 * deal with them for intel hardware.
@@ -97,7 +112,6 @@ static struct drm_driver driver = {
97 .suspend = i915_suspend, 112 .suspend = i915_suspend,
98 .resume = i915_resume, 113 .resume = i915_resume,
99 .device_is_agp = i915_driver_device_is_agp, 114 .device_is_agp = i915_driver_device_is_agp,
100 .get_vblank_counter = i915_get_vblank_counter,
101 .enable_vblank = i915_enable_vblank, 115 .enable_vblank = i915_enable_vblank,
102 .disable_vblank = i915_disable_vblank, 116 .disable_vblank = i915_disable_vblank,
103 .irq_preinstall = i915_driver_irq_preinstall, 117 .irq_preinstall = i915_driver_irq_preinstall,
@@ -107,17 +121,20 @@ static struct drm_driver driver = {
107 .reclaim_buffers = drm_core_reclaim_buffers, 121 .reclaim_buffers = drm_core_reclaim_buffers,
108 .get_map_ofs = drm_core_get_map_ofs, 122 .get_map_ofs = drm_core_get_map_ofs,
109 .get_reg_ofs = drm_core_get_reg_ofs, 123 .get_reg_ofs = drm_core_get_reg_ofs,
124 .master_create = i915_master_create,
125 .master_destroy = i915_master_destroy,
110 .proc_init = i915_gem_proc_init, 126 .proc_init = i915_gem_proc_init,
111 .proc_cleanup = i915_gem_proc_cleanup, 127 .proc_cleanup = i915_gem_proc_cleanup,
112 .gem_init_object = i915_gem_init_object, 128 .gem_init_object = i915_gem_init_object,
113 .gem_free_object = i915_gem_free_object, 129 .gem_free_object = i915_gem_free_object,
130 .gem_vm_ops = &i915_gem_vm_ops,
114 .ioctls = i915_ioctls, 131 .ioctls = i915_ioctls,
115 .fops = { 132 .fops = {
116 .owner = THIS_MODULE, 133 .owner = THIS_MODULE,
117 .open = drm_open, 134 .open = drm_open,
118 .release = drm_release, 135 .release = drm_release,
119 .ioctl = drm_ioctl, 136 .ioctl = drm_ioctl,
120 .mmap = drm_mmap, 137 .mmap = drm_gem_mmap,
121 .poll = drm_poll, 138 .poll = drm_poll,
122 .fasync = drm_fasync, 139 .fasync = drm_fasync,
123#ifdef CONFIG_COMPAT 140#ifdef CONFIG_COMPAT
@@ -141,6 +158,28 @@ static struct drm_driver driver = {
141static int __init i915_init(void) 158static int __init i915_init(void)
142{ 159{
143 driver.num_ioctls = i915_max_ioctl; 160 driver.num_ioctls = i915_max_ioctl;
161
162 /*
163 * If CONFIG_DRM_I915_KMS is set, default to KMS unless
164 * explicitly disabled with the module pararmeter.
165 *
166 * Otherwise, just follow the parameter (defaulting to off).
167 *
168 * Allow optional vga_text_mode_force boot option to override
169 * the default behavior.
170 */
171#if defined(CONFIG_DRM_I915_KMS)
172 if (i915_modeset != 0)
173 driver.driver_features |= DRIVER_MODESET;
174#endif
175 if (i915_modeset == 1)
176 driver.driver_features |= DRIVER_MODESET;
177
178#ifdef CONFIG_VGA_CONSOLE
179 if (vgacon_text_force() && i915_modeset == -1)
180 driver.driver_features &= ~DRIVER_MODESET;
181#endif
182
144 return drm_init(&driver); 183 return drm_init(&driver);
145} 184}
146 185