aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2009-09-14 17:48:45 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-17 17:36:22 -0400
commit11ed50ec2a316928c2bacc1149bded86c6a96068 (patch)
treeb363e00c943a34a04c1d48ec747d0a41f920e567 /drivers/gpu/drm/i915/i915_dma.c
parentf65d94211e2bcba17faf05a6a3809af0e4217767 (diff)
drm/i915: Implement GPU reset on i965
This patch puts in place the machinery to attempt to reset the GPU. This will be used when attempting to recover from a GPU hang. Signed-off-by: Owain G. Ainsworth <oga@openbsd.org> Signed-off-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 08a5048335e1..f47adb4aa59a 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1173,6 +1173,9 @@ static int i915_load_modeset_init(struct drm_device *dev,
1173 drm_mm_init(&dev_priv->vram, 0, prealloc_size); 1173 drm_mm_init(&dev_priv->vram, 0, prealloc_size);
1174 DRM_INFO("set up %ldM of stolen space\n", prealloc_size / (1024*1024)); 1174 DRM_INFO("set up %ldM of stolen space\n", prealloc_size / (1024*1024));
1175 1175
1176 /* We're off and running w/KMS */
1177 dev_priv->mm.suspended = 0;
1178
1176 /* Let GEM Manage from end of prealloc space to end of aperture. 1179 /* Let GEM Manage from end of prealloc space to end of aperture.
1177 * 1180 *
1178 * However, leave one page at the end still bound to the scratch page. 1181 * However, leave one page at the end still bound to the scratch page.
@@ -1184,7 +1187,9 @@ static int i915_load_modeset_init(struct drm_device *dev,
1184 */ 1187 */
1185 i915_gem_do_init(dev, prealloc_size, agp_size - 4096); 1188 i915_gem_do_init(dev, prealloc_size, agp_size - 4096);
1186 1189
1190 mutex_lock(&dev->struct_mutex);
1187 ret = i915_gem_init_ringbuffer(dev); 1191 ret = i915_gem_init_ringbuffer(dev);
1192 mutex_unlock(&dev->struct_mutex);
1188 if (ret) 1193 if (ret)
1189 goto out; 1194 goto out;
1190 1195
@@ -1433,6 +1438,9 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1433 return ret; 1438 return ret;
1434 } 1439 }
1435 1440
1441 /* Start out suspended */
1442 dev_priv->mm.suspended = 1;
1443
1436 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 1444 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
1437 ret = i915_load_modeset_init(dev, prealloc_start, 1445 ret = i915_load_modeset_init(dev, prealloc_start,
1438 prealloc_size, agp_size); 1446 prealloc_size, agp_size);